Unit 4_Public Key cryptography
Unit 4_Public Key cryptography
Unit 4_Public Key cryptography
Dr. M. V. Mandi
Professor, Dept. of ECE, Dr. AIT, Bangalore
Private-Key Cryptography
• public-key/two-key/asymmetric cryptography
involves the use of two keys:
• a public-key, which may be known by anybody, and can
be used to encrypt messages, and verify signatures
• a private-key, known only to the recipient, used to
decrypt messages, and sign (create) signatures
• is asymmetric because
• those who encrypt messages or verify signatures cannot
decrypt messages or create signatures
Public-Key Cryptography
Public-Key Characteristics
q r1 r2 r t1 t2 t
22 160 7 6 0 1 -22
1 7 6 1 1 -22 23
6 6 1 0 -22 23 -160
1 0 23 -160
Here t = t1 – q x t2
Since gcd(7, 160) = 1, multiplicative inverse of 7 is 23
Ex 2: RSA
1. Select primes: p=7 & q=11
2. Compute n = p.q =7 x 11= 77
3. Compute ø(n)=(p–1)(q-1)=6 x 10=60
4. Select e: gcd(e,60)=1; choose e = 13
5. Determine d: de ≡ 1 mod 60 and d < 60
or d ≡ e -1 mod ø(n), find 7-1 in Z60
Value is d=43 since 43x7=301 ≡ 1 mod 60
1. Publish public key PU={7,77}
2. Keep secret private key PR={43,77}
RSA Example - Encryption/Decryption
• sample RSA encryption/decryption is:
• given message M = 10 (note: 10<77)
• encryption:
C = 107 mod 77= 10
• decryption:
M = 1043 mod 77= 10
To find 7-1 in Z60 using Extended Euclid’s algorithm
q r1 r2 r t1 t2 t
8 60 7 4 0 1 -8
1 7 4 3 1 -8 9
1 4 3 1 -8 9 -17
3 3 1 0 9 -17 60
1 0 -17 60
Here t = t1 – q x t2
Since gcd(7, 60) = 1, multiplicative inverse of 7 is 43
-17 mod 60 = 43
Problems on RSA
1.p=3 and q = 11. Take e = 3 and M = 23
Ans: Ref. Notes
2.P=17 and q=11. Take e = 3 and M = 88
Ans: Ref Notes
Have considered
Public Key cryptography
RSA,
Diffie-Hellman Key exchange algorithm