User Tools

Site Tools


pgp_workshop

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pgp_workshop [2025/05/29 07:37] – [Note if you used Thunderbird and not Kleopatra] userapgp_workshop [2026/07/16 12:37] (current) – [Signing and verifying signatures with OpenPGP] usera
Line 1: Line 1:
 ====== PGP Workshop ====== ====== PGP Workshop ======
 +
 +<aside outline box>
 +**Important note on PGP:** PGP has been more and more criticized in the security community over the years (see for example [[https://www.latacora.com/blog/2019/07/16/the-pgp-problem/|here]] and [[https://soatok.blog/2024/11/15/what-to-use-instead-of-pgp/| here]]) for its complexity and flawed design. Therefore, it is not really a good idea to use PGP for sending ourselves encrypted mails, as opposed to use Signal (until some other better protocol is ready). As PGP is still quite used for signing packages, it can still be a good idea to learn it for verifying those packages.
 +</aside>
  
 Here is a small tutorial for getting started with this protocol named Pretty Good Privacy (PGP), an asymmetric cryptographic tool that allows to have end to end encrypted mails despite using very mainstream services like gmail, outlook, etc. You will find several names around, like GPG, PGP, OpenPGP. I will use them interchangeably as they basically refer to the same thing. Here is a small tutorial for getting started with this protocol named Pretty Good Privacy (PGP), an asymmetric cryptographic tool that allows to have end to end encrypted mails despite using very mainstream services like gmail, outlook, etc. You will find several names around, like GPG, PGP, OpenPGP. I will use them interchangeably as they basically refer to the same thing.
Line 167: Line 171:
  
 The way it is done is the following: The way it is done is the following:
-  - The file is **[[hashed|hashed]]** (see the paragraph below).+  - The file is **[[hashed|hashed]]**.
   - This hashed file is encrypted with your private key   - This hashed file is encrypted with your private key
   - The result is added at the end of your file, giving a **signed** file.   - The result is added at the end of your file, giving a **signed** file.
Line 290: Line 294:
  
   - Alice (you) get the public key of Bob   - Alice (you) get the public key of Bob
-  - Alice sign it with her private key: <code>gpg --sign-key [key_id]</code> where <code>[key_id]</code> is the fingerprint of the Bob public key. In the process you will be asked to check that the fingerprint match with the key of the other person, which you should do in a secure channel, or in person, with the person owning the key. +  - Alice sign it with her private key: ''%%gpg --sign-key [key_id]%%'' where ''%%[key_id]%%'' is the fingerprint of the Bob public key. In the process you will be asked to check that the fingerprint match with the key of the other person, which you should do in a secure channel, or in person, with the person owning the key. Note: you can at every time look at all signatures on a key with the command: ''%%gpg --list-sig [NAME]%%'', with [NAME] being for example part of the mail address associated with the key. 
-  - Alice exports, then encrypts the signed key with Bob public key, with the following command: <code>gpg --armor --export [key_id] | gpg --sign --encrypt -r [key_id] > [filename]</code>, where <code>[key_id]</code> is the fingerprint of Bob public key and <code>[filename]</code>is the output filename+  - Alice exports, then encrypts the signed key with Bob public key, with the following command: <code>gpg --armor --export [key_id] | gpg --sign --encrypt -r [key_id] > [filename]</code>, where ''%%[key_id]%%'' is the fingerprint of Bob public key and ''%%[filename]%%'' is the output filename. Note: you can alternatively, since you already configured your mails for this, just export the key with ''%%gpg --armor --export [key_id] > [filename]%%'', and attach it to a mail encrypted with your mail client.
   - Alice emails the key to Bob using the mail address associated with the key   - Alice emails the key to Bob using the mail address associated with the key
-  - Bob receives it, then decrypt it with his private key and import it: <code>gpg --decrypt [filename]</code> and then <code>gpg --import [filename_decrypted]</code> +  - Bob receives it, then decrypt it with his private key and import it: ''%%gpg --decrypt [filename]%%'' and then ''%%gpg --import [filename_decrypted]%%'' 
-  - He can then send it to a keyserver, containing Alice signature: <code>gpg --send_keys [key_id]</code>+  - He can then send it to a keyserver, containing Alice signature: ''%%gpg --send_keys [key_id]%%''
  
pgp_workshop.1748504234.txt.gz · Last modified: by usera