{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Lec4 - Public Key Cryptosystem Sheng Zhong 1 Recall...

This preview shows pages 1–15. Sign up to view the full content.

1 Public Key Cryptosystem Sheng Zhong

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Recall Definition A public key cryptosystem is (M, C, K, G, E, D): M: cleartext message space C: ciphertext space K: key space G: generate encryption/decryption key pair from key length E: encrypt cleartext given encryption key D: decrypt ciphertext given decryption key
3 RSA Cryptosystem Most well known and widely used public- key cryptosystem. Named after inventors: Rivest, Shamir, and Adleman. Got Turing award for RSA Based on factoring of large number In fact, more than that.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 RSA Key Generation (1) Generate two large random primes p, q p, q are usually of the same length. N=pq Choose appropriate exponent e (of the same length). Compute d such that for all m, ) (mod 1 1 n m ed -
5 RSA Key Generation (2) Public Key: (n,e) Private Key: (n,d) Discard p,q Very important for security of RSA.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 RSA Encryption/Decryption Cleartext space: (an appropriate subset of ) {1, …, n-1} Ciphertext space: (an appropriate subset of ) {1, …, n-1} E((n,e), m)=m e mod n. D((n,d), c)=c d mod n.
7 Why does the decryption work? m n m n m n m n m n m n m n m n c ed ed ed d e d = = = = = = = - + - mod ) mod ( 1 ) mod ( ) mod ( mod ) ( mod mod ) ( mod 1 1 ) 1 (

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
8 Exponentiation Algorithm Both encryption and decryption need to compute modular exponentiation. What algorithm do we use to do this? By definition, a e is multiplication of a for e times. Then even computing something like 754 238 takes a lot of time. How about computing a e for a=2497347974111112432432432243243242 34324234234320043543570 and e=…?
9 Fast Exponentiation(1) Let’s write e in binary, for example: e=1010000000110 Then Enough if we can fast compute 1 2 10 12 b b b 2 2 2 2 10 100 0 1000000000 000 1000000000 110 1010001000 a a a a a a a a a a b b e = = = 1 2 10 12 2 2 2 2 , , , a a a a

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10 Fast Exponentiation (2) But how can we fast compute Starting from a; Keep squaring, we get Until we have all items we need 1 2 10 12 2 2 2 2 , , , a a a a ,... , , , 4 3 2 1 2 2 2 2 a a a a
11 Fast Exponentiation Algorithm Input: a, e Output: y=a^e int b=a, y=1, ee=e; while(ee!=0){ //invariant (b^ee) y = a^e if(ee&1){ //is odd y*= b;} //multiply result by power b*=b; ee>>=1;} //compute next power

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
12 Computing d? Now we see how encryption/decryption algorithms work. But how does key generation algorithm work? In particular, how to find d? Recall we need for all m, m ed-1 =1(mod n). This requires a little number theory.
13 Residue Class (1) For any modulus n, any integer a, we can define A={a’: a’=a mod n} This is called a residue class. For any modulus n, the residue classes mod n constitute a partition of integers. Any two residue classes mod n are disjoint. Every integer is in a residue class mod n.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
14 Residue Class (2) Being in the same residue class is called modular equivalent mod n. This is an equivalence relation.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern