<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>blog.n11n [tag: encryption]</title>
  <link>https://blog.n11n.ca</link>
  <description>Nicholas' blog</description>
  <language>en</language>
  <atom:link href="https://blog.n11n.ca/rss.xml" rel="self" type="application/rss+xml" />

  <item>
    <title>What is PGP encryption &amp; how does it work?</title>
    <pubDate>Thu, 19 Mar 2026 00:00:00 +0000</pubDate>
    <link>https://blog.n11n.ca/pgp</link>
    <guid>https://blog.n11n.ca/5</guid>
    <description>A general overview of PGP encryption 🔒</description>
    <content:encoded><![CDATA[<p><a href="https://en.wikipedia.org/wiki/Pretty_Good_Privacy">PGP (Pretty Good Privacy)</a> is an <a href="https://en.wikipedia.org/wiki/Encryption">encryption</a> program created in the 1990s. Most commonly used to encrypt emails, it can also encrypt files and verify identity. Now, PGP commonly refers to any encryption tool that implements the <a href="https://www.openpgp.org">OpenPGP</a> standard (<a href="https://www.rfc-editor.org/rfc/rfc9580">RFC 9580</a>).</p> <h2>PGP / OpenPGP / GPG (GnuPG) / LibrePGP</h2> <p>PGP was invented by Phil Zimmermann and released as freeware in 1991. Later, it became proprietary software that is now owned by Broadcom.</p> <p>The message format used in PGP was released alongside the original software. This allowed the OpenPGP standard to be created in 1997, enabling anyone to implement a compatible program.</p> <p>GPG (or GnuPG), short for <a href="https://gnupg.org">GNU Privacy Guard</a>, is a Free implementation based on the OpenPGP standard. It was originally released in 1999 as an alternative suite of encryption tools.</p> <p>In response to changes made in the OpenPGP standard, the <a href="https://librepgp.org/">LibrePGP</a> standard was released in 2023. Currently still in draft status, it is based on OpenPGP as it existed in September 2021. The GPG project no longer aims to comply with the OpenPGP standard, opting to follow LibrePGP instead.</p> <h2>How it works</h2> <p>PGP balances security and speed through a hybrid encryption model, using both symmetric (password) and asymmetric (public-key) encryption.</p> <p>Before data can be encrypted, the recipient must generate a <strong>key pair</strong> consisting of a <strong>public</strong> and <strong>private</strong> key. These keys are mathematically related. Data encrypted with a <strong>public</strong> key can only be decrypted with the corresponding <strong>private</strong> key.</p> <p>The strength of PGP encryption relies heavily on keeping the <strong>private key</strong> secure.</p> <p>When sending a message, it works as follows:</p> <ol> <li> A single-use <a href="https://en.wikipedia.org/wiki/Session_key"><strong>session key</strong></a> is generated by the sender and used to encrypt the message. </li><li> The <strong>session key</strong> is then encrypted using the recipients <strong>public key</strong>. </li><li> Both the encrypted session key and encrypted message are now sent to the recipient. </li><li> Using the <strong>private key</strong> the recipient can decrypt the <strong>session key</strong>, and use that to decrypt the message. </li> </ol> <p>It may seem a bit complicated, but is done for a couple good reasons. First, asymmetric encryption is often much slower and more resource intensive than symmetric encryption. Especially for larger files. Second, symmetric encryption relies on the same key to encrypt and decrypt data. This introduces a problem with transmitting the key securely, something asymmetric encryption handles with ease.</p> <h2>Fingerprint</h2> <p>A public key is often long and difficult to share or verify easily. For example, a 4096-bit RSA key encoded in hexadecimal is 1024 characters long. To get around this, the public key and some identifying data is <a href="https://en.wikipedia.org/wiki/Hash_function">hashed</a> to create a shorter version called a <a href="https://en.wikipedia.org/wiki/Public_key_fingerprint">public key fingerprint</a>. It often looks something like:</p> <pre><code>16B3 4A92 8A40 293D E083 0AA2 DCDA 6330 7AF1 1A91</code></pre> <p>In GPG, the fingerprint is a 160-bit hash, meaning 40 hexadecimal characters. Verifying 40 characters manually may be tedious, but possible. Verifying 1024 characters is not.</p> <h2>How to use PGP encryption</h2> <p>The process may vary slightly depending on your system, but will involve generating keys and integrating PGP in an email application.</p> <p>Creating a new key pair from the terminal (with <strong>gpg</strong> installed) can be done using:</p> <pre><code>gpg --generate-key</code></pre> <p>After entering some basic information, and a secure <a href="https://en.wikipedia.org/wiki/Passphrase">passphrase</a>, the public and private keys will be generated. Prompts for every option during key generation can instead be displayed with the <code>--full-generate-key</code> flag.</p> <p>To integrate with your choice of email client, check the related documentation. Here are a few common ones:</p> <ul> <li> <strong>Thunderbird:</strong> built-in support since version 78, <a href="https://support.mozilla.org/en-US/kb/openpgp-thunderbird-howto-and-faq">see here</a> </li><li> <strong>Proton mail:</strong> built-in support, <a href="https://proton.me/support/how-to-use-pgp">see here</a> </li><li> <strong>Apple mail:</strong> using <a href="https://gpgtools.org/">GPGTools</a> </li><li> <strong>Outlook:</strong> using <a href="https://gpg4win.org/">Gpg4win</a> </li><li> <strong>Gmail:</strong> the <a href="https://flowcrypt.com">flowcrypt</a> and <a href="https://www.mailvelope.com/">mailvelope</a> plugins seem popular </li> </ul> <p>For other applications and plugins see: <a href="https://www.openpgp.org/software/">OpenPGP Software</a></p> <p>Once configured, and the recipients public key is obtained, sending an encrypted email is only slightly more involved. Typically, the key is added to the recipients contact information. An option to send a secure message should then be visible somewhere in the interface, usually with a little lock symbol to indicate encryption.</p> <h2>Advantages +</h2> <p>The biggest advantage of PGP encryption is the underlying cryptography that is essentially unbreakable. PGP uses multiple strong algorithms including <a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard">AES</a> or <a href="https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm">IDEA</a> for symmetric encryption, and <a href="https://en.wikipedia.org/wiki/Elliptic-curve_cryptography">ECC</a> or <a href="https://en.wikipedia.org/wiki/RSA_cryptosystem">RSA</a> for asymmetric encryption. Supported algorithms are constantly being updated to ensure the highest level of security.</p> <p>However, this does not protect against a faulty implementation. <a href="https://en.wikipedia.org/wiki/EFAIL">EFAIL</a> was a vulnerability in certain implementations of PGP that allowed the encrypted contents to be revealed in plaintext.</p> <h2>Disadvantages -</h2> <p>Using PGP has not always been simple or user-friendly. This is starting to change with multiple tools aimed at simplifying the process. That said, time and effort is still required to understand and use encryption correctly.</p> <p>Key management introduces complexity as well. Encrypted data is secure until the private key becomes compromised. This requires additional planning and attention to ensure keys are stored securely.</p> <p>PGP also does not offer any form of anonymity. Senders and receivers of encrypted emails can still be traced. Additionally, the subject line of an email is not encrypted, so avoid including any sensitive information there.</p> <p>Finally, PGP does not offer any kind of <a href="https://en.wikipedia.org/wiki/Forward_secrecy">forward secrecy</a>. If a key becomes compromised, so are all past messages it ever encrypted.</p>         <div class="tags"><a href="https://blog.n11n.ca/tag/email">email</a> <a href="https://blog.n11n.ca/tag/encryption">encryption</a> <a href="https://blog.n11n.ca/tag/gpg">gpg</a> <a href="https://blog.n11n.ca/tag/pgp">pgp</a> <a href="https://blog.n11n.ca/tag/privacy">privacy</a> <a href="https://blog.n11n.ca/tag/security">security</a></div> <br>]]></content:encoded>
  </item>
</channel>
</rss>
