Slide 1 Vitaly Shmatikov CS 361S Overview of Public-Key Cryptography.

Slides:



Advertisements
Similar presentations
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Advertisements

CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (4) Information Security.
Asymmetric-Key Cryptography
7. Asymmetric encryption-
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Public-key Cryptography Montclair State University CMPT 109 J.W. Benham Spring, 1998.
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Cryptography.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
The School of Electrical Engineering and Computer Science (EECS) CS/ECE Network Security Dr. Attila Altay Yavuz Topic 5 Essential Public Key Crypto Methods.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Public Key Algorithms 4/17/2017 M. Chatterjee.
Slide 1 Vitaly Shmatikov CS 378 Overview of Public-Key Cryptography.
1 Pertemuan 08 Public Key Cryptography Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
ELECTRONIC PAYMENT SYSTEMSFALL 2001COPYRIGHT © 2001 MICHAEL I. SHAMOS Electronic Payment Systems Lecture 6 Epayment Security II.
Public Key Cryptography RSA Diffie Hellman Key Management Based on slides by Dr. Lawrie Brown of the Australian Defence Force Academy, University College,
Slide 1 Vitaly Shmatikov CS 380S Semantic Security.
Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.5 Public Key Algorithms.
ASYMMETRIC CIPHERS.
Cryptography and Network Security Chapter 13
Lecture 6: Public Key Cryptography
0x1A Great Papers in Computer Security
Introduction to 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-.
8. Data Integrity Techniques
Information Security and Management 13. Digital Signatures and Authentication Protocols Chih-Hung Wang Fall
ElGamal Public Key Cryptography CS 303 Alg. Number Theory & Cryptography Jeremy Johnson Taher ElGamal, "A Public-Key Cryptosystem and a Signature Scheme.
Page 1 Secure Communication Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Bob can sign a message using a digital signature generation algorithm
The RSA Algorithm Rocky K. C. Chang, March
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Chapter 10 – Digital Signatures.
Cryptography: RSA & DES Marcia Noel Ken Roe Jaime Buccheri.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
CS 627 Elliptic Curves and Cryptography Paper by: Aleksandar Jurisic, Alfred J. Menezes Published: January 1998 Presented by: Sagar Chivate.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
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.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
4 th lecture.  Message to be encrypted: HELLO  Key: XMCKL H E L L O message 7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message + 23 (X) 12 (M) 2 (C) 10 (K) 11.
Basic Cryptography 1. What is cryptography? Cryptography is a mathematical method of protecting information –Cryptography is part of, but not equal to,
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
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 13 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
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 
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Symmetric Cryptography, Asymmetric Cryptography, and Digital Signatures.
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
Chapter 3 (B) – Key Management; Other Public Key Cryptosystems.
Cryptography 1 Crypto Cryptography 2 Crypto  Cryptology  The art and science of making and breaking “secret codes”  Cryptography  making “secret.
Information Security CS 526
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
Fall, Privacy&Security - Virginia Tech – Computer Science Click to edit Master title style Cryptographic Security Identity-Based Encryption.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Digital Signature Standard (DSS) US Govt approved signature scheme designed by NIST & NSA in early 90's published as FIPS-186 in 1991 revised in 1993,
ECE454/599 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2012.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
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.
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.
Key Exchange in Systems VPN usually has two phases –Handshake protocol: key exchange between parties sets symmetric keys –Traffic protocol: communication.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
@Yuan Xue CS 285 Network Security Public-Key Cryptography Yuan Xue Fall 2012.
CS480 Cryptography and Information Security
Asymmetric-Key Cryptography
Public Key Encryption and Digital Signatures
LAB 3: Digital Signature
Presentation transcript:

slide 1 Vitaly Shmatikov CS 361S Overview of Public-Key Cryptography

slide 2 Reading Assignment uKaufman 6.1-6

slide 3 Public-Key Cryptography ? Given: Everybody knows Bob’s public key - How is this achieved in practice? Only Bob knows the corresponding private key private key Goals: 1. Alice wants to send a message that only Bob can read 2. Bob wants to send a message that only Bob could have written public key Alice Bob

slide 4 Applications of Public-Key Crypto uEncryption for confidentiality Anyone can encrypt a message –With symmetric crypto, must know the secret key to encrypt Only someone who knows the private key can decrypt Secret keys are only stored in one place uDigital signatures for authentication Only someone who knows the private key can sign uSession key establishment Exchange messages to create a secret session key Then switch to symmetric cryptography (why?)

slide 5 Public-Key Encryption uKey generation: computationally easy to generate a pair (public key PK, private key SK) uEncryption: given plaintext M and public key PK, easy to compute ciphertext C=E PK (M) uDecryption: given ciphertext C=E PK (M) and private key SK, easy to compute plaintext M Infeasible to learn anything about M from C without SK Trapdoor function: Decrypt(SK,Encrypt(PK,M))=M

slide 6 Some Number Theory Facts uEuler totient function  (n) where n  1 is the number of integers in the [1,n] interval that are relatively prime to n Two numbers are relatively prime if their greatest common divisor (gcd) is 1 uEuler’s theorem: if a  Z n *, then a  (n)  1 mod n uSpecial case: Fermat’s Little Theorem if p is prime and gcd(a,p)=1, then a p-1  1 mod p

slide 7 RSA Cryptosystem uKey generation: Generate large primes p, q –At least 2048 bits each… need primality testing! Compute n=pq –Note that  (n)=(p-1)(q-1) Choose small e, relatively prime to  (n) –Typically, e=3 (may be vulnerable) or e= =65537 (why?) Compute unique d such that ed  1 mod  (n) Public key = (e,n); private key = d uEncryption of m: c = m e mod n uDecryption of c: c d mod n = (m e ) d mod n = m [Rivest, Shamir, Adleman 1977]

slide 8 Why RSA Decryption Works ue  d  1 mod  (n) uThus e  d = 1+k  (n) = 1+k(p-1)(q-1) for some k uIf gcd(m,p)=1, then by Fermat’s Little Theorem, m p-1  1 mod p uRaise both sides to the power k(q-1) and multiply by m, obtaining m 1+k(p-1)(q-1)  m mod p uThus m ed  m mod p uBy the same argument, m ed  m mod q uSince p and q are distinct primes and p  q=n, m ed  m mod n

slide 9 Why Is RSA Secure? uRSA problem: given c, n=pq, and e such that gcd(e,(p-1)(q-1))=1, find m such that m e =c mod n In other words, recover m from ciphertext c and public key (n,e) by taking e th root of c modulo n There is no known efficient algorithm for doing this uFactoring problem: given positive integer n, find primes p 1, …, p k such that n=p 1 e 1 p 2 e 2 …p k e k uIf factoring is easy, then RSA problem is easy, but may be possible to break RSA without factoring n

“Textbook” RSA Is Bad Encryption uDeterministic Attacker can guess plaintext, compute ciphertext, and compare for equality If messages are from a small set (for example, yes/no), can build a table of corresponding ciphertexts uCan tamper with encrypted messages Take an encrypted auction bid c and submit c(101/100) e mod n instead uDoes not provide semantic security (security against chosen-plaintext attacks) slide 10

slide 11 Integrity in RSA Encryption u“Textbook” RSA does not provide integrity Given encryptions of m 1 and m 2, attacker can create encryption of m 1  m 2 –(m 1 e )  (m 2 e ) mod n  (m 1  m 2 ) e mod n Attacker can convert m into m k without decrypting –(m e ) k mod n  (m k ) e mod n uIn practice, OAEP is used: instead of encrypting M, encrypt M  G(r) ; r  H(M  G(r)) r is random and fresh, G and H are hash functions Resulting encryption is plaintext-aware: infeasible to compute a valid encryption without knowing plaintext –… if hash functions are “good” and RSA problem is hard

slide 12 Digital Signatures: Basic Idea ? Given: Everybody knows Bob’s public key Only Bob knows the corresponding private key private key Goal: Bob sends a “digitally signed” message 1.To compute a signature, must know the private key 2.To verify a signature, only the public key is needed public key AliceBob

slide 13 RSA Signatures uPublic key is (n,e), private key is d uTo sign message m: s = hash(m) d mod n Signing and decryption are the same mathematical operation in RSA uTo verify signature s on message m: s e mod n = (hash(m) d ) e mod n = hash(m) Verification and encryption are the same mathematical operation in RSA uMessage must be hashed and padded (why?)

slide 14 Digital Signature Algorithm (DSA) uU.S. government standard ( ) Modification of the ElGamal signature scheme (1985) uKey generation: Generate large primes p, q such that q divides p-1 –2 159 < q < 2 160, t < p < t where 0  t  8 Select h  Z p * and compute g=h (p-1)/q mod p Select random x such 1  x  q-1, compute y=g x mod p uPublic key: (p, q, g, g x mod p), private key: x uSecurity of DSA requires hardness of discrete log If one can take discrete logarithms, then can extract x (private key) from g x mod p (public key)

slide 15 DSA: Signing a Message Message Hash function (SHA-1) Random secret between 0 and q r = (g k mod p) mod q Private key s = k -1  (H(M)+x  r) mod q (r,s) is the signature on M

slide 16 DSA: Verifying a Signature Message Signature w = s’ -1 mod q Compute (g H(M’)w  y r’w mod q mod p) mod q Public key If they match, signature is valid

slide 17 Why DSA Verification Works uIf (r,s) is a valid signature, then r  (g k mod p ) mod q ; s  k -1  (H(M)+x  r) mod q uThus H(M)  -x  r+k  s mod q uMultiply both sides by w=s -1 mod q uH(M)  w + x  r  w  k mod q uExponentiate g to both sides u(g H(M)  w + x  r  w  g k ) mod p mod q uIn a valid signature, g k mod p mod q = r, g x mod p = y uVerify g H(M)  w  y r  w  r mod p mod q

slide 18 Security of DSA uCan’t create a valid signature without private key uCan’t change or tamper with signed message uIf the same message is signed twice, signatures are different Each signature is based in part on random secret k uSecret k must be different for each signature! If k is leaked or if two messages re-use the same k, attacker can recover secret key x and forge any signature from then on

slide 19 PS3 Epic Fail uSony uses ECDSA algorithm to sign authorized software for Playstation 3 Basically, DSA based on elliptic curves … with the same random value in every signature uTrivial to extract master signing key and sign any homebrew software – perfect “jailbreak” for PS3 uAnnounced by George “Geohot” Hotz and Fail0verflow team in Dec 2010 Q: Why didn’t Sony just revoke the key?

slide 20 Diffie-Hellman Protocol uAlice and Bob never met and share no secrets uPublic info: p and g p is a large prime number, g is a generator of Z p * –Z p *={1, 2 … p-1};  a  Z p *  i such that a=g i mod p AliceBob Pick secret, random XPick secret, random Y g y mod p g x mod p Compute k=(g y ) x =g xy mod p Compute k=(g x ) y =g xy mod p

slide 21 Why Is Diffie-Hellman Secure? uDiscrete Logarithm (DL) problem: given g x mod p, it’s hard to extract x There is no known efficient algorithm for doing this This is not enough for Diffie-Hellman to be secure! uComputational Diffie-Hellman (CDH) problem: given g x and g y, it’s hard to compute g xy mod p … unless you know x or y, in which case it’s easy uDecisional Diffie-Hellman (DDH) problem: given g x and g y, it’s hard to tell the difference between g xy mod p and g r mod p where r is random

slide 22 Properties of Diffie-Hellman uAssuming DDH problem is hard, Diffie-Hellman protocol is a secure key establishment protocol against passive attackers Eavesdropper can’t tell the difference between the established key and a random value Can use the new key for symmetric cryptography uBasic Diffie-Hellman protocol does not provide authentication IPsec combines Diffie-Hellman with signatures, anti-DoS cookies, etc.

slide 23 Advantages of Public-Key Crypto uConfidentiality without shared secrets Very useful in open environments Can use this for key establishment, avoiding the “chicken-or-egg” problem –With symmetric crypto, two parties must share a secret before they can exchange secret messages uAuthentication without shared secrets uEncryption keys are public, but must be sure that Alice’s public key is really her public key This is a hard problem… Often solved using public-key certificates

slide 24 Disadvantages of Public-Key Crypto uCalculations are 2-3 orders of magnitude slower Modular exponentiation is an expensive computation Typical usage: use public-key cryptography to establish a shared secret, then switch to symmetric crypto –SSL, IPsec, most other systems based on public crypto uKeys are longer 2048 bits (RSA) rather than 128 bits (AES) uRelies on unproven number-theoretic assumptions Factoring, RSA problem, discrete logarithm problem, decisional Diffie-Hellman problem…