CSCE 465 Lecture 21

From Notes
Jump to navigation Jump to search

« previous | Tuesday, April 9, 2013 | next »


Public Key Cryptography

Invented and published in 1975

Much slower than Private Key and Hash functions.

Applications

  1. 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
  2. Communicating securely over an insecure channel: encrypt using public key, decrypt with private key
  3. Secure storage on an insecure medium (similar to above
  4. User Authentication: perform "operation" with private key, verify with public key.
  5. 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

  1. Let
  2. Compute (Euler's Totient function)
  3. Choose random relatively prime to (i.e. )
  4. Find
  5. 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,

  1. and should be similar length (about 500 bits if key is to be 1024 bits)
  2. and should contain a large prime factor
  3. should be small
  4. d should be larger than

Attacks

Probable-Message Attack

Using public key

  1. Encrypt all possible plaintext messages
  2. 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

  1. Alice cannot deny that she signed the message