Revision. Cryptography depends on some properties of prime numbers. One of these is that it is rather easy to generate large prime numbers, but much harder.

Slides:



Advertisements
Similar presentations
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (4) Information Security.
Advertisements

CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
Data encryption with big prime numbers
22C:19 Discrete Structures Integers and Modular Arithmetic
BY : Darshana Chaturvedi.  INTRODUCTION  RSA ALGORITHM  EXAMPLES  RSA IS EFFECTIVE  FERMAT’S LITTLE THEOREM  EUCLID’S ALGORITHM  REFERENCES.
Public Key Encryption Algorithm
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Lecture 3.3: Public Key Cryptography III CS 436/636/736 Spring 2012 Nitesh Saxena.
1 The RSA Algorithm Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
and Factoring Integers (I)
Attacks on Digital Signature Algorithm: RSA
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Public Encryption: RSA
Codes, Ciphers, and Cryptography-RSA Encryption
Lecture 5 Overview Does DES Work? Differential Cryptanalysis Idea – Use two plaintext that barely differ – Study the difference in the corresponding.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Prime Numbers Prime numbers only have divisors of 1 and self
Section 2.2: Affine Ciphers; More Modular Arithmetic Practice HW (not to hand in) From Barr Textbook p. 80 # 2a, 3e, 3f, 4, 5a, 7, 8 9, 10 (Use affinecipherbreaker.
Section 4.3: Fermat’s Little Theorem Practice HW (not to hand in) From Barr Text p. 284 # 1, 2.
RSA Ramki Thurimella.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Section 4.4: The RSA Cryptosystem Practice HW Handwritten and Maple Exercises p at end of class notes.
RSA Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013.
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
The RSA Algorithm. Content Review of Encryption RSA An RSA example.
24-Nov-15Security Cryptography Cryptography is the science and art of transforming messages to make them secure and immune to attacks. It involves plaintext,
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
POON TENG HIN.  RSA  Shamir’s Three-Pass Protocol  Other issues.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
Data encryption with big prime numbers DANIEL FREEMAN, SLU.
CS/COE 1501 Recitation RSA Encryption/Decryption Extended Euclidean Algorithm Digital Signatures.
Lecture 6. 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
Information and Computer Security CPIS 312 Lab 8 1 Asymmetric Key Algorithms RSA Algorithm TRIGUI Mohamed Salim.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Overview Modern public-key cryptosystems: RSA
Encryption Take 2: Practical details
Public Key Cryptography
CS480 Cryptography and Information Security
Asymmetric-Key Cryptography
Mathematics of Cryptography
Visit for more Learning Resources
Chapter Applications of Number Theory Some Useful Results
RSA Slides by Kent Seamons and Tim van der Horst
Lecture 5 RSA DR. Nermin Hamza.
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Introduction to Cryptography
RSA Preliminaries.
PUBLIC-KEY ENCRYPTION Focusing on RSA
Public Key Encryption Engineering & Analysis Operation-Part2
Public Key Cryptosystems - RSA
Number Theory (Chapter 7)
The RSA Algorithm JooSeok Song Tue.
Private-Key Cryptography
CS/COE 1501 Recitation RSA Encryption/Decryption
Number Theory and Euclidean Algorithm
PART VII Security.
ICS 353: Design and Analysis of Algorithms
The RSA Algorithm JooSeok Song Tue.
Analysis of the RSA Encryption Algorithm
Symmetric-Key Cryptography
Lecture 3.1: Public Key Cryptography I
Chapter -5 PUBLIC-KEY CRYPTOGRAPHY AND RSA
Symmetric-Key Cryptography
Introduction to Algorithms Second Edition by
Presentation transcript:

Revision

Cryptography depends on some properties of prime numbers. One of these is that it is rather easy to generate large prime numbers, but much harder to factor large numbers into primes. prime numbers – For example, in RSA, the security of the system depends on the fact that in order to find d, phi must be known, and this in turn requires knowledge of p and q. It is believed that there is no efficient way of factoring (for large values) and so private key cannot be deduced from the public key.

Testing for a prime

Illustration

Fermat Test

Square Root Test What are the square roots of 1 mod n if n is 7 (a prime)? Example 9.21 Solution The only square roots are 1 and −1. We can see that

n-1 = m * 2 k a n-1 = a m*2^k is it a prime number? = 2320 = 1160 *2 = 580 *2 2 = 260 * 2 3 = 130 * 2 4 = 65 * 2 5 M= 65, k = 5, a = 2

n-1 = m * 2 k a n-1 = a m*2^k M= 65, k = 5, a = 2 Initialisation: T= 2 65 mod 2321 = 560 mod 2321 K=1:T = 5602 mod 2321 = 265 mod 2321 K=2: T = 2652 mod 2321 = 595 mod 2321 K=3:T = 5952 mod 2321 = 1233 mod 2321 K=4:T= mod 2321 = 34 mod 2321 => Composite (11*211)

The Extended Euclidean Algorithm The Euclidean algorithm is an efficient way of computing the greatest common divisor of two numbers. It also provides a way of finding numbers a, b, such that (x,y) = ax + by.

Gcd(853,199)

For each pair of integers (a, b) below, find d = gcd(a, b) and find a pair of numbers j and k such that d = j * a + k * b. (Use the Extended Euclidean algorithm.) (a) 90 and 56 (b) 91 and 89 (c) 711 and 75 (d) 815 and 75 (e) 112 and 196 (f) 366 and 150

Having made the recursive function calls, we’re now able to fill in the values of j and k from right to left. The last column (as shown)will always be 1 and 0 (assuming that a and b are not both 0, of course). To get the values of j and k in a column, we use the values of j and k from the previous column (the one to its right, as we’re filling in the table from right to left) and the value of q that is in the same column that we’re currently filling in.

Thus we have gcd(90, 56) = 2 and 2 = (5) · 90 + (−8) · 56. You can double check your work at each step, as for each column, using those values of a, b, j, and k, you should always get a linear combination that equals the GCD. For example, we have:  2 = (−1) · 22 + (2) · 10  2 = (2) · 34 + (−3) · 22

Fermat’s Little Theorem First Version a p ≡ a mod p a p − 1 ≡ 1 mod p Second Version

Find the result of 6 10 mod 11. Example 1 Solution We have 6 10 mod 11 = 1. This is the first version of Fermat’s little theorem where p = 11. Find the result of 3 12 mod 11. Example 2 Solution Here the exponent (12) and the modulus (11) are not the same. With substitution this can be solved using Fermat’s little theorem.

Euler’s Theorem First Version a  (n) ≡ 1 (mod n) Second Version a k ×  (n) + 1 ≡ a (mod n) The second version of Euler’s theorem is used in the RSA cryptosystem. Note

Find the result of 6 24 mod 35. Example 1 Solution We have 6 24 mod 35 = 6  (35) mod 35 = 1. Find the result of mod 77. Example 2 Solution If we let k = 1 on the second version, we have mod 77 = (20 mod 77) (20  (77) + 1 mod 77) mod 77 = (20)(20) mod 77 = 15.

ASCII

Plain Text

RSA  Let p and q be two large prime numbers  Let N = pq be the modulus  Choose e relatively prime to (p  1)(q  1) = Φ(n)  Find d so that ed = 1 (mod (p  1)(q  1))  Public key is (N,e)  Private key is d

RSA  To encrypt M compute: C = M e (mod N)  To decrypt C compute: M = C d (mod N)  Recall that e and N are public  If attacker can factor N, can use e to easily find d since ed = 1 (mod (p  1)(q  1))  Factoring the modulus breaks RSA!

RSA  Let p and q be two large prime numbers  Let N = pq be the modulus  Choose e relatively prime to (p  1)(q  1) = Φ(n)  Find d so that ed = 1 (mod (p  1)(q  1))  Public key is (N,e)  Private key is d

1. p = 3 and q = n = p * q = 3 * 11 = z = (p-1)(q-1) = (3-1)*(11-1) = Choose prime number e such e and z are co prime e: 2, 3, 5, 7, 11, 13, 17, 19  e * d = 1(mod z) 3 * d = 1(mod 20)  d = 7 Simple RSA Example

 Public key: (N, e) = (33, 3)  Private key: d = 7  Suppose message M = 8  Ciphertext C is computed as C = M e ( mod N) = 8 3 = 512 = 17 (mod 33)  Decrypt C to recover message: M = C d (mod N) = 17 7 = 410,338,673 = 12,434,505  = 8 (mod 33)

RSA Conclusions  RSA is the “gold standard” in public key crypto  Provides encryption and signatures  Has stood the test of time o Virtually unchanged since its invention  We look closely at RSA attacks in later section (implementation attacks)

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 Example of RSA Algorithm