Originally posted by: BigDH01
Originally posted by: Locut0s
Originally posted by: irishScott
Originally posted by: xcript
Lock -> send -> she adds her own padlock -> sends back -> remove your lock -> send to her again -> she takes off her lock and enjoys the contents. No key was ever sent.
Sweet. Hilariously impractical IRL, but sweet.
That's the concept behind public key encryption, which is anything but impractical.
But from my understanding of public key crypto, this analogy isn't very good. Both parties would have keys to both padlocks, one private and one public. An operation on a padlock can only be reversed by the key other than the one used for the original operation. Ex: if k1 (little key 1) was used to lock padlock1 (p1) then K1 (big key 1) would have to be used to unlock it. Bob and alice both have big and little keys (ka, Ka, kb, Kb). They both keep their big keys but give copies of the little keys to anyone that wants one. Bob would have a copy of Alice's little key. Bob takes two boxes, puts the diamond in the smaller, and puts the smaller box in the larger box. He locks the small box with Kb. He then locks the big box with ka. Only Alice, who retains sole control of Ka, can unlock the big box. However, since anyone could have a copy of ka, she needs to verify that this box actually came from Bob. This is why Bob locked this inside box with Kb, of which there is only one copy. Alice unlocks this box with kb and verifies it was from Bob.
At least that's my understanding. Of course, it's often just the hash of the message that would be encrypted with Bob's private key.