So today I learnt what Curve25519 actually is!

It's been sitting in my SSH keys and WireGuard configs for years. Today I finally asked what it is.

Curve25519 has been sitting in my SSH keys and WireGuard configs for years and I never once asked what it actually is. Today I did, so writing it down before I forget.

The problem it solves is old: two machines want to agree on a secret key, but they can only talk over a channel where anyone can listen. Diffie-Hellman solved this ages ago. Both sides do some math with a private number, exchange the public results, and somehow end up with the same shared secret. An eavesdropper sees everything on the wire and still can’t compute it, because reversing the math is brutally hard.

Curve25519 is just a very specific playground for that math. Instead of plain numbers you use points on an elliptic curve. Your private key is a number, your public key is where you land after “hopping” along the curve that many times. Given the landing point, nobody can figure out the hop count. That one-way property is the whole game.

The name made me laugh a little when I found out. All the math happens modulo the prime 2²⁵⁵ − 19. That’s it, that’s the name. The actual curve equation is some ugly thing nobody remembers.

But here’s the part that clicked for me. This curve didn’t win because its math is stronger. There are hundreds of curves. It won because it’s hard to screw up. The older NIST curves are full of landmines: implement them slightly wrong and you leak timing info or your private key. Curve25519 (designed by djb in 2005) is built so the lazy, obvious implementation is also the safe one. Any random 32 bytes works as a key, no weird validation dances, constant-time by default. Plus the NIST curves had unexplained magic constants, and after Snowden nobody trusted those anymore. So Signal, WhatsApp, WireGuard, TLS 1.3, SSH, everyone quietly moved.

One thing that confused me: Curve25519 and Ed25519 are cousins, not the same thing. First one is for key exchange, second one is for signatures. Same curve underneath, two different jobs. Your ed25519 SSH key is the signature cousin.

Anyway, the real lesson wasn’t the math. It’s that this thing secured half the internet by being designed for the tired developer at 2 AM, not for the textbook. Engineering beat theory.

I’m Gaurang Sharma — I build backend systems and chase down the distributed-systems failures they produce. I’m open to backend / distributed-systems roles.