Outline Review of RSA Discrete logarithms Testing for primality Key management in public-key cryptosystem Diffie-Hellman Key exchange.

Slides:



Advertisements
Similar presentations
Public Key Infrastructure (PKI)
Advertisements

7. Asymmetric encryption-
Session 4 Asymmetric ciphers.
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.
Cryptography1 CPSC 3730 Cryptography Chapter 10 Key Management.
Chap. 8,9: Introduction to number theory and RSA algorithm
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
Cryptography and Network Security Chapter 10 Fourth Edition by William Stallings.
Cryptography & Number Theory
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.
Chapter3 Public-Key Cryptography and Message Authentication.
Dr.Saleem Al_Zoubi1 Cryptography and Network Security Third Edition by William Stallings Public Key Cryptography and RSA.
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.
Cryptography and Network Security Chapter 10. Chapter 10 – Key Management; Other Public Key Cryptosystems No Singhalese, whether man or woman, would venture.
Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.5 Public Key Algorithms.
The RSA Algorithm JooSeok Song Tue.
ASYMMETRIC CIPHERS.
Lecture 6: Public Key Cryptography
Introduction to Public Key Cryptography
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Prime Numbers Prime numbers only have divisors of 1 and self
Cryptography A little number theory Public/private key cryptography –Based on slides of William Stallings and Lawrie Brown.

Network and Communications Network Security Department of Computer Science Virginia Commonwealth University.
J. Wang. Computer Network Security Theory and Practice. Springer 2008 Chapter 3 Public-Key Cryptography and Key Management.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Key Management and Diffie- Hellman Dr. Monther Aldwairi New York Institute of Technology- Amman Campus 12/3/2009 INCS 741: Cryptography 12/3/20091Dr. Monther.
Public Key Cryptography and the RSA Algorithm Cryptography and Network Security by William Stallings Lecture slides by Lawrie Brown Edited by Dick Steflik.
Applied Cryptography (Public Key) RSA. Public Key Cryptography Every Egyptian received two names, which were known respectively as the true name and the.
Information Security Principles & Applications
Information Security -- Part II Public-Key Encryption and Hash Functions Frank Yeong-Sung Lin Information Management Department National Taiwan University.
Private-Key Cryptography  traditional private/secret/single key cryptography uses one key  shared by both sender and receiver  if this key is disclosed.
Cryptography and Network Security (CS435) Part Eight (Key Management)
Cryptography and Network Security Chapter 10 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
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.
Computer and Network Security Rabie A. Ramadan Lecture 6.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
Chapter 3 (B) – Key Management; Other Public Key Cryptosystems.
Cryptography and Network Security Key Management and Other Public Key Cryptosystems.
PUBLIC KEY CRYPTOGRAPHY ALGORITHM Concept and Example 1IT352 | Network Security |Najwa AlGhamdi.
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.
Information Security -- Part II Public-Key Encryption and Hash Functions Frank Yeong-Sung Lin Information Management Department National Taiwan University.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
1 Chapter 10: Key Management in Public key cryptosystems Fourth Edition by William Stallings Lecture slides by Lawrie Brown (Modified by Prof. M. Singhal,
Fall 2002CS 395: Computer Security1 Chapter 9: Public Key Cryptography.
Key Management Network Systems Security Mort Anvari.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Introduction to Number Theory Department of Computer Engineering Sharif University of Technology 3/8/2006.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Lecture 9 Overview. Digital Signature Properties CS 450/650 Lecture 9: Digital Signatures 2 Unforgeable: Only the signer can produce his/her signature.
Cryptography and Network Security Chapter 10 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
Great Theoretical Ideas in Computer Science.
Diffie-Hellman Key Exchange first public-key type scheme proposed by Diffie & Hellman in 1976 along with the exposition of public key concepts – note:
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.
Key Management public-key encryption helps address key distribution problems have two aspects of this: – distribution of public keys – use of public-key.
Information Security Lab. Dept. of Computer Engineering 251/ 278 PART II Asymmetric Ciphers Key Management; Other CHAPTER 10 Key Management; Other Public.
Private-Key Cryptography
ICS 353: Design and Analysis of Algorithms
Key Management Network Systems Security
Presentation transcript:

Outline Review of RSA Discrete logarithms Testing for primality Key management in public-key cryptosystem Diffie-Hellman Key exchange

Revisit proof of RSA If (a×b) ≡ (a×c) mod n then b ≡ c mod n True if a is relatively prime to n Suppose b > c ab – ac = kn a(b-c) = kn   b-c = kn a b-c = qn gcd(a,n)=1 Ex. 2x1 mod 8 = 2 2x5 mod 8 = 2 1 ≡ 5 mod 8

Proof of Fermat ’ s law Recall: p is a prime, Z p is a Galois Field Any a multiplied by {1,2,…,p-1} will span {1,2, …,p-1} in some order {a mod p, 2a mod p,…, (p-1)a mod p} 等於 {1,2,…,p-1} 的重排 1 左邊集合內元素都與 p 互質 2 ax ≡ ay mod p => x ≡ y mod p  左邊集合內的元素都不同

Proof for Euler ’ s theorem a ø(n) ≡ 1 mod n, gcd(a,n)=1 n is a prime => Fermat ’ s theorem Arbitrary n: ø(n) means the number of integers that is relatively prime to n, denote the set of integers as Multiply each by a, modulo n: S is a permutation of R !!! * a is relatively prime to n, and x i is relative prime to n => so does ax i * There is no duplicate in S

RSA concept n=pq, p and q are primes pq-2 pq-1 a a  n) Euler’s formula: a2a2 a3a3 a  n) a  n) … a 3. a  n) … a a aeae a k  n)+1 (a e ) d

RSA algorithm : key generation and encryption/decryption 1. Select primes p and q (p  q). 2. Calculate n=pq. 3. Calculate  (n)=(p-1)(q-1) 4. Select e that is relative prime to and less than  (n) 5. Determine d such that de ≡ 1 mod  (n), and d<  (n) (d is the multiplicative inverse of e, find it using Extended Euclid ’ s algorithm) Example: p=17, q=11 n= 17x11 = 187  (n)= 16x10 = 160 e = 7 d = 23

RSA encryption/decryption example Public key: KU={e,n}={7,187} Private key: KR={d,n}={23,187}

Computational issues in RSA Select primes p and q (p  q) How to select a large prime? (Chap. 8.3) Calculate d such that d ≡ e -1 mod  (n) How to compute multiplicative inverse? => Extended Euclid ’ s algorithm (Chap. 4.4) Encryption: M = C d mod n How to compute exponentiation fast?

Computation issues – encryption/decryption Modular exponentiation: Fast algorithm use the property: Write exponential d as binary number: b k b k-1 …b 1 b 0 ex = = M = C d mod n (a x b) mod n = (a mod n) x (b mod n) mod n mod 187 =(11 16 ×11 4 ×11 2 ×11 1 ) mod 187 =[(11 16 mod 187)×(11 4 mod 187)×(11 2 mod 187)×(11 1 mod 187)] mod 187 =…=88

Pseudo-code for fast exponentiation: a b mod n c=0; /* c will be the exponent at last */ d=1; /* d will be the a b mod n at last */ for(i=k; i>=0; i--){ /* k+1 bits for b */ c = 2*c; d = (d*d) mod n; if ( b i == 1 ){ c = c+1; d = (d*a) mod n } Timing attacks If this bit is 1, exec. time will be slower

Resist to timing attacks Constant exponentiation time return the results of exponentiation after a fixed time Random delay Add random delay to the exp. execution time Blinding Multiply ciphertext by a random number

Outline Review of RSA Discrete logarithms Testing for primality Key management in public-key cryptosystem Diffie-Hellman Key exchange

The power of an integer, modulo n Euler ’ s formula (1): a ø(n) ≡ 1 mod n, gcd(a,n)=1 General form (2): a m ≡ 1 mod n, gcd(a,n)=1 There is at least one m (m  n)) satisfies (2) For any 0<a<n, the least positive m satisfies (2) is referred as The order of a (mod n) The exponent to which a belongs (mod n) The length of the period generated by a

Example: modulo 19 Euler’s formula period = 9 period = 3 4 ? ≡ 17 mod 19 Primitive root of 19: 1.period = 18 2.Span {1,…,18}

Discrete logarithms For real numbers: y = x r For prime integer p, and its primitive root a There is a unique i such that => log x y = r b ≡ a i mod p where 0 ≤ i ≤ (p-1) Given b, a, and p, we can find a unique i => ind a,p (b) = i Unique discrete logarithm mod m to some base a exist only if a is a primitive root of m

Example: discrete log, mod 19

Calculation of discrete log Equation: b = a i mod p Calculation of power is straightforward Calculation of discrete log (if exists) is hard !!! => The same complexity of factoring primes Not feasible for large primes

Outline Review of RSA Discrete logarithms Testing for primality Key management in public-key cryptosystem Diffie-Hellman Key exchange

How to select a large prime? In RSA, we have to select two primes p and q (p  q) select e or d (that is relatively prime to  (n)) p, q, e, d must be sufficiently large to avoid exhaustive search attack However, no useful method to generate arbitrarily large primes Sol: pick at random an odd number of the desired order of magnitude, and test whether it is a prime

Test for primality Miller-Rabin algorithm: decide whether a number is a prime with a bounded error probability Given an odd integer n for test Factor (n-1) as Choose an integer a, 1<a<n-1 Ex. n = 29 n-1 = 2 k q, k > 0, q odd 28 = 2 2 (7) Recall Fermat’s theorem: a n-1 ≡ 1 mod n if n is a prime a = 10 generate a q,a 2q, …,a 2 q,a 2 q mod n k-1 k 10 7,10 2x7,10 4x7 mod 29 =17, 28, 1 See next page

Test for primality (cont.) For a given integer a generate a q,a 2q, …,a 2 q,a 2 q mod n k-1 k … square If n is a prime, a 2 q =a n-1 ≡ 1 mod n k However, we don’t have to test until a 2 q k If this number a q mod n = 1 or -1 Then (a q ) 2 mod n = 1 (a q ) 4 mod n = 1 … (a q ) 2 mod n = 1 k If this number a 2q mod n = -1=(n-1) Then (a q ) 2 mod n = 1 k

Repeated use of Miller-Rabin Algorithm Fermat ’ s theorem: a n-1 ≡ 1 mod n, for all 0<a<n, if n is a prime It has been shown that, for one random chosen integer a, the probability of false positive is less than 1/4 Run M-R test 2 times with different a => Prob = (1/4) 2 (n 非質數,但是偵測為質數 ) Run M-R test t times with different a => Prob = (1/4) t

How many integers to test to find a prime? Prime number theory: the primes near n are spaced on the average one every ln (n) integers Discard even integers, and ending with digit 5 => test about 0.4ln (n) numbers Ex. prime on the order of magnitude of (200 bits) => 0.4ln (2 200 ) = 55 trails to find a prime 1n no. of primes n = ln (n) Density of prime?

How to generate public/private keys? Q: select e or d that is relatively prime to  (n)? A: Extended Euclid’s algorithm Test gcd(e,  (n)) = 1? Calculate the multiplicative inverse at the same time if they are relatively prime Procedure: Generate a series of random numbers, test each against  (n) How many random numbers to test? The prob. that two random numbers are relatively prime is about 0.6 (problem 8.1)

Outline Review of RSA Discrete logarithms Testing for primality Key management in public-key cryptosystem Diffie-Hellman Key exchange

Key management (Ch 10.1) Two issues for public-key cryptosystem Distribution of public keys The use of public-key encryption to distribute secret keys (keys for symm. cipher) Distribution of public keys Public announcement Public available directory Public-key authority Public-key certificates

1. Public announcement Drawback: the opponent can pretend to be another user Ex. post public keys to public forums, such as USENET newsgroup and Internet mailing list

2. Public available directory Some trusted entity maintains a publicly available dynamic directory of public keys Register the public key Register the public key {A, KU a } {B, KU b } … Attack: an opponent invades the public-key directory, and counterfeit public keys

3. Public-key authority Central authority: 1. Maintain directory of public keys 2. Each participant knows the public key for the authority A can confirm the message from the authority N 1 : 認證 B 的身份 N 2 : 認證 A 的身份

4. Public-key certificates 憑證 Certificate: contain public key and other information, generate from the certificate authority Application must be in person or by secure channel 1. Anyone can read, verify 2. Only CA can create Time: verify currency of certificate

Simple secret key distribution Public-key scheme has slow data rate  use public key to distribute secret key  use secret key scheme for data encryption session key (secret key) E KU e || ID A intercept KU e [ K s ] E KU a [ K s ] KsKs

Secret key distribution with confidentiality and authentication Against active and passive attacks Authenticate B Authenticate A Confidentiality (only B can read) authentication (only A can create it)

A hybrid and hierarchical scheme KDC A B C Use public-key scheme to distribute master key MK A MK B Use master keys with KDC to distribute session key KsKs KsKs Advantage: 1.Use master key to distribute session keys, instead of using public-key scheme => faster ! 2.Backward compatible to old KDC scheme (master + session key)

Outline Review of RSA Discrete logarithms Testing for primality Key management in public-key cryptosystem Diffie-Hellman Key exchange

Diffie-Hellman key exchange Purpose: enable two users to exchange a key securely that can then be used for subsequent encryption of message Diffie-Hellman algorithm: take advantage of the hard problem – discrete logarithm AB Setup up a secret key K The issue of distribution of secret keys

Protocol of D-H key exchange Public: q,   q is a prime;  q, is a primitive root of q) Discrete log ?

Verify D-H algorithm Both users get the same secret key K User A gets: Eq: User B gets: the same

Other issues about D-H Brute-force attack: Ex. 3 a mod 353 = 40 Try all 3 x mod 353, 0<x<353, until it equal 40 Use D-H algorithm as public-key system KDC {User, Public Key} {A, Y A  X  } A {B, Y B  X  } B AB YBYB E [Message] K