Conteúdo

# Encrypting Documents with OpenPGP

O LibreOffice pode cifrar documentos usando a criptografia da chave pública OpenPGP. O documento é cifrado usando um algoritmo de cifra simétrica.

GPG signing only works for ODF documents.

Para aceder a este comando...

Escolha Ficheiro - Guardar como, selecione Cifrar com chave GPG e clique em Guardar.

LibreOffice can encrypt documents confidentially using OpenPGP. The document is encrypted using a symmetric encryption algorithm, which requires a symmetric key. Each symmetric key is used only once and is also called a session key. The document and its session key are sent to the recipient. The session key must be sent to the recipients so they know how to decrypt the document, but to protect it during transmission it is encrypted with the recipient's public key. Only the private key belonging to the recipient can decrypt the session key.

LibreOffice uses the OpenPGP software installed in your computer. If no OpenPGP software is available you must download and install one suitable for your operating system, likely from your application store or software distribution channel.

Here are some external GPG applications known to work with LibreOffice:

- gpg4win no Windows

- GPG Suite on macOS

- No Linux, geralmente já instalado:

  gnupg - a command line utility for signing, encrypting and key management.

  Graphical applications for gnupg such as Seahorse (gnome), Kleopatra and KGpg (KDE).

  gpgme - an application program interface (API) to develop applications with GPG.

You must define a personal pair of cryptography keys with the OpenPGP application. Refer to the OpenPGP software installed on how to create a pair of keys, it is usually the first step to execute after the software installation.

## LibreOffice Encryption Setup

Define a chave preferencial para a criptografia e assinatura digital OpenPGP. Estas chaves são pré-selecionadas na caixa de diálogo de seleção de chaves sempre que assinar ou cifrar um documento. Assim não é necessário selecioná-la se assinar frequentemente com uma chave específica.

Choose menu LibreOffice - Preferences Tools - Options – User Data. In the Cryptography area:

#### Chave de assinatura OpenPGP

Selecione a chave OpenPGP na lista suspensa para assinar documentos ODF.

#### Chave de cifra OpenPGP

Selecione a chave OpenPGP na lista suspensa para cifrar documentos ODF.

#### Ao cifrar documentos, cifrar sempre para mim

Assinale esta caixa para cifrar também o ficheiro com a chave pública de modo a que seja aberto através da sua chave privada.

Mantenha esta opção selecionada, para poder sempre decifrar os documentos que foram cifrados para outras pessoas.

## Cifrar documentos

OpenPGP encryption requires the use of the public key of the recipient and this key must be available in the OpenPGP key chain stored in your computer. To encrypt a document:

1. Escolha Ficheiro - Guardar como,

2. Introduza o nome para o ficheiro.

3. Mark the Encrypt with GPG key checkbox.

4. Click Save. LibreOffice opens the OpenPGP public key selection dialog.

5. Choose the public key of the recipient. You can select multiple keys at the time.

6. Click OK to close the dialog and save the file.

The file is saved encrypted with the selected public keys.

Only the private key belonging to the recipient can decrypt the document, unless you also encrypt for yourself.

## Decifrar documentos

Apenas pode decifrar documentos que tenham sido cifrados com a sua chave pública. Para decifrar um documento:

1. Abra um documento e aparecerá uma caixa de diálogo.

2. Introduza a palavra-passe da chave privada OpenPGP. O documento será decifrado e o seu conteúdo estará disponível.

## Diferença entre cifrar um documento com OpenPGP e guardar com palavra-passe

Ambos os métodos garantem confidencialidade, mas de forma diferente.

When you save a document with a password, you must remember the password inserted to open the document later. Anyone else that needs to open the document must also know the password used at save time. Therefore, the Save password must be transmitted to be known by other users.

Files encrypted with the save password cannot be decrypted unless the save password is supplied.

With document OpenPGP encryption, you define the set of users that can decrypt the document and you don’t need to send passwords through channels which security is unknown. Besides, the OpenPGP application manages the key chain of public keys more efficiently.

Tópicos relacionados

Sobre assinaturas digitais

OpenPGP na Wikipédia