CIS 5371 Cryptography. 8. Encryption --



Similar documents
Overview of Public-Key Cryptography

Elements of Applied Cryptography Public key encryption

Lecture Note 5 PUBLIC-KEY CRYPTOGRAPHY. Sourav Mukhopadhyay

Advanced Cryptography

Digital Signatures. Prof. Zeph Grunschlag

Public Key Cryptography: RSA and Lots of Number Theory

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives

CSCE 465 Computer & Network Security

1 Digital Signatures. 1.1 The RSA Function: The eth Power Map on Z n. Crypto: Primitives and Protocols Lecture 6.

Cryptography and Network Security

Secure Network Communication Part II II Public Key Cryptography. Public Key Cryptography

Lecture 3: One-Way Encryption, RSA Example

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

Cryptography and Network Security Chapter 9

The application of prime numbers to RSA encryption

RSA Attacks. By Abdulaziz Alrasheed and Fatima

Public Key Cryptography. c Eli Biham - March 30, Public Key Cryptography

Introduction. Digital Signature

Outline. Computer Science 418. Digital Signatures: Observations. Digital Signatures: Definition. Definition 1 (Digital signature) Digital Signatures

CS 758: Cryptography / Network Security

A Factoring and Discrete Logarithm based Cryptosystem

On Factoring Integers and Evaluating Discrete Logarithms

QUANTUM COMPUTERS AND CRYPTOGRAPHY. Mark Zhandry Stanford University

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

The Mathematics of the RSA Public-Key Cryptosystem

Cryptography and Network Security Chapter 10

Network Security. Computer Networking Lecture 08. March 19, HKU SPACE Community College. HKU SPACE CC CN Lecture 08 1/23

Table of Contents. Bibliografische Informationen digitalisiert durch

Lecture 6 - Cryptography

Public Key (asymmetric) Cryptography

Notes on Network Security Prof. Hemant K. Soni

Mathematics of Internet Security. Keeping Eve The Eavesdropper Away From Your Credit Card Information

SECURITY IMPROVMENTS TO THE DIFFIE-HELLMAN SCHEMES

Module: Applied Cryptography. Professor Patrick McDaniel Fall CSE543 - Introduction to Computer and Network Security

Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 12 Digital Signatures

SFWR ENG 4C03 - Computer Networks & Computer Security

Software Tool for Implementing RSA Algorithm

Applied Cryptography Public Key Algorithms

Lecture 13: Factoring Integers

Cryptographic hash functions and MACs Solved Exercises for Cryptographic Hash Functions and MACs

Basic Algorithms In Computer Algebra

Public Key Cryptography and RSA. Review: Number Theory Basics

Signature Schemes. CSG 252 Fall Riccardo Pucella

Discrete logarithms within computer and network security Prof Bill Buchanan, Edinburgh Napier

CRC Press has granted the following specific permissions for the electronic version of this book:

Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Capture Resilient ElGamal Signature Protocols

Lukasz Pater CMMS Administrator and Developer

Study of algorithms for factoring integers and computing discrete logarithms

Introduction to Cryptography CS 355

Elements of Applied Cryptography. Key Distribution. Trusted third party: KDC, KTC Diffie-Helmann protocol The man-in-the-middle attack

Communications security

CS549: Cryptography and Network Security

CUNSHENG DING HKUST, Hong Kong. Computer Security. Computer Security. Cunsheng DING, HKUST COMP4631

Ch.9 Cryptography. The Graduate Center, CUNY.! CSc Theoretical Computer Science Konstantinos Vamvourellis

A SOFTWARE COMPARISON OF RSA AND ECC

Forward Secrecy: How to Secure SSL from Attacks by Government Agencies

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

Identity-based Encryption with Post-Challenge Auxiliary Inputs for Secure Cloud Applications and Sensor Networks

MATH 168: FINAL PROJECT Troels Eriksen. 1 Introduction

Kleptography: The unbearable lightness of being mistrustful

RSA and Primality Testing

Cryptography and Network Security: Summary

An Introduction to the RSA Encryption Method

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

An Efficient Data Security in Cloud Computing Using the RSA Encryption Process Algorithm

Outline. CSc 466/566. Computer Security. 8 : Cryptography Digital Signatures. Digital Signatures. Digital Signatures... Christian Collberg

CS 348: Computer Networks. - Security; 30 th - 31 st Oct Instructor: Sridhar Iyer IIT Bombay

Network Security. Chapter 2 Basics 2.2 Public Key Cryptography. Public Key Cryptography. Public Key Cryptography

NEW DIGITAL SIGNATURE PROTOCOL BASED ON ELLIPTIC CURVES

CRYPTOGRAPHY IN NETWORK SECURITY

Identity-Based Encryption from the Weil Pairing

Number Theory and Cryptography using PARI/GP

Cryptography and Network Security

Public-Key Cryptanalysis

Public-key cryptography RSA

DIGITAL SIGNATURES 1/1

SECURITY IN NETWORKS

Outline. CSc 466/566. Computer Security. 7 : Cryptography Public Key. History of Public Key Cryptography. Public-key Algorithms. Christian Collberg

Elliptic Curve Cryptography

Lecture 9 - Message Authentication Codes

Elliptic Curve Cryptography Methods Debbie Roser Math\CS 4890

Public Key Cryptography Overview

An Overview of Common Adversary Models

CIS 433/533 - Computer and Network Security Public Key Crypto/ Cryptographic Protocols

Improved Online/Offline Signature Schemes

Post-Quantum Cryptography #4

CSC474/574 - Information Systems Security: Homework1 Solutions Sketch

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

EXAM questions for the course TTM Information Security May Part 1

Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1

Public Key Cryptography. Performance Comparison and Benchmarking

Cryptography and Network Security, PART IV: Reviews, Patches, and Theory 1 / 53

LUC: A New Public Key System

Breaking Generalized Diffie-Hellman Modulo a Composite is no Easier than Factoring

Schnorr Signcryption. Combining public key encryption with Schnorr digital signature. Laura Savu, University of Bucharest, Romania

Cryptography Exercises

Transcription:

CIS 5371 Cryptography p y 8. Encryption -- Asymmetric Techniques

Textbook encryption algorithms In this chapter, security (confidentiality) is considered in the following sense: All-or-nothing secrecy. Given the ciphertext y=e K K( (x), of plaintext x, the task of the attacker is to retrieve the whole of x. Otherwise he fails. That is, the adversary either gets x or nothing. Nothing means that the attacker does not have any knowledge about x before of after the attack. Passive attacker. The attacker does not manipulate or modify the ciphertext using data she/he has in possession and does not ask a key owner to provide encryption or decryption services.

Textbook encryption algorithms All-or-nothing secrecy. In applications, plaintext data is likely to have partial information known to the attacker. Passive attacker. One should never expect an attacker to be so nice and remain passive.

Textbook encryption algorithms security yparadigms We regard the security offered by the All-or-nothing secrecy, and the Passive attacker as models for our security paradigms.

Public Key Cryptography Alice Bb Bob Alice and Bob want to exchange a private key in public.

Public Key Cryptography The Diffie-Hellman protocol Let p is a large prime and g Z * p an element that generates a group of large prime order. The order q of g is a factor of p-1. 1 If q = p-1, then we say that g is a generator of Z p * Usually we take q to be a prime.

Public Key Cryptography The Diffie-Hellman protocol Alice g a mod p Bob g b mod p The private key is: g ab mod p The private key is: g ab mod p where p is a prime and g is a generator of Z p *

Example p = 43, g = 3, Alice and Bob share (p,g) = (43,3). Alice picks at random her secret exponent a = 8 Alice sends Bob: 3 8 25 (mod 43). Bob picks at random his secret exponent b = 37 Bob sends Alice: 3 37 20 (mod 43). The secret key agreed between the two is: 9 20 8 25 37 (mod 43).

Man-in-the-middle attack Alice picks a U Z p * and sends Malice ( Bob ): g a (mod p) Malice ( Alice ) )picks m Z * p and sends Bob: g m (mod p) Bob picks b U Z p * and sends Malice ( Bob) Bob: g b (mod p) Malice ( Bob ) sends Alice: g m (mod p) Alice computes: k m a 1 (g ) (mod odp) Bob computes: k 2 (g m ) b (mod p)

The Diffie-Hellman Problem The Computational Diffie-Hellman Problem -- CDH INPUT The description of a finite cyclic group G of order q (say Z * q* ) A generator element g of G g a, g a G, for some integers 0 < a,b < q. OUTPUT g ab

The Diffie-Hellman Assumption A CDH solver is a PPT algorithm A that solves the CDH problem with advantage > 0. The DHA is that, for any > 0, and any arbitrary instance of the CDH problem, there is no CDH solver that will succeed for all sufficiently large inputs.

The Discrete Logarithm Problem The Discrete Logarithm Problem -- DL INPUT The description of a finite it cyclic group G of order q (say Z * q ) A generator element g of G h G. OUTPUT The unique integer a<qsuch that h = g a modq. We call the integer a the discrete logarithm of h in base g and write: a = log g h modq.

The Discrete Logarithm Assumption A DL solver is a PPT algorithm A that solves the DL problem with advantage > 0. The DLA is that, for any > 0, and any arbitrary instance of the DL problem, there is no DLA solver that will succeed for all sufficiently large inputs.

The RSA cryptosystem Alice performs the following steps Choose p, q large primes with p q. Compute N = pq. Compute (N) = (p-1)(q-1). Choose a random integer e < (N) such that gcd(e, (N)) = 1 and compute the integer d such that ed = 1 (mod (N)). Make public (N,e) as her public key, keep (N,d) as her private key, and discard p,q and (N).

Encryption The RSA cryptosystem y Let m < N be the confidential message that Bob wants to send to Alice. Bob creates the ciphertext: t: c m e (mod N). Bob sends Alice: c Decryption To decrypt the ciphertext c Alice computes: m c d (mod N).

Check We have: ed = 1 (mod (N)), so ed = 1 + t (N). Therefore, D d (E e (m)) = (m e ) d = m ed = m t (N)+1 = (m (n) ) t m = 1 m = m mod n

Example Let p = 101, q = 113. Then N = 11413. (N) = 100 x 112 = 11200 = 2 6 5 2 7 For encryption use e = 3533. Alice publishes: N = 11413, e = 3533. Suppose Bob wants to encrypt: 9726. Bob computes 9726 3533 mod 11413 = 5761 Bob sends Alice the ciphertext 5761. To decrypt it Alice computes the plaintext: 5761 6597 (mod 11413) = 9726

Implementation 1. Generate two large primes: p,q 2. N pq and (N)= (p-1)(q-1) 3. Choose random e: with 1 < e < (N) & gcd(e, (N))=1 4. d e -1 mod f (n) 5. The public key is (n,e) and the private key is (N,d)

Cost In Z n : Cost of a modular multiplication (x y) mod n is O(k 2 ), where k = logn 2 Cost of a modular exponentiation x z (mod n) is O(k 2 log 2 z) )

Cryptanalysis of Public-key cryptosystems Active attacks on cryptosystems Chosen-Plaintext Attack (CPA): The attacker chooses plaintexts and obtains the corresponding ciphertexts: the task of the attacker is successful if he can decrypt a (new) target ciphertext. Chosen-Ciphertext Ciphertext Attack (CCA1): The attacker chooses a number of ciphertexts and obtains the corresponding plaintexts: the task of the attacker is successful if he can decrypt a (new) target ciphertext. Adaptive Chosen-Ciphertext Attack (CCA2): This is a CCS1 attack in which the attacker can adaptively choose ciphertexts: the task of the attacker is successful if he can decrypt a (new) target ciphertext.

The RSA Problem The RSA Problem -- RSA INPUT N = pq with p,q prime nmbers. e an integer such that gcd(e,(p-1)(q-1)) =1 c Z N. OUTPUT The unique integer m Z e N such that m c (mod N )

The RSA Assumption An RSA solver is a PPT algorithm A that solves the RSA problem with advantage > 0. The RSA Assumption is that, for any > 0, and any arbitrary instance of the RSA problem, there is no RSA solver that will succeed for all sufficiently large inputs.

The Integer Factorization Problem The IF Problem -- IF INPUT N an odd composite integer with at least two distinct prime factors. OUTPUT A prime p such that p N.

The IF Assumption An integer factorizer is a PPT algorithm A that solves the IF problem with advantage > 0. The IF Assumption is that, for any > 0, and any arbitrary instance of the IF problem, there is no integer factorizer that will succeed for all sufficiently large inputs.

Security of RSA 1. Relation to factoring. Recovering the plaintext m from an RSA ciphertext c is easy if factoring is possible. 2. The RSA problem Recovering the plaintext m from an RSA ciphertext c is easy if the RSA problem is easy. 3. Relation between factoring and the RSA problem If Factoring is easy then the RSA problem is easy. The converse is likely not to be true.

The Rabin cryptosystem Alice performs the following steps Choose p, q large primes with p = q. Compute N = pq. Pick a random integer b U Z n * Make public (N,b) as her public key, keep (p,q) as her private key.

The Rabin cryptosystem Encryption Let m Z n* be the confidential message that Bob wants to send to Alice. Bob creates the ciphertext: c m(m+b) (mod N). Bob sends Alice: c Decryption To decrypt the ciphertext c Alice solves the quadratic equation: 2 b 0 ( dn) m 2 + bm c 0 (mod N), for m < N.

The Rabin cryptosystem Decryption From elementary mathematics: where = b 2 +4c (mod N). m b 2 (mod N), Since m was chosen in Z n*, must be in QR N. Notice that if p,q are such that p q 3 (mod 4), then it is easier to compute square roots modulo N.

Remarks Suppose p q 3(mod4) 4), n = pq. Let y x 2 (mod n). Then: ( y ( p 1) / 4 ) 2 y ( p 1) / 2 y ( p 1) / 2 y y (mod p) Because ( 1) / 2 y p 1 (mod p).

Remarks (continued) It follows that: ( 1)/ 4 y p (mod p) ) is a square root of y modulo p. A similar il argument applies for the other prime q. So we get the quadratic residues modulo p and modulo q. We then get the quadratic residue modulo n by using the Chinese Remainder Theorem.

Example Suppose n = 77. Then e(x) = x 2 (mod 77) y d(y) = (mod 77) Suppose Bob wants to decrypt y = 23. 23 (7 1) / 4 2 2 4 mod7 23 (11 1) / 4 1 3 1 mod11

Example, continued Using the Chinese Remainder Theorem we compute the 4 square roots of 23 modulo 77 to be: 10 (mod 77), 32 (mod 77)

The Rabin Problem INPUT N = pq with p,q prime numbers. y x 2 (mod N), x Z * N OUTPUT z Z N* such that z x 2 (mod N). )

Security of Rabin 1. Relation to factoring. Recovering the plaintext m from a Rabin ciphertext c is easy if the IF problem is easy. 3. Relation between factoring and the Rabin problem Under CPA attacks the Rabin system is secure iff the IF problem is hard. Under CCA attacks the Rabin problem is completely insecure.

Security of Rabin Under CPA attacks the Rabin system is secure iff the IF problem is hard. Proof: We show this for the case when b = 0. Suppose that there is an algorithm that breaks Rabin with non-negligible probability > 0. Let m be a random message, c m 2 (mod N). The decryption m of m is one of the 4 square roots of c. With probability ½, we have m m (mod N). Then gcd(m m, N) = p or q. This contradicts t the IF assumption. The converse is trivial. i

Security of Rabin Under CCA attacks the Rabin system is completely insecure. Proof: We show this for the case when b =0 0. The adversary picks an m and computes c m 2 (mod N). Then he gets its decryption m.. This is one of the 4 square roots of c, and with probability ½, gcd(m m, N) = p or q. Then the adversary can decrypt any ciphertext.

The ELGamal cryptosystem Alice performs the following steps Choose a large random primes p. Compute a random multiplicative generator g Z p * Pick x U Z p-1 as private key Compute the public key y g x (mod p). Make public (p,g,y) as her public key, and keep (p,x) as her private key.

The ElGamal cryptosystem Encryption Let m < p be the confidential message that Bob wants to send to Alice. Bob picks k U Z p-1 and computes the ciphertext (c 1, c 2 ) c k 1 g (mod p). c 2 y k m (mod p). Decryption To decrypt the ciphertext (c 1, c 2 ) Alice computes m c 2 /c 1x (mod p).

The ElGamal l cryptosystem t Check: c 1 x (g k ) x y k c 2 /m (mod p).

Example Use p =43 43, g =3, m =14 14, x =7 7, y =37 37. Alice s private key: x = 7 Alice s public key: (p,g,y) = (43,3,37). Encryption with k = 26: c 1 = g k (mod p) = 3 26 (mod 43) =15. c 2 = y k m (mod p) = 37 26 14 (mod 43) =31. Decryption: m = c 1x = 7 2 /c (mod p) 31/15 (mod 43) = 14.

Security of ElGamal 1. Relation to the DL. Recovering the plaintext m from an ElGamal ciphertext cp ete tcc is easy if the DL problem is easy. 2. ELGamal and the CDH problem For messages that are uniformly distributed, the ElGamal encryption system is secure against CPAs iff the CDA problem is hard.

Security of ElGamal For messages that are uniformly distributed, the ElGamal encryption system is secure against CPAs iff the CDH problem is hard. Proof: Suppose there exists an oracle that breaks ElGamal with non negligible probability > 0. Then since m = c x 2 /c 1x (mod p) can be computed, c 2 /m = g (log g y log g c 1 ) (mod p) can also be computed. For an arbitrary CDH instance (p,g,g 1,g 2 ), take (p,g,g 1 ) as the ElGamal public key and (c 1 =g 2, c 2 ) as ciphertext. Then the oracle outputs c 2 /m = g (log g g 1 log g g 2 ) (mod p) ) which is a solution for the CDH instance.