Posts

Showing posts from October, 2025

Diffie-Hellman Key Exchange (TLS Handshakes)

How Your Browser Secretly Shares a Key (Even on Public Wi-Fi!) Ever see that little padlock 🔒 in your browser and wonder how it  actually  keeps your stuff safe? How can your browser and a website agree on a secret code to scramble your password... when any hacker could be listening in? It sounds impossible, right? It's not magic, but it's a super clever mathematical trick called the  Diffie-Hellman key exchange . At its core, it's a way for two parties (like your browser and a server) to create a  shared secret key  over the public internet, without  ever sending the key itself. This brand-new shared secret is then used to create  another  key, called a  symmetric key  (you might hear tech folks call it 'AES'). This  second  key is a super-fast, heavy-duty encryption key that does all the hard work of scrambling and unscrambling your data for the rest of your visit. The easiest way to get this is with the famous "mixing paint...