Invented by Clifford Cocks (GCHQ) and Ivest, Hamir, and Dleman
Invented by Clifford Cocks (GCHQ) and Ivest, Hamir, and Dleman
Part 1 ⎯ Cryptography 1
RSA
❑ Inventedby Clifford Cocks (GCHQ)
and Rivest, Shamir, and Adleman
(MIT)
o RSA is the gold standard in public key
Part 1 ⎯ Cryptography 2
RSA
❑ Message M is treated as a
number ❑ To encrypt M we
compute
C = Me mod N
❑ To decrypt ciphertext C, we
compute M = Cd mod N
❑ Recall that e and N are public
Part 1 ⎯ Cryptography 4
Part 1 ⎯ Cryptography 5
x1 mod y = z1
x2 mod y = z2
Then,
x1 . x2 mod y = z1 . z2 mod y
Part 1 ⎯ Cryptography 6
Part 1 ⎯ Cryptography 7
Diffie-Hellman
Part 1 ⎯ Cryptography 8
Diffie-Hellman Key Exchange
❑ Invented by Williamson (GCHQ)
and, independently, by D and H
(Stanford) ❑ A “key exchange”
algorithm
o Used to establish a shared symmetric
key o Not for encrypting or signing
❑ Based on discrete log
problem o Given: g, p, and gk mod
p
o Find: exponent k
Part 1 ⎯ Cryptography 9
Diffie-Hellman
❑ Let p be prime, let g be a generator o For
any x ∈ {1,2,…,p-1} there is n s.t. x = gn mod p ❑ Alice
selects her private value a
❑ Bob selects his private value b
❑ Alice sends ga mod p to Bob
❑ Bob sends gb mod p to Alice
❑ Both compute shared secret, gab mod p ❑
Shared secret can be used as symmetric
key
Part 1 ⎯ Cryptography 10
Diffie-Hellman
❑ Public: g and p
❑ Private:
Alice’s
exponent a,
Bob’s
exponent b
ga mod p
gb mod p
b a
Alice, a Bob, b ❑ Alice computes (g ) =
gba = gab mod p ❑ Bob computes (ga)b = gab
mod p
❑ They can use K = gab mod p as symmetric key
Part 1 ⎯ Cryptography 11
Diffie-Hellman
❑ Suppose Bob and Alice use Diffie-Hellman to
determine symmetric key K = gab mod p
❑ Trudy can see ga mod p and gb mod p
o But… ga gb mod p = ga+b mod p ≠ gab mod p
Part 1 ⎯ Cryptography 12
Diffie-Hellman
❑ Subject to man-in-the-middle (MiM) attack
ga p gt mod p
mod gt mod p gb mod p
Part 1 ⎯ Cryptography 15
Non-repudiation
❑ Alice orders 100 shares of stock from
Bob ❑ Alice computes MAC using
symmetric key ❑ Stock drops, Alice claims
she did not order ❑ Can Bob prove that
Alice placed the order?
❑ No! Bob also knows the symmetric key, so he could
have forged the MAC
❑ Problem: Bob knows Alice placed the order, but he
can’t prove it
Part 1 ⎯ Cryptography 16
Non-repudiation
❑ Alice orders 100 shares of stock from Bob
❑ Alice signs order with her private key
❑ Stock drops, Alice claims she did not order
❑ Can Bob prove that Alice placed the order?
{[M]Alice}Alice = M
[{M}Alice]Alice = M
Part 1 ⎯ Cryptography 18
Sign and
Encrypt vs
Encrypt and Sign
Part 1 ⎯ Cryptography 19
Confidentiality and
Non-repudiation?
❑ Suppose that we want
confidentiality and integrity/non-
repudiation
❑ Can public key crypto achieve
Sign and
Encrypt ❑M = “I love you”
{[M]Alice
Alice Bob
}Bob
{[M]Alice}Charlie Charlie
Part 1 ⎯ Cryptography 21
Encrypt and
Sign ❑M = “My theory, which
is mine….”
[{M}Bob]Alice [{M}Bob]Charlie
Alice Bob Charlie
❑ Note that Charlie cannot decrypt
M ❑ Q: What is the problem?
Part 1 ⎯ Cryptography 22