刘振 上海交通大学 计算机科学与工程系 电信群楼3-509

Slides:



Advertisements
Similar presentations
Public Key Cryptography INFSCI 1075: Network Security – Spring 2013 Amir Masoumzadeh.
Advertisements

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.
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.
CSCI 172/283 Fall 2010 Public Key Cryptography. New paradigm introduced by Diffie and Hellman The mailbox analogy: Bob has a locked mailbox Alice can.
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-.
Andreas Steffen, , 4-PublicKey.pptx 1 Internet Security 1 (IntSi1) Prof. Dr. Andreas Steffen Institute for Internet Technologies and Applications.
Page 1 Secure Communication Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Great Theoretical Ideas in Computer Science.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Private-Key Cryptography  traditional private/secret/single key cryptography uses one key  shared by both sender and receiver  if this key is disclosed.
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.
Computer and Network Security Rabie A. Ramadan Lecture 6.
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 
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
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.
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.
1 Diffie-Hellman (Key Exchange) Protocol Rocky K. C. Chang 9 February 2007.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Overview Modern public-key cryptosystems: RSA
Public Key Cryptography
최신정보보호기술 경일대학교 사이버보안학과 김 현성.
CS480 Cryptography and Information Security
Public Key Encryption Major topics The RSA scheme was devised in 1978
Asymmetric-Key Cryptography
Asymmetric-Key Cryptography
RSA Slides by Kent Seamons and Tim van der Horst
Public Key Encryption and Digital Signatures
Information Security CS 526
RSA and El Gamal Cryptosystems
Public-key Cryptography
IEEE TRANSACTIONS ON INFORMATION THEORY, JULY 1985
Private-Key Cryptography
Topic 25: Discrete LOG, DDH + Attacks on Plain RSA
Real-world Security of Public Key Crypto
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Asymmetric Cryptography
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Symmetric-Key Cryptography
Information Security CS 526
Public Key Cryptography
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Key Management Network Systems Security
Diffie-Hellman key exchange/agreement algorithm
Introduction to Elliptic Curve Cryptography
Public-Key, Digital Signatures, Management, Security
Chapter -5 PUBLIC-KEY CRYPTOGRAPHY AND RSA
CSCE 715: Network Systems Security
Symmetric-Key Cryptography
Introduction to Cryptography
Oblivious Transfer.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
The RSA Public-Key Encryption Algorithm
Lecture 6.2: Protocols - Authentication and Key Exchange II
Presentation transcript:

刘振 上海交通大学 计算机科学与工程系 电信群楼3-509 liuzhen@sjtu.edu.cn 网络安全技术 刘振 上海交通大学 计算机科学与工程系 电信群楼3-509 liuzhen@sjtu.edu.cn

Public Key Cryptography: Encryption

Symmetric Key Management Each pair of communicating entities needs a shared key For an n-party system, there are n(n-1)/2 distinct keys in the system and each party needs to maintain n-1 distinct keys. How to reduce the number of shared keys in the system Centralized key management Public keys How to set up shared keys K1 K4 K2 K3 K5 K6 K8 K7 K9 K10

Centralized Key Management Online Key Distribution Server K2 K1 session key Alice Bob Only n long-term secret keys, instead of n(n-1)/2 in the system. Each user shares one long-term secret key with the Server. The Server may become the single-point-of-failure and the performance bottleneck. Secret keys are used only for the secure delivery of session keys. Real data are encrypted under session keys.

Public key Encryption Receiver Bob has a key pair: public and private publish the public key such that the key is publicly known Bob keeps the private key secret Other people use Bob’s public key to encrypt messages for Bob Bob uses his private key to decrypt K Encrypted Session Key K Encrypt Decrypt Bob’s public key Alice Bob Public key directory Bob’s private key Security requirement 1: difficult to find private key or plaintext from ciphertext Security requirement 2: difficult to find private key from public key

Motivation of Public Key Cryptography (Summary) One problem with symmetric key algorithms is that the sender needs a secure method for telling the receiver about the encryption key. Plus, you need a separate key for everyone you might communicate with (scalability issue). Public key algorithms use a public-key and private-key pair to tackle the two problems Each receiver has a public key pair. The public key is publicly known (published). A sender uses the receiver’s public key to encrypt a message. Only the receiver can decrypt it with the corresponding private key.

Rivest, Shamir, and Adleman (RSA) Randomly choose two large and roughly equal-length prime numbers, p and q. E.g. |p| = |q| = 512 bits Sets n = pq (n is called the public modulus) Randomly choose e such that gcd(e, (n)) = 1. e is called the public exponent. (n) = (pq) = (p-1)(q-1) Compute d such that de  1 (mod (n)). In other words, d is the modular inverse of e modular (n). d is called the private exponent. Public Key: PK = (n, e), Private Key: SK = d Encryption: C = Me mod n Decryption: M = Cd mod n

An Example of RSA Encryption and Decryption Choose two primes p=47 and q=71  n = pq = 3337. Choose e such that it is relatively prime to (n) = 46x70 = 3220. e.g. e = 79. Compute d = e-1 mod (n) using extended Euclidean algorithm. d  79-1 (mod 3220) = 1019 Public key PK = (n, e) = (3337,79) Private key SK = d = 1019 Encrypt M = 688  68879 mod 3337 = 1570 Decrypt C = 1570  15701019 mod 3337 = 688

Security of RSA RSA Problem (RSAP) : Given a positive integer n that is a product of two distinct equal-length primes p and q, a positive integer e such that gcd(e, (p-1)(q-1)) = 1, and an integer c chosen randomly from Zn* find an integer m such that me  c (mod n). Note: p and q are not given. The intractability of the RSAP forms the basis for the security of the RSA public-key cryptosystem. RSAP is closely related to the Factorization Problem but not known to be equivalent. Factorization Problem (FACTORING) : Given a positive integer n, find its prime factorization; that is, write n = p1e1 p2e2… pkek where the pi are primes and each ei  1. E.g. 72 = 23 ∙ 32 The value of the RSA public exponent e can be small, say 16 bits long, but the value of d should be large, say at least 1000 bits long.

RSAP and FACTORING RSAP P FACTORING : The RSA problem can efficiently be reduced to the factorization problem. If one can solve FACTORING, then one can solve RSAP. Open Problem : Is FACTORING P RSAP? It is widely believed that it is true, although no proof of this is known.

More about RSA Security Strength Public Key Encryption More about RSA Security Strength The strength of the RSA algorithm depends on the difficulty of doing prime factorization of large numbers: Knowing the public key <e, n>, if the cryptanalyst could factor n = pq, then (n) (= (p - 1)(q - 1)) is obtained Knowing e and (n), d can be obtained with a known algorithm (Euclid’s algorithm) for finding multiplicative inverse (de = 1 mod (n)) To break an RSA encryption (i.e., finding the decryption key) by brute force (i.e., by trying all possible keys) is not feasible given the relative large size of the keys A better approach is to solve the prime factorization problem. The best known factorization algorithms seem to indicate that the number of operations to factorize a number n is estimated by The number of operations for factorizing can be tightened to: exp((ln n)1/3(ln ln n)2/3)) With the best efficient factorization algorithms. CS5285 Sem B 2006/07 ©2007 C H Lee

More about RSA Security Strength Public Key Encryption More about RSA Security Strength Key size Approximate effort Using 1,000,000 mips (bits) (mips-year) (years) 320 1 .5 min (very weak) 430 4  103 1.5 days (weak) 512 3  105 13 days 768 7  108 710 (medium) 1024 8  1011 8  105 (medium-strong) 2048 8  1021 8  1012 (strong) Assume using currently best known factoring algorithms to find RSA decryption key given the encryption key. The number to factorize is estimated as n  2keysize This assumes the factorization algorithm based on number field sieve and estimating the number of operations required: exp([(ln n)**(1/3)][ln(ln n)]) CS5285 Sem B 2006/07 ©2007 C H Lee

ElGamal Encryption Scheme Let p be a large prime. Let Zp* = { 1, 2, 3, …, p-1 } Let Zp-1 = { 0, 1, 2, …, p-2 } a R S means that a is randomly chosen from the set S Let g  Zp* such that none of g1 mod p, g2 mod p, …, gp-2 mod p is equal to 1. Public Key Pair: Private key: x R Zp-1 Public key: y = gx mod p Encryption: r R Zp-1 A = gr mod p B = Myr mod p where M  Zp* is the message. Ciphertext C = (A, B). Decryption: K = Ax mod p M = B K-1 mod p

An Example of ElGamal Encryption and Decryption Let p =2357 g = 2 Private key: x = 1751 Public key: y = gx = 21751 = 1185 (mod 2357) Encryption: say M = 2035 Pick a random number r = 1520 Computes A = gr  21520  1430 (mod 2357) B = Myr  2035 x 11851520  697 (mod 2357) The ciphertext C = (A, B) = (1430, 697) Decryption: Computes K  Ax  14301751  2084 (mod 2357) M  B K-1  697 x 2084-1  2035 (mod 2357)

Security of ElGamal Encryption Scheme r R Zp-1 A = gr mod p B = Myr mod p where M  Zp* is the message. Ciphertext C = (A, B). Given C = (A, B) and public key y = gx mod p, find M without knowing x. If adversary can get r from A=gr mod p, then the scheme is broken. If adversary can get x from y=gx mod p, then the scheme is broken. From A=gr mod p and y=gx mod p, if adversary can compute grx mod p, then the scheme is broken. First two correspond to DLP (Discrete Logarithm Problem) The last one corresponds to Diffie-Hellman Problem

Discrete Logarithm Problem (DLP) Let p be a prime number. Given two integers: g, y g and y are integers chosen randomly in Zp*. Find a such that ga mod p = y a is called the discrete log of y to the base g mod p. DLP (Discrete Log Problem) Given a, g and p, compute y  ga mod p is EASY However, given y, g and p, compute a is HARD Factoring (revisit) Given p and q, compute n = pq is EASY However, given n, compute the prime factors p and q is HARD DLP Example: For p=97, g = 5 and y= 35, compute a such that ga mod p = 35. We need to try all possibilities (from 1 to 96) to obtain such a When p is large, DLP is hard In practice, p should at least be 1024 bits long. Practical problems (not to be discussed in this course): How to generate and verify such a large prime number p? How to generate g?

Diffie-Hellman Problem Given A=gx mod p and B=gy mod p, find C=gxy mod p. If DLP can be solved, then Diffie-Hellman Problem can be solved. Open Problem: If Diffie-Hellman Problem can be solved, can DLP be solved?

Diffie-Hellman Key Exchange ga mod p gb mod p Alice, a Bob, b Alice computes (gb)a = gba = gab mod p Bob computes (ga)b = gab mod p Could use K = gab mod p as symmetric key This key exchange scheme is secure against eavesdroppers if Diffie-Hellman Problem is assumed to be hard to solve. However, it is insecure if the attacker in the network is active: man-in-the-middle attack. “Active” means that the attacker can intercept, modify, remove or insert messages into the network.

Man-in-the-Middle Attack (MITM) ga mod p gt mod p gt mod p gb mod p Alice, a Trudy, t Bob, b Trudy shares secret gat mod p with Alice Trudy shares secret gbt mod p with Bob Alice and Bob don’t know Trudy exists!

Public key vs. Symmetric key Two parties MUST trust each other Two parties DO NOT need to trust each other Both share the same key (or one key is computable from the other) Two separate keys: a public and a private key Attack approach: bruteforce Attack approach: solving mathematical problems (e.g. factorization, discrete log problem) Faster Slower (100-1000 times slower) Smaller key size Larger key size Examples: DES, 3DES, DESX, RC6, AES, … Examples: RSA, ElGamal, ECC,…

Summary PKE Concept RSA Encryption ElGamal Encryption DH Key Exchange RSA Assumption Factoring Assumption ElGamal Encryption DL Assumption DH Assumption DH Key Exchange MITM Attack