Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.

Similar presentations


Presentation on theme: "Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy."— Presentation transcript:

1 Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy

2 Public-Key Cryptography And RSA Principles Of Public-Key Cryptosystems  Public-Key Cryptosystems  Applications for Public-Key Cryptosystems  Requirements for Public-Key Cryptography  Public-Key Cryptanalysis RSA Algorithm  Description of the Algorithm  Computational Aspects  Security of RSA

3 Key Points Asymmetric encryption (Diffie and Hellman, 1976) Public Key (PUK) Private Key (PRK) Plaintext Encryption algorithm Decryption algorithm PUK/PRK Plaintext

4 Key Points Asymmetric encryption RSA most widely public-key cryptosystem confidentiality authentication

5 Principles Of Public Key Cryptosystem

6

7 Plaintext: readable message or data that is fed into the algorithm as input. Encryption algorithm: performs various transformations on plaintext. Public and private keys: a pair of keys selected, if one used for encryption, other used for decryption. Ciphertext: scrambled message. It depends on plaintext and the key, two different keys produce two different ciphertexts. Decryption algorithm: accepts ciphertext and key to produce the original plaintext.

8

9 Public-Key Cryptosystem: Secrecy

10

11 Public-Key cryptosystem: Authentication

12

13 Public-Key cryptosystem: Authentication and Secrecy

14

15 Applications for Public-Key Cryptosystems Encryption /decryption Digital signature Key exchange

16 Requirements for Public-Key Cryptography Easy computation B (public key, private key) Easy computation A (public key, M) Easy computation B (private key, C)

17 Requirements for Public-Key Cryptography Infeasible computationally adversary (public key) (private key) Infeasible computationally adversary (public key, C) (M) Order keys

18 Requirements for Public-Key Cryptography One way function Trap-door one-way function

19 Public-Key Cryptanalysis Use large keys tradeoff (brute-force attack, encryption/decryption) Public key private key (not proven mathematically)

20 RSA Algorithm Ron Rivest, Adi Shamir, and Len Adleman (Rivest-Shamir-Adleman) (RSA, 1977) block (binary value) < some number n. block size <= Log 2 (n) + 1 Sender and Receiver n Sender e Receiver d

21 RSA Algorithm

22 Requirements of RSA P and q are prime

23 RSA Algorithm

24

25 Public key: PU = {7, 187}, Private key: PR = {23, 187}. Let plaintext M= 88 For encryption, C = 88 7 mod 187

26 Encryption: RSA Algorithm 1.88 7 mod 187 = [(88 4 mod 187) × (88 2 mod 187)× (88 1 mod 187)] mod 187 2.88 1 mod 187 = 88 3.88 2 mod 187 = 7744 mod 187 = 77 4.88 4 mod 187 = 59,969,536 mod 187 = 132 5.88 7 mod 187 = (88 × 77 × 132) mod 187 = 894,432 mod 187 = 11

27 Decryption: RSA Algorithm 1.11 23 mod 187 = [(11 1 mod 187 ) × (11 2 mod 187 )× (11 4 mod 187 )] × (11 8 mod 187) × (11 8 mod 187)] mod 187 2.11 1 mod 187 = 11 3.11 2 mod 187 = 121 4.11 4 mod 187 = 14,641 mod 187 = 55 5.11 8 mod 187 = 214,358,881 mod 187 = 33 6.11 23 mod 187 = (11 × 121 × 55 × 33 × 33) mod 187 = 79,720,245 mod 187 = 88 For decryption, M = 11 23 mod 187

28

29 Example: RSA algorithm

30 Security of RSA 1.Brute force Trying all possible private keys Large key space 2. Mathematical attacks (n, Ø,d) large (n)

31 Security of RSA 3. Timing attacks: Depend on the running time of decryption algorithm  Constant exponentiation time: Ensure that all exponentiations take the same amount of time  Random delay: adding a random delay to the exponentiation algorithm  Blinding: Multiply the ciphertext by a random number

32 Security of RSA

33 4. Chosen ciphertext attacks: Exploits properties of RSA algorithm optimal asymmetric encryption padding (OAEP)

34

35 Example 2 Let M=7 1.Select primes p=11, q=3 2.Calculate n = pq = 11 x 3 = 33 Ø = (p-1)(q-1) = 10 x 2 = 20 3.Choose e=3, Check gcd(e, Ø) =1 4.Compute d, ed ≡ 1 (mod Ø) or Ø divides (ed-1) or ed+Øk=1 Simple testing (d = 1, 2,...) Check: ed-1 = 3X7 - 1 = 20, which is divisible by Ø 5. Public key: PU = {n, e} = {33, 3} Private key: PR= {n, d} = {33, 7} 6. C = M e mod n = 7 3 mod 33 = 343 mod 33 = 13 7. M= C d mod n =13 7 mod 33 13 (4+2+1) = (13 4 x13 2 x13 1 ) mod 33 = (16 x 4 x 13 ) mod 33 = 832 mod 33= 7

36 Thank you for your attention


Download ppt "Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy."

Similar presentations


Ads by Google