A public key is the shareable half of an asymmetric keypair. It may be sent across an insecure channel or published freely; security depends on keeping the matching private key secret. For encryption, anyone can encrypt plaintext to a recipient’s public key, but only the holder of the corresponding private key can decrypt the ciphertext. section 8.1
Think of the public key as a lock that can be handed to anyone, while the private key is the unique physical key retained by its owner. Sharing the lock does not let an observer open a box protected by it. section 8.1
Public keys serve different asymmetric operations:
- Encrypting to a recipient: the recipient’s public key transforms plaintext into ciphertext; the paired private key decrypts it. section 8.1 section 8.3.2
- Establishing a shared secret in Diffie–Hellman: participants exchange public keys and combine the other party’s public key with their own private key. section 8.3.1
- Verifying a digital signature: a verifier uses the relevant public key to obtain a yes/no result for a message and signature, without gaining the ability to create signatures. section 9.1
RSA public key
In RSA, a public key is the pair (n, e). With published values n = 140311 and e = 17653, a sender encrypts m = 1337 as c = m^e mod n = 133682. The private exponent d, not the public key, is needed to recover the plaintext. section 8.3.2
A public key is not assumed reversible: classical systems rely on a trapdoor one-way function. Diffie–Hellman public keys derive from discrete-logarithm settings, while RSA public keys expose a modulus and exponent whose security rests on the difficulty of integer factorization. RSA deployments also require probabilistic padding rather than deterministic textbook encryption. section 8.3.1 section 8.5
Figure 8.2 Alice and Bob communicating using asymmetric encryption
Trace the basic encryption flow: a sender receives the public key, encrypts to it, and the recipient alone applies the corresponding private key to decrypt. section 8.1







