Remote Timing Attacks -Rashmi Kukanur. Agenda  Timing Attacks  Case Study : –David Brumley –Dan Boneh  Defenses.

Slides:



Advertisements
Similar presentations
Side-Channel Attacks on RSA with CRT Weakness of RSA Alexander Kozak Jared Vanderbeck.
Advertisements

RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
Public Key Cryptosystems - RSA Receiver Sender Eavesdroppe r p q p q p q p and q prime.
Data encryption with big prime numbers
Public Key Encryption Algorithm
Lecture 3.3: Public Key Cryptography III CS 436/636/736 Spring 2012 Nitesh Saxena.
Computer Security: Computer Science with Attackers Usable Privacy and Security Fall 2009 As told by David Brumley 1.
Mid-term Review Network Security. Gene Itkis: CS558 Network Security2 Secure channel SSL SSL (and many others: incl. IPSEC) Shared key establishing Trusted.
Mid-term Review Network Security. Secure channel SSL SSL (and many others: incl. IPSEC) Shared key establishing Trusted party (Kerberos, etc. - to be.
RSA Attacks 1 RSA Implementation Attacks RSA Attacks 2 RSA  RSA o Public key: (e,N) o Private key: d  Encrypt M C = M e (mod N)  Decrypt C M = C d.
Network Security Review. Secure channel Communication security Confidentiality Message Traffic Authentication Integrity How to achieve? Establish shared.
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
Public Key Cryptography
Cryptography in Subgroups of Z n * Jens Groth UCLA.
RSA Exponentiation cipher
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
Mid-term Review Network Security. Secure channel SSL (and many others:incl. IPSEC) Shared key establishing Trusted party (Kerberos, etc. - to be covered)
RSA Encryption William Lu. RSA Background  Basic technique first discovered in 1973 by Clifford Cocks of CESG (part of British GCHQ)  Invented in 1977.
Chapter 3 Encryption Algorithms & Systems (Part B)
Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.5 Public Key Algorithms.
Dan Boneh Public Key Encryption from trapdoor permutations The RSA trapdoor permutation Online Cryptography Course Dan Boneh.
RSA Encryption Caitlin O’Dwyer. What is an RSA Number? An RSA number n is a number s.t. n=pq Where p and q are distinct, large, prime integers.
Dan Boneh Public Key Encryption from trapdoor permutations RSA in practice Online Cryptography Course Dan Boneh.
“RSA”. RSA  by Rivest, Shamir & Adleman of MIT in 1977  best known & widely used public-key scheme  RSA is a block cipher, plain & cipher text are.
Public Key Model 8. Cryptography part 2.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Topic 18: RSA Implementation and Security
Strong Password Protocols
The RSA Algorithm Rocky K. C. Chang, March
Introduction to Modular Arithmetic and Public Key Cryptography.
Cryptography Lecture 8 Stefan Dziembowski
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
RSA and its Mathematics Behind
RSA Ramki Thurimella.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
9th IMA Conference on Cryptography & Coding Dec 2003 More Detail for a Combined Timing and Power Attack against Implementations of RSA Werner Schindler.
EPassports EAC Conformity & Interoperability Tests, Prague September 7-12, 2008 When an e-Passport Talks and it Should Not Martin Hlaváč and Tomáš Rosa.
1 Lect. 13 : Public Key Encryption RSA ElGamal. 2 Shamir Rivest Adleman RSA Public Key Systems  RSA is the first public key cryptosystem  Proposed in.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
Day 37 8: Network Security8-1. 8: Network Security8-2 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key:
By Yernar.  Background  Key generation  Encryption  Decryption  Preset Bits  Example.
Strength of Cryptographic Systems Dr. C F Chong, Dr. K P Chow Department of Computer Science and Information Systems The University of Hong Kong.
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
RSA Public Key Crypto System. About RSA Announced in 1977 by Ronald Rivest, Adi Shamir, and Leonard Adleman Relies on the relative ease of finding large.
1 Public-Key Cryptography and Message Authentication.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
Slide 1 Vitaly Shmatikov CS 380S Timing Attacks. slide 2 Reading uKocher. “Timing Attacks on Implementations of Diffie-Hellman, RSA, DSS, and Other Systems”
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.
Chapter 3 – Public Key Cryptography and RSA (A). Private-Key Cryptography traditional private/secret/single-key cryptography uses one key shared by both.
Attacking RSA Brian Winant Reference “Twenty Years of Attacks on the RSA Cryptosystem” By Dan Boneh In Notices of the American Mathematical.
Remote Timing Attacks are Practical David Brumley Dan Boneh [Modified by Somesh.
Encryption on the Internet Jeff Cohen. Keeping Information Secret What information do we want to be secret? –Credit card number –Social security number.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
1/16 Seeing through M IST given a Small Fraction of an RSA Private Key Colin D. Walter Comodo Research Lab (Bradford, UK)
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
0x1A Great Papers in Computer Security Vitaly Shmatikov CS 380S
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
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.
Copyright © Zeph Grunschlag, RSA Encryption Zeph Grunschlag.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Cryptography services Lecturer: Dr. Peter Soreanu Students: Raed Awad Ahmad Abdalhalim
Key Exchange in Systems VPN usually has two phases –Handshake protocol: key exchange between parties sets symmetric keys –Traffic protocol: communication.
Remote Timing Attacks are Practical
Attacks on Public Key Encryption Algorithms
Rivest, Shamir and Adleman
Cryptographic Timing Attacks
RSA Implementation Attacks
Presentation transcript:

Remote Timing Attacks -Rashmi Kukanur

Agenda  Timing Attacks  Case Study : –David Brumley –Dan Boneh  Defenses

What is Timing Attack  Timing Attack : Extract secrets (private keys) in a security system by measuring the amount of time required to perform private key operations.  General Belief: Web Servers and RSA Implementations are not vulnerable.

Cause of concern:  RSA security broken when factors of modulus exposed  OpenSSL widely used  Challenges the security of many crypto implementations

RSA review 1.Select two large prime numbers p and q. 2.Let N= pq be the modulus. 3.Choose e relatively prime to (p-1)(q-1) 4. Find d s.t. ed = 1 mod (p-1)(q-1) 5.Public key (N,e) 6.Private Key d  Encryption C = M e mod N  Decryption M = C d mod N

OpenSSL implementation RSA  Chinese Remainder Theorem  Exponentiation –Sliding Windows  Multiplication Routines –Karatsuba Algorithm O(nlog 2 3) –Normal Multiplication O(nm)  Montgomery Reduction

Chinese Remainder Theorem  Let m i ’s be relatively prime pair wise and  M = m 1 m 2 ……..m k, Mi = M / m i  C i = M i ( M i -1 mod m i )  a i = A mod mi  A mod M =(a 1 c 1 +a 2 c 2 +.+a k c k )mod M

RSA Decryption  C d mod pq can be computed from  m 1 = c d1 mod p, m 2 = c d2 mod q as  (m 1 c p + m 2 c q ) mod pq, where  c p = q(q -1 mod p), c q = p(p -1 mod q)  RSA decryption with CRT speedup

Timing differences comparison Montgomery reduction Schindler’s observation : Pr[Extra Reduction] = (g mod q) / 2R Multiplication Routine Karatsuba Normal Multiplication

Time variance - overview g<qg>q Montgomery effect LongerShorter Multiplication effect ShorterLonger g is the decryption value. Each is dominant at a different phase.

Timing Attack on Open SSL  Let N=pq with q<p.  Approximate q (approaching) guessing  q: g try g hi to decide guessing  q: g try g hi to decide i-1…i

Timing Attack (Contd.)  Initial guess g of q lies between (i.e 2 log 2 N/2 ) and (i.e 2 log 2 N/2-1 ) (i.e 2 log 2 N/2 ) and (i.e 2 log 2 N/2-1 )  Try all the possible combinations of the top few bits and pick the first peak i.e q.

Timing Attack (Contd.)  Let g=q for top i-1 bits. Remaining bits of g=0(g<q)  Recover i’th bit of q as follows: –(1) g hi =g, but with i’th bit 1. If i’th bit of q is 1 then g<g hi <q, else g<q<g hi. –(2) u g =gR -1 mod N, u ghi =g hi R -1 mod N –(3) t1=DecryptTime(u g ), t2=DecryptTime(u ghi ). –(4) D=|t1-t2|.  If D is large then g<q<g hi and i’th bit of q is 0, otherwise the bit is 1.  Previous D values considered  Decrypting just g results in weak indicator in sliding windows.

Experiment 1  Parameters –Neighborhood size n, Sample Size s –Total number of queries is s*n Using sample size of 7 and neighborhood of 400, total queries. Attack time (on 1024-bit key) is about 2 hours.

Experiment 2  Architecture effects: compare two versions of a program making local calls to OpenSSL: “regular” and “extra-inst” with 6 additional nops before decryption.

 Compile-time effects:  Optimized (-O3 –fomit_frame_pointer –mcpu=pentium);  No Pentium flag (-O3 –fomit_frame_pointer);  Unoptimized (-g). Experiment 3

Defense  Defense: –Only one multiplication routine and always carry out extra reduction in Montgomery ’ s algorithm –Quantize all RSA computations –Blinding (Currently preferred)

Blinding Defenses  Before decryption compute x=r e g mod N where r is random.  Then decrypt x and compute x/r.