W 2.1 Public Key Cryptography
W 2.1 Public Key Cryptography
Digital Signatures
--- New era of secure
communications ---
Outline
Network D
E
or Storage
Alice Bob
Bob:
publishes, say in Yellow/White pages, his
public (for encryption) key, and
encryption algorithm.
keeps to himself
the matching secret (for decryption) key.
Alice:
Looks up the phone book, and finds out
Bob’s
public key, and
encryption algorithm.
Encrypts a message using Bob’s public
key and encryption algorithm.
sends the ciphertext to Bob.
Bob:
Receives the ciphertext from Alice
Decrypts the ciphertext using his secret
key, together with the decryption
algorithm
E Network D
Secret Key
Alice
CSE2500- System Security and Privacy
Bob 9
Main differences with DES
Modular operations
“remainder”
13 mod 5 = 3, 1 mod 7 = 1
20 mod 5 = 0, 32 mod 7 = 4
modular exponentiation
22 mod 3 = 1, 32 mod 3 = 0
22 mod 5 = 4, 102 mod 92 = 8
46 mod 10 = 6, 311 mod 10 = 7
E.g:
y=13 ; n=7; x = 4;
ø(n) = 6; y mod ø(n) = 13 mod 6 = 1;
xy = 413; xy mod n = 413 mod 7 = 4 = x mod n;
Bob: (e, n)
public key:
e &n
Plain Text Cipher Text Cipher Text Plain Text
c= m=
Network
m e mod n c d mod n
Bob:
chooses 2 large prime numbers: p, q
multiplies p and q: n = p*q
finds out two numbers e & d such that
(e * d) mod ø(n) = 1 [ similar to (2) ]
Or (e * d) mod [(p-1)*(q-1)] = 1
public key (published in the phone book)
2 numbers: (e, n)
encryption alg: modular exponentiation
secret key: (d,n)
Bob:
receives the ciphertext c from Alice
uses his matching secret decryption key
d to calculate
cd (mod n) -> m
Bob:
chooses 2 primes: p=5, q=11
multiplies p and q: n = p*q = 55
finds out two numbers e=3 & d=27 which
satisfy
(3 * 27) mod 40 = 1
Bob’s public key
2 numbers: (3, 55)
encryption alg: modular exponentiation
secret key: (27,55)
Bob:
receives the ciphertext c=52 from Alice
uses his matching secret decryption key
27 to calculate m:
m = 5227 (mod 55)
= 13 (Alice’s message)
Attack Scenario:
Marvin wants to read Alice’s private message (m)
intended to be read only by Bob.
However, Alice used RSA to encrypt m using
Bob’s public key (e, n), into the ciphertext c = me
(mod n).
Marvin is a determined attacker and managed to
intercept the ciphertext c on its way from Alice’s
to Bob’s computer.
Marvin also looked up Bob’s public key (e,n) to
help him in his attack.
Good points
in-expensive to use
fast
low cost VLSI chips available
Bad points
key distribution is a problem
Good points
key distribution is NOT a problem
Bad points
relatively expensive to use
relatively slow
VLSI chips not available or relatively high
cost
In practice, we can
use a public key cipher (such as RSA) to
distribute keys
use a private key cipher (such as DES) to
encrypt and decrypt messages
Bob:
Plain Text
Plain Text
Signature
Secret Key
Bob: (e, n)
Plain Text
Plain Text
+
? Accept if equal
s= Network
Hash of Message
H H
H H
Bob:
Plain Text
Plain Text
H 100 bits
H 1-way hash
Accept if equal
100 bits
Network
+
?
Signature 100 bits
I, Bob, I, Bob,
will pay will pay
$1,000 $10,000
to Alice. to Alice.
101001010 001001101