r/askscience • • May 18 '20

Computing How does SSL prevent the initial key from being stolen?

Hi there,

I've been looking for this answer on the web and here, but haven't found anything yet.

The best I've seen so far is this How to Geek article on encryption. In step one of how SSL works, it says "The web server sends its public key with its certificate." (article here)

And from there on the browser and web server can use the key to encrypt/decrypt. My question is, how does the initial key hand off prevent an attacker from catching the key such as in a MIM attack? There always has to be a way for the browser/server to send an initial key, but all I can think of is a never-ending loop of encryption on top of encryption for the keys.

10 Upvotes

24 comments sorted by

View all comments

Show parent comment

1

u/NoJudgies May 18 '20

Ahhh. This makes a lot of sense! So the initial hand-off is just hard to invert

1

u/G00dAndPl3nty May 19 '20

The keys are created with two pieces of information. One piece comes from the other party (and is therefore sent over the wire) the other piece is kept to yourself. This is why an eavesdropper who sees everything client and server send to eachother cannot recreate the keys.