liveBook · Manning

Public key cryptography

As explained in Real-World Cryptography

Asymmetric encryption is an encryption technique in which a public key encrypts data and a corresponding private key decrypts it.

Public-key cryptography solves the key-distribution problem with two related keys instead of one shared secret. Anyone can use a recipient’s public key to encrypt a message, but only the holder of the private key should decrypt it. section 1.4 section 1.4.2

A basic encrypted-message flow looks like this:

  • Generate a key pair using a chosen security parameter. section 6.1
  • Publish and share the public key while keeping the private key secret. section 6.1
  • Encrypt plaintext with the recipient’s public key and send the resulting ciphertext. section 6.1
  • Decrypt the ciphertext with the associated private key. section 1.4.2

Encryption is only one asymmetric primitive. Digital signatures use a private key to sign a message, while others use the public key, the message, and the signature to verify authenticity. Key exchange uses asymmetric mechanisms to establish a shared secret, which can then protect communication with authenticated encryption. section 1.4.3 section 5.0

Encrypted email

Instead of creating a separate shared symmetric secret for every possible sender, Alice publishes her public key. Anyone can encrypt an email to Alice; only Alice’s private key can decrypt it. section 6.1

Public-key encryption is relatively slow and can encrypt only restricted message sizes. Practical systems therefore often encrypt a fresh symmetric key with the recipient’s public key, then use that symmetric key for larger data; this combination is hybrid encryption. section 6.2 section 6.2.1

Figure 6.3 Asymmetric encryption allows one to encrypt a message (plaintext) using a recipient’s public key. The recipient can then use a different algorithm to decrypt the encrypted message (ciphertext) using a private key that’s related to the public key used previously.

Trace the plaintext-to-ciphertext flow: a sender encrypts with the recipient’s public key, and the recipient decrypts with the related private key. section 6.1

How Real-World Cryptography covers it

How deep it goes
Explains key-pair generation, encryption, decryption, signatures, and hybrid use, but defers detailed mathematical construction and implementation.
Examples
Uses encrypted email, Alice’s public-key message flow, RSA signatures, encapsulated symmetric keys, client certificates, SSH, and FIDO2 authenticators.
What it assumes
Assumes familiarity with symmetric encryption and authenticated encryption while introducing asymmetric keys and their security roles.
What you can do after
Apply public and private keys to encrypt messages, establish shared secrets, verify signatures, and authenticate clients.
How it connects
Connects asymmetric encryption with symmetric encryption, authenticated encryption, key exchange, digital signatures, RSA, ECDH, TLS, SSH, and FIDO2.

Also explained in

Compare how 5 books explain public key cryptography →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.