<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bob Bricoleur</title>
    <description>The latest articles on Forem by Bob Bricoleur (@bob_bricoleur).</description>
    <link>https://forem.com/bob_bricoleur</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3861168%2Ff4e2154f-8e3d-48cb-a629-9e2876070e91.png</url>
      <title>Forem: Bob Bricoleur</title>
      <link>https://forem.com/bob_bricoleur</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bob_bricoleur"/>
    <language>en</language>
    <item>
      <title>X25519 vs RSA for Email Encryption: Practical Benchmarks in 2026</title>
      <dc:creator>Bob Bricoleur</dc:creator>
      <pubDate>Sat, 04 Apr 2026 16:21:01 +0000</pubDate>
      <link>https://forem.com/bob_bricoleur/x25519-vs-rsa-for-email-encryption-practical-benchmarks-in-2026-396i</link>
      <guid>https://forem.com/bob_bricoleur/x25519-vs-rsa-for-email-encryption-practical-benchmarks-in-2026-396i</guid>
      <description>&lt;h2&gt;
  
  
  Why I switched from RSA to X25519 for email encryption
&lt;/h2&gt;

&lt;p&gt;While building an encrypted email service, I had to choose between RSA and X25519 (Curve25519) for key exchange. Here are real benchmarks from our Node.js implementation:&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Generation
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Algorithm&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Key Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;X25519&lt;/td&gt;
&lt;td&gt;~0.1ms&lt;/td&gt;
&lt;td&gt;32 bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RSA-2048&lt;/td&gt;
&lt;td&gt;~50ms&lt;/td&gt;
&lt;td&gt;256 bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RSA-4096&lt;/td&gt;
&lt;td&gt;~500ms&lt;/td&gt;
&lt;td&gt;512 bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;X25519 is &lt;strong&gt;500-5000x faster&lt;/strong&gt; for key generation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Our ECIES Pattern
&lt;/h3&gt;

&lt;p&gt;We use X25519 + HKDF + AES-256-GCM (ECIES pattern):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Generate ephemeral X25519 keypair
2. ECDH(ephemeral_priv, recipient_pub) → shared_secret
3. HKDF(shared_secret, info) → aes_key (32 bytes)
4. AES-256-GCM(aes_key, plaintext) → ciphertext + auth_tag
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The envelope is a compact JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"v"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"alg"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"X25519-HKDF-AES256GCM"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"epk"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;base64 ephemeral public key&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"iv"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;12 bytes&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tag"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;16 bytes&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ct"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;ciphertext&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why not PGP?
&lt;/h3&gt;

&lt;p&gt;PGP is the standard for email encryption but:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Key management is painful for regular users&lt;/li&gt;
&lt;li&gt;No forward secrecy (same key for all messages)&lt;/li&gt;
&lt;li&gt;Large keys and slow operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;X25519 ECIES gives us ephemeral keys per message (forward secrecy) with minimal overhead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser Implementation
&lt;/h3&gt;

&lt;p&gt;Web Crypto API supports X25519 natively in modern browsers, so we can encrypt/decrypt client-side without any library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;keyPair&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;X25519&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;deriveKey&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Trade-offs
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pro:&lt;/strong&gt; Fast, small keys, forward secrecy, browser-native&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Con:&lt;/strong&gt; Less widely adopted than RSA, no direct signing (use Ed25519 separately)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Would love to hear from others implementing email encryption. What patterns are you using?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built with Node.js crypto module (server) + Web Crypto API (client)&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>encryption</category>
      <category>email</category>
      <category>privacy</category>
    </item>
    <item>
      <title>What's your email setup for privacy in 2026?</title>
      <dc:creator>Bob Bricoleur</dc:creator>
      <pubDate>Sat, 04 Apr 2026 15:23:56 +0000</pubDate>
      <link>https://forem.com/bob_bricoleur/whats-your-email-setup-for-privacy-in-2026-3ocn</link>
      <guid>https://forem.com/bob_bricoleur/whats-your-email-setup-for-privacy-in-2026-3ocn</guid>
      <description>&lt;p&gt;Curious what people using these days for email privacy. The&lt;br&gt;
  landscape seems to have changed a lot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ProtonMail went mainstream but some complain about lock-in&lt;/li&gt;
&lt;li&gt;Tutanota rebranded to Tuta, mixed reviews&lt;/li&gt;
&lt;li&gt;Self-hosted is more accessible but deliverability is still hard&lt;/li&gt;
&lt;li&gt;New players popping up with different approaches (E2E,sovereign hosting, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What's your current setup? Especially interested in:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provider or self-hosted?&lt;/li&gt;
&lt;li&gt;E2E encryption — do you actually use it?&lt;/li&gt;
&lt;li&gt;Custom domain or provider domain?&lt;/li&gt;
&lt;li&gt;How do you handle the fact that the other side usually uses Gmail anyway?&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>cybersecurity</category>
      <category>discuss</category>
      <category>privacy</category>
      <category>security</category>
    </item>
  </channel>
</rss>
