Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.5 Public Key Algorithms.

Slides:



Advertisements
Similar presentations
Public Key Cryptography Nick Feamster CS 6262 Spring 2009.
Advertisements

Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Computer Science CSC 405By Dr. Peng Ning1 CSC 405 Introduction to Computer Security Topic 2. Basic Cryptography (Part II)
Public Key Algorithms …….. RAIT M. Chatterjee.
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.
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Cryptography.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
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
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
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.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
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.
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.
ELECTRONIC PAYMENT SYSTEMSFALL 2001COPYRIGHT © 2001 MICHAEL I. SHAMOS Electronic Payment Systems Lecture 6 Epayment Security II.
Chapter 9 – Public Key Cryptography and RSA Private-Key Cryptography  traditional private/secret/single key cryptography uses one key  shared by both.
Public Key Cryptography RSA Diffie Hellman Key Management Based on slides by Dr. Lawrie Brown of the Australian Defence Force Academy, University College,
Cryptography and Network Security Chapter 9 5th Edition by William Stallings Lecture slides by Lawrie Brown.
CSE 597E Fall 2001 PennState University1 Digital Signature Schemes Presented By: Munaiza Matin.
Lecture 6: Public Key Cryptography
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.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
Information Security and Management 13. Digital Signatures and Authentication Protocols Chih-Hung Wang Fall
CS5204 – Fall Cryptographic Security Presenter: Hamid Al-Hamadi October 13, 2009.
1 Public-Key Cryptography and Message Authentication Ola Flygt Växjö University, Sweden
The RSA Algorithm Rocky K. C. Chang, March
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Network and Communications Network Security Department of Computer Science Virginia Commonwealth University.
Applied Cryptography (Public Key) RSA. Public Key Cryptography Every Egyptian received two names, which were known respectively as the true name and the.
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.
BASIC CRYPTOGRAPHIC CONCEPTS. Public Key Cryptography  Uses two keys for every simplex logical communication link.  Public key  Private key  The use.
Chapter 21 Public-Key Cryptography and Message Authentication.
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
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
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
Cryptography 1 Crypto Cryptography 2 Crypto  Cryptology  The art and science of making and breaking “secret codes”  Cryptography  making “secret.
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.
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.
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.
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
1 Introduction to Computer Security Topic 2. Basic Cryptography (Part II)
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
Diffie-Hellman Key Exchange first public-key type scheme proposed by Diffie & Hellman in 1976 along with the exposition of public key concepts – note:
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.
ECE454/599 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2012.
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.
Public Key Cryptography
Essential Public Key Crypto Methods Credit: Prof. Dr. Peng Ning
Presentation transcript:

Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.5 Public Key Algorithms

Computer Science CSC 474Dr. Peng Ning2 Public Key Algorithms Public key algorithms covered in this class –RSA: encryption and digital signature –Diffie-Hellman: key exchange –DSA: digital signature Number theory underlies most of public key algorithms.

Computer Science CSC 474Dr. Peng Ning3 Use of Public-Key Cryptosystems Encryption/decryption –The sender encrypts a message with the receiver’s public key –Only the receiver can decrypt the message. Digital signature –The sender signs a message with its private key. –Authentication and non-repudiation Key exchange –Two sides cooperate to exchange a session key. –Secret key cryptosystems are often used with the session key.

Computer Science CSC 474Dr. Peng Ning4 Requirements for Public-Key Algorithms It is computationally easy to generate a pair of public key and private key. It is computationally easy to generate a ciphertext using the public key. It is computationally easy to decrypt the ciphertext using the private key. It is computationally infeasible to determine the private key from the public key. It is computationally infeasible to recover the message from the ciphertext and the public key.

Computer Science CSC 474Dr. Peng Ning5 Trapdoor One-Way Function Essential requirement: Trapdoor one-way function. One-way function f –One-to-one mapping –Y=f(X): easy –X=f  1 (Y): infeasible Trapdoor one-way function –One-to-one mapping –Y=f k (X): easy if k and X are known –X=f  1 k (Y): easy if k and Y are known – X=f  1 k (Y): infeasible if Y is known but k is unknown. Designing public-key algorithm is to find appropriate trapdoor one-way function.

Computer Science CSC 474Dr. Peng Ning6 Public-Key Cryptanalysis Brute-force attack –Try all possible keys Derivation of private key from public key –Try to find the relationship between the public key and the private key and compute the private key from the public one. Probable-message attack –The public key is known. –Encrypt all possible messages –Try to find a match between the ciphertext and one of the above encrypted messages.

Computer Science CSC 474Dr. Peng Ning7 RSA (Rivest, Shamir, Adleman) The most popular one. Support both public key encryption and digital signature. Assumption/theoretical basis: –Factorization of large primes is hard. Variable key length (usually 1024 bits). Variable plaintext block size. –Plaintext must be “smaller” than the key. –Ciphertext block size is the same as the key length.

Computer Science CSC 474Dr. Peng Ning8 RSA Algorithm To generate key pair: –Pick large primes p and q –Let n = p*q, keep p and q to yourself! –For public key, choose e that is relatively prime to ø(n) =(p-1)(q-1), let pub = –For private key, find d that is the multiplicative inverse of e mod ø(n), i.e., e*d = 1 mod ø(n), let pri =.

Computer Science CSC 474Dr. Peng Ning9 How Does RSA Work? Given pub = and priv = –encryption: c = m e mod n, m < n –decryption: m = c d mod n –signature: s = m d mod n, m < n –verification: m = s e mod n

Computer Science CSC 474Dr. Peng Ning10 An Example Choose p = 7 and q = 17. Compute n = p*q=____. Compute  (n)=(p-1)(q-1)=____. Select e = 5, which is relatively prime to  (n). Compute d = _77_such that e*d=1 mod  (n). Public key: Private key: Encryption: 19 5 mod 119 = 66 Decryption: mod 119 = 19.

Computer Science CSC 474Dr. Peng Ning11 Why Does RSA Work? Given pub = and priv = –n =p*q, ø(n) =(p-1)(q-1) –E*d = 1 mod ø(n) –x e*d = x mod n –encryption: c = m e mod n –decryption: m = c d mod n = m e*d mod n = m mod n = m (since m < n) –digital signature (similar)

Computer Science CSC 474Dr. Peng Ning12 The Security of RSA Attacks against RSA –Brute force: Try all possible private keys Can be defeated by using a large key space –Mathematical attacks Factor n into n=p*q. Determine ø(n) directly: equivalent to factoring n. Determine d directly: at least as difficult as factoring n. –Timing attacks Recover the private key according to the running time of the decryption algorithm.

Computer Science CSC 474Dr. Peng Ning13 The Security of RSA (Cont’d) Factoring large integer is very hard! But if you can factor big number n then given public key, you can find d, and hence the private key by: –Knowing factors p, q, such that, n = p*q –Then ø(n) =(p-1)(q-1) –Then d such that e*d = 1 mod ø(n) Ways to make n difficult to factor –p and q should differ in length by only a few digits –Both (p-1) and (q-1) should contain a large prime factor –gcd(p-1, q-1) should be small. –d > n 1/4.

Computer Science CSC 474Dr. Peng Ning14 The Security of RSA (Cont’d) Timing attacks –Determine the private key by observing how long a computer takes to decipher messages. –The attack proceeds bit by bit. –The attacker is able to determine bit j because for some d and a, the marked step is extremely slow Algorithm for computing a b mod n. d  1 For i  k downto 0 d  d*d mod n If b i = 1 Then d  d*a mod n Return d.

Computer Science CSC 474Dr. Peng Ning15 The Security of RSA (Cont’d) Countermeasures against the timing attack –Constant exponentiation time Don’t return the result if the computation is too fast. Hurt the performance. –Random delay Confuse the timing attack by adding a random delay. The attacker may be able to defeat random delay if the delay is not added carefully. –Blinding Multiply the ciphertext by a random number before performing exponentiation.

Computer Science CSC 474Dr. Peng Ning16 The Security of RSA (Cont’d) RSA Data Security’s blinding algorithm –Generate a random number r between 0 and n–1 such that gcd(r, n) = 1. –Compute C’=C * r e mod n –Compute M’ = (C’) d mod n –Compute M=M’*r –1 mod n. –Performance penalty: 2 – 10%.

Computer Science CSC 474Dr. Peng Ning17 Diffie-Hellman Key Exchange Shared key, public communication No authentication of partners What’s involved? –p is a large prime number (about 512 bits), g < p and g is a primitive root of p. –p and g are publicly known

Computer Science CSC 474Dr. Peng Ning18 Diffie-Hellman Key Exchange Procedure AliceBob pick secret S a randomly pick secret S b randomly compute T A =g Sa mod p compute T B =g Sb mod p send T A to Bob send T B to Alice compute T B Sa mod p compute T A Sb mod p Alice and Bob reached the same secret g SaSb mod p, which is then used as the shared key.

Computer Science CSC 474Dr. Peng Ning19 DH Security - Discrete Logarithm Is Hard T = g s mod p Given T, g, p, it is computationally infeasible to compute the value of s (discrete logarithm)

Computer Science CSC 474Dr. Peng Ning20 Diffie-Hellman Scheme Security factors –Discrete logarithm is very difficult. –Shared key (the secret) itself never transmitted. Disadvantages: –Expensive exponential operation DoS possible. –Cannot be used to encrypt anything. –No authentication, so you can not sign anything…

Computer Science CSC 474Dr. Peng Ning21 Man-In-The-Middle Attack AliceMr. XBob g Sa =123 g Sx =654 g Sb =  654   654  Sa =123 Sx 255 Sx =654 Sb Mr. X plays Bob to Alice and Alice to Bob

Computer Science CSC 474Dr. Peng Ning22 Diffie-Hellman in Phone Book Mode DH is subject to active man-in-the-middle attack because their public key-component may be intercepted and substituted Phone book mode allows everyone to generate the public key-component in advance and publish them through other reliable means, e.g. for Bob All communicating parties agree on their common Essential requirement: authenticity of the public key.

Computer Science CSC 474Dr. Peng Ning23 Encryption With Diffie-Hellman Everyone computes and publishes –T=g S mod p Alice communicates with Bob: –Alice Picks a random secret S a Computes g b Sa mod p b Use K ab = T b Sa mod p b to encrypt message Send encrypted message along with g b Sa mod p b –Bob (g b Sa ) Sb mod p b = (g b Sb ) Sa mod p b = T b Sa mod p b = K ab Use K ab to decrypt Essentially key distribution + encryption

Computer Science CSC 474Dr. Peng Ning24 Digital Signature Standard (DSS) By NIST Related to El Gamal Use SHA (SHA-1) to generate the hash value and Digital Signature Algorithm (DSA) to generate the digital signature. Speeded up for signer rather than verifier: smart cards

Computer Science CSC 474Dr. Peng Ning25 Digital Signature Algorithm (DSA) Generate public parameters –p (512 to 1024 bit prime) –q (160 bit prime): q|p  1 –g = h (p  1)/q mod p, where 1 1. –g is of order q mod p. User’s private key x –Random integer with 0 < x < q User’s public key y –y = g x mod p User’s per message secret number –k = random integer with 0 < k < q.

Computer Science CSC 474Dr. Peng Ning26 DSA (Cont’d) Signing –r = (g k mod p) mod q –s = [k  1 (H(M)+xr)] mod q –Signature = (r, s) Verifying –M’, r’, s’ = received versions of M, r, s. –w = (s’)  1 mod q –u 1 = [H(M’)w] mod q –u 2 = (r’)w mod q –v = [(g u1 y u2 ) mod p] mod q –if v = r’ then the signature is verified

Computer Science CSC 474Dr. Peng Ning27 Why Is DSA Secure No revealing of private key x Can’t forge a signature without x No duplicate messages with matched signature Need a per-message secret number k –If k is known, the private key x can be computed –Two messages sharing the same k can reveal the private key x