CSCE 465 Lecture 21
« previous | Tuesday, April 9, 2013 | next »
Public Key Cryptography
Invented and published in 1975
Much slower than Private Key and Hash functions.
Applications
- message integrity with digital signatures: sign with private key, verify with public key
- only one person can sign the message: non-repudiation [1]
- Only achievable with public key cryptography
- Communicating securely over an insecure channel: encrypt using public key, decrypt with private key
- Secure storage on an insecure medium (similar to above
- User Authentication: perform "operation" with private key, verify with public key.
- Key exchange for secret key cryptography
Algorithms
System | Encryption/Decryption | Digital Signatures | Key Exchange |
---|---|---|---|
RSA | Yes | Yes | Yes |
Diffie-Hellman | No | No | Yes |
DSA | No | Yes | No |
Trapdoor One-Way Function
- is easy to compute if and are known
RSA
(See MATH 470 Lecture 5#RSA→)
(See MATH 470 Lecture 6#RSA Review→)
Invented by Rivest, Shamir, and Adleman
Basis: factorization of large numbers is hard
Variable key length (1024 bits or greater)
Variable plaintext block size
- plaintext block: smaller than key size
- ciphertext block: same as key size
Setup
Find (using Miller-Rabin Algorithm) large primes and
- Let
- Compute (Euler's Totient function)
- Choose random relatively prime to (i.e. )
- Find
- Public key:
Private key:
(All other numbers must be kept private)
Operations
- Encryption
- Decryption
- Signing
- Verification
- Key Negotiation
- sends random number to , encrypted with 's public key
- sends random number to , encrypted with 's public key
- and both decrypt received messages using their respective keys
- and both compute and use that as the shared key.
Proof of Correctness
RSA works because
This is a side effect of having and
Is RSA Secure?
Suppose you could factor . Then RSA would be broken:
- compute
- compute
So to make difficlut to factor,
- and should be similar length (about 500 bits if key is to be 1024 bits)
- and should contain a large prime factor
- should be small
- d should be larger than
Attacks
Probable-Message Attack
Using public key
- Encrypt all possible plaintext messages
- Try to find a match between the ciphertext and one of the encrypted messages
This only works for small plaintext message sizes
Solution: Pad plaintext message with random text before encryption
- PKCS #1 v1 specifies this padding format.
Timing Attacks
Recovers private key from running time of decryption algorithm.
Computing using repeated squaring algorithm:
m = 1
(k-1).downto(1) do |i|
m = m*m % n
if d[i] == 1
m = m*c mod n # !!! measure timing of this line
end
end
Footnotes
- ↑ Alice cannot deny that she signed the message