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 |
graph LR
subgraph Sender
P1["Plaintext"] --> E["Encrypt with Recipient's PUBLIC key"] --> C1["Ciphertext"]
end
subgraph Receiver
C2["Ciphertext"] --> D["Decrypt with Recipient's PRIVATE key"] --> P2["Plaintext"]
end
Only the recipient's private key can decrypt data encrypted with their public key.
graph LR
subgraph Signer
M["Message"] --> S["Sign with Signer's PRIVATE key"] --> SG["Signature"]
end
subgraph Verifier
SG2["Signature"] --> V["Verify with Signer's PUBLIC key"] --> R["Valid / Invalid"]
end
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.
sequenceDiagram
participant Alice
participant Bob
Note over Alice,Bob: Public: p, g
Alice->>Bob: agree public p, g
Note left of Alice: secret a, A = g^a mod p
Note right of Bob: secret b, B = g^b mod p
Alice->>Bob: send A
Bob->>Alice: send B
Note left of Alice: s = B^a mod p
Note right of Bob: s = A^b mod p
Note over Alice,Bob: 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:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.