This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Private Key Cryptography Alice (aka A) wants to send an encrypted message to Bob (aka B). • A and B might share a private key known only to them. • The same key serves for encryption and decryption. • Example: Caesar’s cipher f ( m ) = m + 3 mod 26 (shift each letter by three) ◦ WKH EXWOHU GLG LW ◦ THE BUTLER DID IT This particular cryptosystem is very easy to solve • Idea: look for common letters (E, A, T, S) 1 One Time Pads Some private key systems are completely immune to crypt analysis: • A and B share the only two copies of a long list of random integers s i for i = 1 , . . . , N . • A sends B the message { m i } n i =1 encrypted as: c i = ( m i + s i ) mod 26 • B decrypts A’s message by computing c i s i mod 26 . The good news: bulletproof cryptography The bad news: horrible for ecommerce • How do random users exchange the pad? 2 Public Key Cryptography Idea of public key cryptography (DiffieHellman) • Everyone’s encryption scheme is posted publically ◦ e.g. in a “telephone book” • If A wants to send an encoded message to B, she looks up B’s public key (i.e., B’s encryption algorithm) in the telephone book • But only B has the decryption key corresponding to his public key BIG advantage: A need not know nor trust B. There seems to be a problem though: • If we publish the encryption key, won’t everyone be able to decrypt? Key observation: decrypting might be too hard, unless you know the key • Computing f 1 could be much harder than comput ing f Now the problem is to find an appropriate ( f, f 1 ) pair for which this is true • Number theory to the rescue 3 RSA: Key Generation Generating encryption/decryption keys • Choose two very large (hundreds of digits) primes p, q . ◦ This is done using probabilistic primality testing ◦ Choose a random large number and check if it is prime ◦ By the prime number theorem, there are lots of primes out there • Let n = pq . • Choose e ∈ N relatively prime to ( p 1)( q 1). Here’s how: ◦ Choose e 1 , e 2 prime and about √ n ◦ One must be relatively prime to ( p 1)( q 1) * Otherwise e 1 e 2  ( p 1)( q 1) ◦ Find out which one using Euclid’s algorithm • Compute d , the inverse of e modulo ( p 1)( q 1). ◦ Can do this using using Euclidean algorithm • Publish n and e (that’s your public key) • Keep the decryption key d to yourself. 4 RSA: Sending encrypted messages How does someone send you a message? • The message is divided into blocks each represented as a number M between 0 and n . To encrypt M , send C = M e mod n. ◦ Need to use fast exponentiation (2 log( n ) multipli cations) to do this efficiently Example: Encrypt “stop” using e = 13 and n = 2537: • s t o p ↔ 18 19 14 15 ↔ 1819 1415 • 1819 13 mod 2537 = 2081 and 1415 13 mod 2537 = 2182 so • 2081 2182 is the encrypted message....
View
Full
Document
This note was uploaded on 05/21/2009 for the course CS 2800 taught by Professor Selman during the Spring '07 term at Cornell.
 Spring '07
 SELMAN

Click to edit the document details