You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Asymmetric encryption, also called public-key cryptography, uses a pair of mathematically related keys: a public key and a private key. It solves the fundamental problem of symmetric encryption — how to share a secret key securely.
With symmetric encryption, both parties need the same key. But how do you share that key securely?
Whitfield Diffie and Martin Hellman solved this problem in 1976 by inventing public-key cryptography, one of the most important breakthroughs in the history of information security.
Each user generates a key pair:
| Key | Properties |
|---|---|
| Public key | Shared openly with anyone |
| Private key | Kept secret — never shared |
Sender: Plaintext ──▶ [Encrypt with Recipient's PUBLIC key] ──▶ Ciphertext
Receiver: Ciphertext ──▶ [Decrypt with Recipient's PRIVATE key] ──▶ Plaintext
Only the recipient's private key can decrypt data encrypted with their public key.
Signer: Message ──▶ [Sign with Signer's PRIVATE key] ──▶ Signature
Verifier: Signature ──▶ [Verify with Signer's PUBLIC key] ──▶ Valid/Invalid
Only the signer's private key can produce the signature; anyone with the public key can verify it.
Diffie-Hellman (DH) allows two parties to agree on a shared secret over an insecure channel without transmitting the secret itself.
Alice Bob
│ │
│ Public: p, g │
│─────────────────────────────▶│
│ │
│ secret a │ secret b
│ A = g^a mod p │ B = g^b mod p
│ │
│ ◀─────── A ───────▶ │
│ ◀─────── B ───────▶ │
│ │
│ s = B^a mod p │ s = A^b mod p
│ (same shared secret) │ (same shared secret)
Security basis: The discrete logarithm problem — it is computationally infeasible to derive the private exponent from the public value.
RSA, published in 1977, was the first practical public-key encryption algorithm:
Encryption: c = m^e mod n (using public key)
Decryption: m = c^d mod n (using private key)
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.