RSA Ramki Thurimella.

Slides:



Advertisements
Similar presentations
Cryptography and Network Security Chapter 9
Advertisements

CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (4) Information Security.
Great Theoretical Ideas in Computer Science.
Session 4 Asymmetric ciphers.
Abdullah Sheneamer CS591-F2010 Project of semester Presentation University of Colorado, Colorado Springs Dr. Edward RSA Problem and Inside PK Cryptography.
Dr. Lo’ai Tawalbeh Summer 2007 Chapter 9 – Public Key Cryptography and RSA Dr. Lo’ai Tawalbeh New York Institute of Technology (NYIT) Jordan’s Campus INCS.
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
The Algebra of Encryption CS 6910 Semester Research and Project University of Colorado at Colorado Springs By Cliff McCullough 20 July 2011.
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
Cryptography and Network Security Chapter 9. Chapter 9 – Public Key Cryptography and RSA Every Egyptian received two names, which were known respectively.
Public Key Cryptography and the RSA Algorithm
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender and receiver if this key is disclosed communications.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Dr.Saleem Al_Zoubi1 Cryptography and Network Security Third Edition by William Stallings Public Key Cryptography and RSA.
Public Key Algorithms 4/17/2017 M. Chatterjee.
1 Pertemuan 08 Public Key Cryptography Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
Cryptography and Network Security Chapter 9 5th Edition by William Stallings Lecture slides by Lawrie Brown.
CSCI 172/283 Fall 2010 Public Key Cryptography. New paradigm introduced by Diffie and Hellman The mailbox analogy: Bob has a locked mailbox Alice can.
Tallinn University of Technology Quantum computer impact on public key cryptography Roman Stepanenko.
The RSA Algorithm JooSeok Song Tue.
Lecture 6: Public Key Cryptography
Public Key Model 8. Cryptography part 2.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
RSA Numbers by: Brandon Hacay & Conrad Allen. History of RSA Numbers The letters in “RSA” are simply the initials of the people who are credited as having.
The RSA Algorithm Rocky K. C. Chang, March
Prime Numbers Prime numbers only have divisors of 1 and self
Network and Communications Network Security Department of Computer Science Virginia Commonwealth University.
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
Great Theoretical Ideas in Computer Science.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
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.
Private-Key Cryptography  traditional private/secret/single key cryptography uses one key  shared by both sender and receiver  if this key is disclosed.
Private-Key Cryptography  traditional private/secret/single key cryptography uses one key  shared by both sender and receiver  if this key is disclosed.
Public-Key Encryption
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
1 Public-Key Cryptography and Message Authentication.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
CS461/ECE422 Spring 2012 Nikita Borisov — UIUC1.  Text Chapters 2 and 21  Handbook of Applied Cryptography, Chapter 8 
The RSA Algorithm. Content Review of Encryption RSA An RSA example.
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
Cryptography and Network Security Public Key Cryptography and RSA.
Chapter 3 – Public Key Cryptography and RSA (A). Private-Key Cryptography traditional private/secret/single-key cryptography uses one key shared by both.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Attacking RSA Brian Winant Reference “Twenty Years of Attacks on the RSA Cryptosystem” By Dan Boneh In Notices of the American Mathematical.
RSA The algorithm was publicly described in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman at MIT Partly used for PGP (Pretty Good Privacy) to encrypt.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
Fall 2002CS 395: Computer Security1 Chapter 9: Public Key Cryptography.
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9 PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9 Principles Applications Requirements RSA Algorithm Description.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
By Marwan Al-Namari & Hafezah Ben Othman Author: William Stallings College of Computer Science at Al-Qunfudah Umm Al-Qura University, KSA, Makkah 1.
Chapter 9 – Public Key Cryptography and RSA Every Egyptian received two names, which were known respectively as the true name and the good name, or the.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
CPIS 312 Chapter Four: PUBLIC KEY CRYPTO. Index 2 A.Introduction A.1 Asymmetric Key Cryptography- Introduction A.2 General ideas about the Public Key.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
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.
Public Key Cryptography
Public Key Cryptosystem
PUBLIC-KEY CRYPTOGRAPHY AND RSA – Chapter 9
Presentation transcript:

RSA Ramki Thurimella

Public-Key Cryptography Symmetric cryptography: same key is used for encryption and decryption. Asymmetric cryptography: different keys used for encryption and decryption. Public-Key cryptography: an asymmetric cryptography scheme where the key used for encryption is made public.

History of Cryptography 1969, GCHQ (UK equivalent of NSA?): James Ellis proves the possibility of private-key generation over an public channel, but cannot find a way to implement it. 1972, Berkeley. Cook/Karp develop the theory of NP-Completeness. 1973, QCHQ: Clifford Cocks invents PKC after thinking about it overnight. Classified and goes unused.

More History 1974, QCHQ: Malcolm J Williamson invents what is later becomes the Diffie-Hellman key exchange algorithm. 1976, Stanford: Diffie, Hellman, and Merkle independently invent (and make public) a secret-key generation algorithm.

History 1977, MIT: Rivest, Shamir, and Adleman, based on difficulty of factoring large numbers 1978, Stanford: Merkle-Hellman public-key cryptosystem, based on knapsack (broken by Adi Shamir in 1982).

History Many of the mathematical mechanisms for public-key cryptography were developed prior to their publication. However, their utility was unclear to those that developed them. “One-way functions” and complexity were not mathematically well-understood early on.

Chinese Remainder Theorem (CRT) Special case of this ancient theorem (Sun Zi, circa 300 AD). Let p and q be distinct primes and n = p∘ q For any pair (a,b) ∊ ℤp × ℤq, there is a unique number x ∊ ℤn such that a = x mod p and b = x mod q

CRT Example Let n = p∘ q = 3 ∘ 5 (0, 0) (1, 0) 10 (2, 0) 5 (0, 1) 6 (a,b) x (0, 0) (1, 0) 10 (2, 0) 5 (0, 1) 6 (1, 1) 1 (2, 1) 11 (0, 2) 12 (1, 2) 7 (2, 2) 2 (0, 3) 3 (1, 3) 13 (2, 3) 8 (0, 4) 9 (1, 4) 4 (2, 4) 14

Garner’s Formula x = (((a-b)(q-1 mod p)) mod p) q + b q-1 mod p—constant dependent only on p & q What is 1/5 mod 3? What is -10 mod 3? What is x for (2,4)?

Finding q-1 Use Extended Euclid’s Algorithm Example: p = 89, q = 107 Need to solve the diophantine equation 107*x + 89 * y = 1 GCD: (89,107) = (18,89) = (17,18) = (1,17) = (0,1) ExtGCD: 1 = 18 - 17 -- (A) 18 = 107 – 89 -- (B) 17 = 89 – 18 *4 -- (C) = 89 – 4*(107-89) substitute for 18 from B = 5*89 - 4*107 simplify 1 = (107 -89) – (5*89 – 4* 107) substitute for 18 & 17 from A,B = 5*107-6*89 simplify The coefficient of 107 in the final equation is the inverse of 107 in ℤ*89

Why bother with CRT? CRT is useful for efficient modular exponentiation: (xs mod n) = (as mod p, bs mod q) = (as mod (p−1), bs mod (q−1))

Totient Function The totient function, (n), is the count of numbers k less than n such that k and n are relatively prime. (p) = p - 1 for p prime (pq) = (p - 1)(q - 1) for p, q prime with p ≠ q Proof: From the numbers 1 through n-1, subtract multiples of p and q. (Since n is a product of two primes p and q, all other numbers in this range would have to be relatively prime to n.) (n) = (n-1) – ( (n/p) -1) – ( (n/q) -1) Substituting n = p*q and simplifying = p*q + 1 – (q+p) = (p-1) * (q-1) = (p) * (q) □ Note that if p can be equal to q, the previous claim does not hold (Can be verified with p=q=3.) Euler’s Theorem: a(n) = 1 mod n

Encryption and Decryption Let p, q be primes Let n = p∘ q (between 1024 & 4028 bits) Pick random e, 1<e<(n), that is relatively prime to (n) Pick d such that e * d = 1 mod (n) Let 0 < m < n be the message

Encryption and Decryption Let c = me mod n be the ciphertext. Then cd = med = m mod n Follows from Euler’s Theorem, since e*d = 1 mod (n). Make e public, and keep d secret

RSA Example from Wiki Choose two distinct prime numbers, such as p = 61 and q = 53 Compute n = pq giving n = 61·53 = 3233 Compute the totient of the product as φ(n) = (p − 1)(q − 1) giving φ(3233) = (61 − 1)(53 − 1) = 3120 Choose any number 1 < e < 3120 that is coprime to 3120. Choosing a prime number for e leaves us only to check that e is not a divisor of 3120. Let e = 17. Compute d, the modular multiplicative inverse of e(mod φ(n)) yielding d = 2753 The public key is (n = 3233, e = 17). For a padded plaintext message m, the encryption function is m17(mod 3233). The private key is (n = 3233, d = 2753). For an encrypted ciphertext c, the decryption function is c2753(mod 3233).

Why RSA works “Easy” to compute me mod n and cd mod n “Hard” to determine d, even given e and n! We think of f(x) = xe mod n as a one-way function.

Why RSA works Factoring n is the same thing as revealing d: Let 〈n,e〉 be an RSA public key. Given the private key d, one can efficiently factor of n, and given the factorization of n, one can efficiently determine d.

Attacks on RSA Elementary Attacks common modulus blinding Attacks on the actual RSA cryptosystem low private exponent low public exponent Attacks of implementations of the RSA cryptosystem timing attacks

Elementary Attacks Poor configuration: A different n must be used for all users in a system, since if you know your own public, private key pair you can factor n Blinding: can fool principals into providing signatures on any message m by multiplying by re, where r is random

Low Private Exponent Wiener developed an attack that works effectively when d is sufficiently small. Let n = pq with q < p < 2q Let d < (1/3) n1/4 Given 〈n,e〉 where ed = 1 mod (n), then Eve can efficiently recover d

Low Private Exponent The details of this are involved. But there other ways of providing faster decryption, in particular the CRT method. (currently used by OpenSSL for modular exponentiation)

Low Public Exponent To reduce encryption time, use a small e. This is not known to lead to any total breaks of RSA. Most attacks use Coppersmith’s Theorem. Let n an integer & f a monic poly of degree d. Let X = n(1/d)-. Then there is an efficient way to determine all |x0| < X such that f(x0) = 0 mod n

More Public Exponents Franklin-Reiter: if e is low and Eve has ciphertexts for m and f(m) for some publicly- known polynomial f, then there is an attack to recover m and f(m).

More Public Exponents Coppersmith’s Short Pad Attack: Alice sends a message to Bob that has been randomly padded on the end to it. Eve intercepts it and prevents it from reaching its destination. Alice sends the same message to Bob again with a different random padding on the end. Eve can determine m given these two ciphertexts.

Small Public Exponents Partial Key Exposure: if e < √n, then Eve can determine all of d from knowing a percentage of the bits of d Theorem: If n is b bits, then you only need b/4 bits of d to reveal all of d. (holds for all e) When e = 3, the cryptosystem leaks half of the bits of d!

Implementation Attacks Common method of modular exponentiation: repeated squaring. z = m c = 1 for i = 0 to n if di = 1 then c = c * z mod n z = z2 mod n end At the end, c = md mod n

Timing Attacks To determine d, Eve generates a large number of random messages and observes how long it takes to compute their ciphertexts. By observing how much time it takes to compute everything combined with the physical specifications of the computational device it is possible to determine the bits of d.

Timing Attacks Once a quarter of the bits of d have been discovered, Eve can factor n Similar attacks exist for other implementations of modular exponentiation. Implementing blinding prevents this attack since Eve no longer knows what message is being decrypted

Conclusion RSA seems to be a secure public-key cryptosystem, despite our best efforts. Still no proof that it is theoretically safe. Most attacks on RSA come from poor configuration or bad implementations.