Foundations of Network and Computer Security J J ohn Black Lecture #12 Sep 23 rd 2009 CSCI 6268/TLEN 5550, Fall 2009.

Slides:



Advertisements
Similar presentations
RSA.
Advertisements

RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
22C:19 Discrete Structures Integers and Modular Arithmetic
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
Session 4 Asymmetric ciphers.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
Foundations of Network and Computer Security J J ohn Black Lecture #9 Sep 22 nd 2005 CSCI 6268/TLEN 5831, Fall 2005.
Foundations of Network and Computer Security J J ohn Black Lecture #7 Sep 14 th 2004 CSCI 6268/TLEN 5831, Fall 2004.
Foundations of Network and Computer Security J J ohn Black Lecture #10 Sep 18 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
OOP/Java1 Public Key Crytography From: Introduction to Algorithms Cormen, Leiserson and Rivest.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Public Key Crytography1 From: Introduction to Algorithms Cormen, Leiserson and Rivest.
Foundations of Network and Computer Security J J ohn Black Lecture #11 Oct 4 th 2005 CSCI 6268/TLEN 5831, Fall 2005.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Foundations of Network and Computer Security J J ohn Black Lecture #8 Sep 16 th 2004 CSCI 6268/TLEN 5831, Fall 2004.
Factoring 1 Factoring Factoring 2 Factoring  Security of RSA algorithm depends on (presumed) difficulty of factoring o Given N = pq, find p or q and.
Introduction to Modern Cryptography Homework assignments.
Foundations of Network and Computer Security J J ohn Black Lecture #13 Sep 26 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
Foundations of Network and Computer Security J J ohn Black Lecture #10 Sep 29 th 2005 CSCI 6268/TLEN 5831, Fall 2005.
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
CS470, A.SelcukPublic Key Cryptography1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Foundations of Network and Computer Security J J ohn Black Lecture #6 Sep 9 th 2004 CSCI 6268/TLEN 5831, Fall 2004.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Foundations of Network and Computer Security J J ohn Black Lecture #11 Sep 21 st 2007 CSCI 6268/TLEN 5831, Fall 2007.
Foundations of Network and Computer Security J J ohn Black Lecture #12 Sep 24 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Public Key Algorithms 4/17/2017 M. Chatterjee.
Lecture 6: Public Key Cryptography
Introduction to Public Key Cryptography
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
Topic 18: RSA Implementation and Security
Andreas Steffen, , 4-PublicKey.pptx 1 Internet Security 1 (IntSi1) Prof. Dr. Andreas Steffen Institute for Internet Technologies and Applications.
Foundations of Network and Computer Security J J ohn Black Lecture #14 Oct 1 st 2007 CSCI 6268/TLEN 5831, Fall 2007.
The RSA Algorithm Rocky K. C. Chang, March
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
Lecture 19 Page 1 CS 111 Online Symmetric Cryptosystems C = E(K,P) P = D(K,C) E() and D() are not necessarily the same operations.
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.
1 Applications of Number Theory CS 202 Epp section 10.4 Aaron Bloomfield.
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.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
Digital Signatures A primer 1. Why public key cryptography? With secret key algorithms Number of key pairs to be generated is extremely large If there.
MA/CSSE 473 Day 11 Primality testing summary Data Encryption RSA.
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
CS461/ECE422 Spring 2012 Nikita Borisov — UIUC1.  Text Chapters 2 and 21  Handbook of Applied Cryptography, Chapter 8 
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2013.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Key Generation Bob generates his keys as follows –Choose two large distinct random primes p, q –Set n = pq (in Z… no finite groups yet) –Compute  (n)
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Elgamal Public Key Encryption CSCI 5857: Encoding and Encryption.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2014.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
1 Introduction to Information Security , Spring 2016 Lecture 4: Applied cryptography: asymmetric Zvi Ostfeld Slides credit: Eran Tromer.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Key Exchange in Systems VPN usually has two phases –Handshake protocol: key exchange between parties sets symmetric keys –Traffic protocol: communication.
Public Key Encryption Major topics The RSA scheme was devised in 1978
Practical Aspects of Modern Cryptography
RSA and El Gamal Cryptosystems
Foundations of Network and Computer Security
Appendix 5: Cryptography p
Presentation transcript:

Foundations of Network and Computer Security J J ohn Black Lecture #12 Sep 23 rd 2009 CSCI 6268/TLEN 5550, Fall 2009

RSA Example Let p = 19, q = 23 –These aren’t large primes, but they’re primes! –n = 437 –  (n) = 396 –Clearly 5 ∈ Z * 396, so set e=5 –Then d=317 ed = 5 x 317 = 1585 = x 396 ✓ –pk = (5, 437) –sk = (396, 437)

RSA Example (cont) Suppose M = 100 is Alice’s message –Ensure (100,437) = 1 ✓ –Compute C = mod 437 = 85 –Send 85 to Bob Bob receives C = 85 –Computes mod 437 = 100 ✓ We’ll discuss implementation issues later

RSA Proof Need to show that for any M ∈ Z n *, M ed = M mod n –ed = 1 mod  (n) [by def of d] –So ed = k  (n) + 1 [by def of modulus] –So working in Z n *, M ed = M k  (n) + 1 = M k  (n) M 1 = (M  (n) ) k M = 1 k M = M Do you see LaGrange’s Theorem there? This doesn’t say anything about the security of RSA, just that we can decrypt

Security of RSA Clearly if we can factor efficiently, RSA breaks –It’s unknown if breaking RSA implies we can factor Basic RSA is not good encryption –There are problems with using RSA as I’ve just described; don’t do it –Use a method like OAEP We won’t go into this

Factoring Technology Factoring Algorithms –Try everything up to sqrt(n) Good if n is small –Sieving Ditto –Quadratic Sieve, Elliptic Curves, Pollard’s Rho Algorithm Good up to about 40 bits –Number Field Sieve State of the Art for large composites

The Number Field Sieve Running time is estimated as This is super-polynomial, but sub- exponential –It’s unknown what the complexity of this problem is, but it’s thought that it lies between P and NPC, assuming P  NP

NFS (cont) How it works (sort of) –The first step is called “sieving” and it can be widely distributed –The second step builds and solves a system of equations in a large matrix and must be done on a large computer Massive memory requirements Usually done on a large supercomputer

The Record In November 2005, RSA-640 was factored –That’s 640 bits, 193 decimal digits –The next number is RSA-704 which is –Anyone delivering the two factors gets an immediate A in the class (and it once had a prize of 30,000 USD)

On the Forefront Other methods in the offing –Bernstein’s Integer Factoring Circuits –TWIRL and TWINKLE Using lights and mirrors –Shamir and Tromer’s methods They estimate that factoring a 1024 bit RSA modulus would take 10M USD to build and one year to run –Some skepticism has been expressed –And the beat goes on… I wonder what the NSA knows

Implementation Notes We didn’t say anything about how to implement RSA –What were the hard steps?! Key generation: –Two large primes –Finding inverses mode  (n) Encryption –Computing M e mod n for large M, e, n –All this can be done reasonably efficiently

Implementation Notes (cont) Finding inverses –Linear time with Euclid’s Extended Algorithm Modular exponentiation –Use repeated squaring and reduce by the modulus to keep things manageable Primality Testing –Sieve first, use pseudo-prime test, then Rabin-Miller if you want to be sure Primality testing is the slowest part of all this Ever generate keys for PGP, GPG, OpenSSL, etc?

Note on Primality Testing Primality testing is different from factoring –Kind of interesting that we can tell something is composite without being able to actually factor it 2002 result from IIT trio –Recently it was shown that deterministic primality testing could be done in polynomial time Complexity was O(n 12 ), though it’s been significantly reduced since then –One of our faculty thought this meant RSA was broken! Randomized algorithms like Rabin-Miller are far more efficient than the IIT algorithm, so we’ll keep using those

Prime Number Theorem Are there enough primes? –There are plenty, as exhibited by the PNT: PNT:  (n) is asymptotic to n/ln(n) where  (n) is the number of primes smaller than n In other words, lim n → 1  (n) ln(n)/n = 1 –What does this mean? Primes get sparser as we go to the right on the number line

 n) versus n/ln(n)

Sample Calculation Let’s say we’re generating an RSA modulus and we need two 512-bit primes –This will give us a 1024-bit modulus n Let’s generate the first prime, p –Question: if I start at some random 512-bit odd candidate c, what is the probability that c is prime? Ans: about 1/ln(c) ≈ 1/350 –Question: what is the expected number of candidates I have to test before I find a prime, assuming I try every odd starting from c? Ans: each number has a 1/350 chance, but I’m testing only odd numbers, so my chance is 1/175; I therefore expect to test 175 numbers on average before I find a prime Of course I could do more sieving (eliminate multiples of 3, 5, etc)

Digital Signatures Digital Signatures are authentication in the asymmetric key model –MAC was in the symmetric key model Once again, Alice wants to send an authenticated message to Bob –This time they don’t share a key –The security definition is the same ACMA model

We Can Use RSA to Sign RSA gives us a signing primitive as well –Alice generates her RSA keys Signing key sk = (d,n) Verification key vk = (e,n) Distributes verification key to the world Keeps signing key private –To sign message M ∈ Z n * Alice computes sig = M d mod n Alice sends (M, sig) to Bob –To verify (M’, sig’) Bob checks to ensure M’ = sig’ e mod n If not, he rejects Once again, don’t do this; use PSS or similar

Efficiency Why is this inefficient? –Signature is same size as message! –For MACs, our tag was small… that was good Hash-then-sign –We normally use a cryptographic hash function on the message, then sign the hash –This produces a much smaller signature –2 nd -preimage resistance is key here Without 2 nd -preimage resistance, forgeries would be possible by attacking the hash function