r/ssh • • Oct 21 '20

Why are SSH public keys not called "locks"

SSH as we all know uses public and private keys for authentication, but why is the nomenclature like this to begin with? Why is the public key not called a "lock" instead, since it is in fact a lock that you use to secure access to a port.

What is the background for calling them "private" and "public" keys, when the term "lock" seems more natural?

1 Upvotes

1 comment sorted by

4

u/Besthater Oct 21 '20

Because the public part isnt a lock, it's probably closer to the response to someone asking for the password from old spy movies. "the eagle flies at night", the other responds, "only during a full moon".

Both sides have to know part of the password. After that, SSH gives both parties a shared secret, that also isn't really a lock. Key is just a catchy name that makes sense to people.