After spending a dinner date describing cryptography From the Ground Up, I realized that I should've used one more example to make the idea of asymmetric keys a little more clear. So, here is that example:

I'll use multiplication as my encryption function. Say my public key is 2. You want to secretly send me the letter 'a', which corresponds to the ASCII code 65. So, you use the encryption function (*) and the key (2) to calculate the ciphertext (65*2=130), which you send to me. My private key is the inverse of 2- 1/2. Note that the public key (2) and my private key (1/2) are not the same! I get the ciphertext 130 from you, and use the encryption function (*) with my private key (1/2) to recover the plaintext (130*1/2 = 65).

Ta da! We have just accomplished encrypted communication without ever sharing a secret key. Now, just replace multiplication with some other function for which it is really, really difficult to calculate the inverse of some arbitrary number (like, say, modular exponentiation), so that you can't figure out what my private key is despite having the function and the public key, and bam, you've got RSA public-key encryption & digital signing.

In this toy example, and in actual RSA, the private key is the inverse of the public key, and the public key is also the inverse of the private key. This makes them interchangeable, and lets you do signing & encryption at the same time. However, while this seems intuitive and natural, it is not necessarily the case. There do exist functions for which a=b^-1 does *not* imply that b=a^-1, in which case the keys are not interchangeable.

Log in or register to write something here or to contact authors.