Public Key Cryptography

Public-key algorithms are asymmetric algorithms based on the use of two different keys. The two keys are called the private key and the public key:

  • The private key is known only by its owner.

  • The public key is known to everyone (it is public).

What one key encrypts, the other one decrypts, and vice versa. That means that if someone else encrypts something with your public key (which he knows because it’s public), you can use your private key to decrypt the message.

With public key cryptography, the same algorithm is used to decrypt as was used to encrypt. This simplifies code.

As long as the owner keeps the private key secret, no one but the owner will be able to decrypt the messages encrypted with the corresponding public key. In public-key systems, it is relatively easy to compute the public key from the private key, but very difficult to compute the private key from the public key. In fact, in some cases it could require several months of computation to obtain the private key from a public key. In general, the greater the number of bits used to encrypt, the stronger the private key.

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.