Download presentation
Presentation is loading. Please wait.
Published byEric Bell Modified over 8 years ago
1
Lecture 6
2
RSA Use in Encryption to encrypt a message M the sender: – obtains public key of recipient PU={e,n} – computes: C = M e mod n, where 0≤M<n to decrypt the ciphertext C the owner: – uses their private key PR={d,n} – computes: M = C d mod n note that the message M must be smaller than the modulus n (block if needed)
3
RSA Example - En/Decryption sample RSA encryption/decryption is: given message M = 88 1.Publish public key PU={7,187} 2.Keep secret private key PR={23,187} encryption: C = 88 7 mod 187 = 11 decryption: M = 11 23 mod 187 = 88
4
Assignments 1.Perform encryption and decryption using RSA algorithm, as in Figure 1, for the following: ① p = 3; q = 11, e = 7; M = 5 ② p = 5; q = 11, e = 3; M = 9 2.In a public-key system using RSA, you intercept the ciphertext C = 10 sent to a user whose public key is e = 5, n = 35. What is the plaintext M? EncryptionDecryption Plaintext 88 Ciphertext 11 Plaintext 88 7 mod187=11 23 mod187=88 KU=7,187KR=23,187 Figure1. Example of RSA Algorithm
5
Why RSA Works because of Euler's Theorem: – a ø(n) mod n = 1 where gcd(a,n)=1 in RSA have: – n=p.q – ø(n)=(p-1)(q-1) – carefully chose e & d to be inverses mod ø(n) – hence e.d=1+k.ø(n) for some k hence : C d = M e.d = M 1+k.ø(n) = M 1.(M ø(n) ) k = M 1.(1) k = M 1 = M mod n
6
Efficient Encryption Encryption uses exponentiation to power e Hence if e small, this will be faster – often choose e=65537 (2 16 -1) – also see choices of e=3 or e=17 But if e too small (eg e=3) can attack – using Chinese remainder theorem & 3 messages with different moduli
7
Efficient Decryption Decryption uses exponentiation to power d – this is likely large, insecure if not can use the Chinese Remainder Theorem (CRT) to compute mod p & q separately. then combine to get desired answer
8
Exponentiation can use the Square and Multiply Algorithm a fast, efficient algorithm for exponentiation concept is based on repeatedly squaring base and multiplying in the ones that are needed to compute the result look at binary representation of exponent only takes O(log 2 n) multiples for number n –eg. 7 5 = 7 4.7 1 = 3.7 = 10 mod 11 –eg. 3 129 = 3 128.3 1 = 5.3 = 4 mod 11
9
Exponentiation The algorithm for computing a b mod n The b integer is expressed as as binary number : bk, bk-1,…, b0
10
Example Get 7 5 mod 11= ?? a b mod n as in th algorithm So b= 5 101 n= 11 a= 7 The final result is = 10 101 b0b1b2 dcAsk? b(k)k 10 102 71Yes b2 = 1 521 No 340 105
11
Example Get 10 3 mod 60= ?? a b mod n as in th algorithm So b= 3 11 n= 60 a= 10 The final result is = 40 11 b01 b2 dcAsk? b(k)k 10 101 101Yes b1 = 1 4020 3Yes b0 = 1
12
RSA Security three approaches to attacking RSA: –brute force key search (infeasible given size of numbers) –mathematical attacks (based on difficulty of computing ø(N), by factoring modulus N) –timing attacks (on running of decryption)
13
Factoring Problem mathematical approach takes 3 forms: –factor N=p.q, hence find ø(N) and then d –determine ø(N) directly and find d –find d directly currently believe all equivalent to factoring –have seen slow improvements over the years as of Aug-99 best is 130 decimal digits (512) bit with GNFS –biggest improvement comes from improved algorithm cf “Quadratic Sieve” to “Generalized Number Field Sieve” –barring dramatic breakthrough 1024+ bit RSA secure ensure p, q of similar size and matching other constraints
14
Summary have considered: –prime numbers –Fermat’s and Euler’s Theorems –Primality Testing –Chinese Remainder Theorem –Discrete Logarithms –principles of public-key cryptography –RSA algorithm, implementation, security
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.