1 Thinking the Impossible “Modern Cryptography” Jeremy R. Johnson.

Slides:



Advertisements
Similar presentations
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
Advertisements

Cryptography and Network Security Chapter 9
Euclidean Algorithm Applied Symbolic Computation CS 567 Jeremy Johnson.
1 Introduction CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell.
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (4) Information Security.
CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
Public Key Encryption Algorithm
Session 4 Asymmetric ciphers.
Public Key Crytography1 From: Introduction to Algorithms Cormen, Leiserson and Rivest.
The Algebra of Encryption CS 6910 Semester Research and Project University of Colorado at Colorado Springs By Cliff McCullough 20 July 2011.
Cryptography and Network Security Chapter 9. Chapter 9 – Public Key Cryptography and RSA Every Egyptian received two names, which were known respectively.
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
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.
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.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
ElGamal Public Key Cryptography CS 303 Alg. Number Theory & Cryptography Jeremy Johnson Taher ElGamal, "A Public-Key Cryptosystem and a Signature Scheme.
The RSA Algorithm Rocky K. C. Chang, March
Introduction to Modular Arithmetic and Public Key Cryptography.
RSA and its Mathematics Behind
RSA Ramki Thurimella.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
Midterm Review Cryptography & Network Security
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
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 Chapter 9 - Public-Key Cryptography
PUBLIC-KEY CRYPTOGRAPH IT 352 : Lecture 2- part3 Najwa AlGhamdi, MSc – 2012 /1433.
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.
1 Network and Computer Security (CS 475) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson.
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.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Network and Computer Security (CS 475) Modular Arithmetic
1 Section Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Great Theoretical Ideas in Computer Science for Some.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
By Marwan Al-Namari & Hafezah Ben Othman Author: William Stallings College of Computer Science at Al-Qunfudah Umm Al-Qura University, KSA, Makkah 1.
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
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.
1 Introduction CS 303 Algorithmic Number Theory and Cryptography Jeremy R. Johnson.
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.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Outline Primitive Element Theorem Diffie Hellman Key Distribution
Thinking the Impossible “Modern Cryptography”
Number Theory (Chapter 7)
Coin Flipping Protocol
Private-Key Cryptography
Applied Symbolic Computation (CS 300) Modular Arithmetic
ICS 353: Design and Analysis of Algorithms
Applied Symbolic Computation (CS 300) Modular Arithmetic
Systems Architecture I
Applied Symbolic Computation (CS 300) Modular Arithmetic
Algorithmic Number Theory and Cryptography (CS 303) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Presentation transcript:

1 Thinking the Impossible “Modern Cryptography” Jeremy R. Johnson

2 Introduction Objective: To see how to securely communicate on the internet without giving up privacy. To understand what a public key cryptosystem is and how the RSA algorithm works. To do impossible things. –Modern cryptography –Solutions to some “impossible problems” –Public Key Cryptosystems –Modular Arithmetic –RSA Algorithm References: Rivest, Shamir, Adelman CS Unplugged

3 Importance of the Area Did you buy anything online recently? Use an ATM machine? If so, whether you know it or not, you used cryptography. Cryptography (in the guise of the SSL protocol) protects your credit card information as it whizzes across the Internet, and ensures that others can't withdraw money from your account. The ubiquitous use of tools such as SSL and SSH shows that cryptography, once an esoteric military concern, has now burst into the mainstream. Yet, this is only the beginning of a coming flood.

4 “Impossible” Problem One How can you determine the outcome of a vote on the intenet without revealing individual votes?

5 Classical Cryptography Basic problem: Secure communication over an insecure channel Solution: private key encryption –m  E (k,m) = c  D (k,c) = m Shannon provided a rigorous theory of perfect secrecy based on information theory –Adversary has unlimited computational resources, but key must be as long as message

6 Substitution Cypher HELLO ALL HAIL CEASAR

7 Substitution Cypher KHOOR DOO KDLO FHDVDU

8 Frequency Analysis en.wikipedia.org/wiki/Frequency_analysis_(cryptanalysis) scottbryce.com/cryptograms

9 One Time Pad Pad = b 1  b n  {0,1}* chosen randomly m = m 1  m n –E (Pad,m) = c = m  Pad –D (Pad,c) = c  Pad = (m  Pad)  Pad = m  m,c Pr Pad [ E (Pad,m) = c] = 1/2 n –No information gained from seeing c –However, E (Pad,m)  E (Pad,m’) = m  m’

10 “Impossible” Problem Two How can you send a secret over the internet without previously sending a courier to distribute the secret key? Is your method secure? The answer comes from modern cryptography and relies on public key cryptography Whitfield Diffie and Martin E. Hellman, "New Directions in Cryptography", IEEE Transactions on Information Theory, Vol. IT-22, No. 6, Nov

11 Public Key Cryptosystem Let M be a message and let C be the encrypted message (ciphertext). A public key cryptosystem has a separate method E() for encrypting and D() decrypting. D(E(M)) = M Both E() and D() are easy to compute Publicly revealing E() does not make it easy to determine D() E(D(M)) = M - needed for signatures The collection of E()’s are made publicly available but the D()’s remain secret. Called a one-way trap-door function (hard to invert, but easy if you have the secret information)

Public Key Encryption Map (From CS Unplugged)

Public Key Encryption Map The Map What To Do  Come up with 10 numbers that add up to your ASCII value.  Label your vertices with the values.  Take each vertex and its neighbors, compute the sum, and replace the vertex value with that sum.  Erase the old values!!!

ASCII Table

Private Key Encryption Map

The Private Key What To Do Just add up the values of each bold vertex from the public map you were given.

17 Modern Cryptography Adversary’s resources are computationally bounded –Probabilistic polynomial time algorithm Impossibility of breaking the encryption system  Infeasibility of breaking Rely on gap between efficient algorithms for encryption and computational infeasibility of decryption by adversary

18 Dominating Sets & NP Completeness

19 Dominating Sets & NP Completeness

20 “Impossible” Problem Three How can you flip a coin over the phone? The answer comes from modern cryptography and is the key to secure communication over the internet, provides privacy, authentication and digital signatures

21 Public Key Cryptosystem Let M be a message and let C be the encrypted message (ciphertext). A public key cryptosystem has a separate method E() for encrypting and D() decrypting. D(E(M)) = M Both E() and D() are easy to compute Publicly revealing E() does not make it easy to determine D() E(D(M)) = M - needed for signatures The collection of E()’s are made publicly available but the D()’s remain secret. Called a one-way trap-door function (hard to invert, but easy if you have the secret information)

22 “Impossible” Problem Four How can you prove you know something to an adversary without revealing your secret? The answer comes from the area of zero knowledge proofs

Where’s Waldo 23

Open Sesame 24 Jean-Jacques Quisquater, Louis C. Guillou, Thomas A. Berson. How to Explain Zero-Knowledge Protocols to Your Children. Advances in Cryptology - CRYPTO '89: Proceedings, v.435, p , 1990.

25 Zero Knowledge Proof 1.Completeness: if the statement is true, the honest verifier (that is, one following the protocol properly) will be convinced of this fact by an honest prover. 2.Soundness: if the statement is false, no cheating prover can convince the honest verifier that it is true, except with some small probability. 3.Zero-knowledge: if the statement is true, no cheating verifier learns anything other than this fact. This is formalized by showing that every cheating verifier has some simulator that, given only the statement to be proven (and no access to the prover), can produce a transcript that "looks like" an interaction between the honest prover and the cheating verifier.

Secure Passwords Every users stores a statement of a theorem in a publicly readable directory Upon login, the user engages in a zero- knowledge proof of the correctness of the theorem If the proof is convincing access is granted Guarantees that an adversary who overhears the proof can not learn enough to gain access 26

27 RSA Public Key Cryptosystem

28 Public Key Cryptosystem Let M be a message and let C be the encrypted message (ciphertext). A public key cryptosystem has a separate method E() for encrypting and D() decrypting. D(E(M)) = M Both E() and D() are easy to compute Publicly revealing E() does not make it easy to determine D() E(D(M)) = M - needed for signatures The collection of E()’s are made publicly available but the D()’s remain secret. Called a one-way trap-door function (hard to invert, but easy if you have the secret information)

29 Clock Arithmetic = ?

30 Clock Arithmetic

31 Clock Arithmetic

32 Clock Arithmetic

33 Clock Arithmetic

34 Clock Arithmetic

35 Clock Arithmetic = 1 (mod 12)

36 Clock Arithmetic  5 = ?

37 Clock Arithmetic  2

38 Clock Arithmetic  3

39 Clock Arithmetic  4

40 Clock Arithmetic  5 = 1 (mod 12)

41 Multiplication Table mod 5 

42 Multiplication Table mod 6 

43 Modular Arithmetic (Z n ) Definition: a  b (mod n)  n | (b - a) Alternatively, a = qn + b Properties (equivalence relation) –a  a (mod n) [Reflexive] –a  b (mod n)  b  a (mod n) [Symmetric] –a  b (mod n) and b  c (mod n)  a  c (mod n) [Transitive] Definition: An equivalence class mod n [a] = { x: x  a (mod n)} = { a + qn | q   }

44 Modular Arithmetic (Z n ) It is possible to perform arithmetic with equivalence classes mod n. – [a] + [b] = [a+b] – [a] * [b] = [a*b] In order for this to make sense, you must get the same answer (equivalence) class independent of the choice of a and b. In other words, if you replace a and b by numbers equivalent to a or b mod n you end of with the sum/product being in the same equivalence class. a 1  a 2 (mod n) and b 1  b 2 (mod n)  a 1 + b 1  a 2 + b 2 (mod n) a 1 * b 1  a 2 * b 2 (mod n) (a + q 1 n) + (b + q 2 n) = a + b + (q 1 + q 2 )n (a + q 1 n) * (b + q 2 n) = a * b + (b*q 1 + a*q 2 + q 1 * q 2 )n

45 Representation of Z n The equivalence classes [a] mod n, are typically represented by the representatives a. Positive Representation: Choose the smallest positive integer in the class [a] then the representation is {0,1,…,n- 1}. Symmetric Representation: Choose the integer with the smallest absolute value in the class [a]. The representation is {-  (n-1)/2 ,…,  n/2  }. When n is even, choose the positive representative with absolute value n/2. E.G. Z 6 = {-2,-1,0,1,2,3}, Z 5 = {-2,-1,0,1,2}

46 Greatest Common Divisor Definition: g = gcd(a,b) g|a and g|b if e|a and e|b then e|g Example: gcd(30,12) = 6 30 = 2  3  5 12 = 2 2  3 Inefficient!!!

47 Euclidean Algorithm gcd(a,b) if b = 0 then return a else return gcd(b, a mod b) Example: gcd(30,12) gcd(12,6) gcd(6,0) Efficient!!! O(log N), a, b  N

48 Modular Inverses Definition: x is the inverse of a mod n, if ax  1 (mod n) The equation ax  1 (mod n) has a solution iff gcd(a,n) = 1. Extended Euclidean Algorithm, there exist x and y such that ax + ny = gcd(a,n). When gcd(a,n) = 1, ax + ny = 1  ax  1 (mod n) Example gcd(5,12) = 1, 5   12 = 1

49 Euler phi function Definition: phi(n) = #{a: 0 < a < n and gcd(a,n) = 1} Properties: –  (p) = p-1, for prime p. –  (p^e) = (p-1)*p^(e-1) –  (m*n) =  (m)*  (n) for gcd(m,n) = 1. –  (p*q) = (p-1)*(q-1) Examples: –  (15) =  (3)*  (5) = 2*4 = 8. = #{1,2,4,7,8,11,13,14} –  (9) = (3-1)*3^(2-1) = 2*3 = 6 = #{1,2,4,5,7,8}

50 Euler’s Identity The number of elements in Z n that have multiplicative inverses is equal to phi(n). Theorem: Let (Z n )* be the elements of Z n with inverses (called units). If a  (Z n )*, then a  (n)  1 (mod n). Proof. The same proof presented for Fermat’s theorem can be used to prove this theorem.

51 Chinese Remainder Theorem Theorem: If gcd(m,n) = 1, then given a and b there exist an integer solution to the system: x  a (mod m) and x = b (mod n). Proof: Consider the map x  (x mod m, x mod n). This map is a 1-1 map from Z mn to Z m  Z n, since if x and y map to the same pair, then x  y (mod m) and x  y (mod n). Since gcd(m,n) = 1, this implies that x  y (mod mn). Since there are mn elements in both Z mn and Z m  Z n, the map is also onto. This means that for every pair (a,b) we can find the desired x.

52 Public Key Cryptosystem Let M be a message and let C be the encrypted message (ciphertext). A public key cryptosystem has a separate method E() for encrypting and D() decrypting. D(E(M)) = M Both E() and D() are easy to compute Publicly revealing E() does not make it easy to determine D() E(D(M)) = M - needed for signatures The collection of E()’s are made publicly available but the D()’s remain secret. Called a one-way trap-door function (hard to invert, but easy if you have the secret information)

53 RSA Public Key Cryptosystem Based on the idea that it is hard to factor large numbers. First encode M as an integer (e.g. use ASCII). Large messages will need to be blocked. Choose n = p*q, the product of two large prime numbers. Choose e such that gcd(e,phi(n)) = 1. Choose d such that de  1 (mod  (n)) E = (e,n) and E(M) = M e mod n D = (d,n) and D(M) = M d mod n

54 Correctness of the RSA Algorithm Theorem: D(E(M)) = E(D(M)) = M. Proof. D(E(M)) = (M e ) d (mod n) = M ed (mod n). Since ed  1 (mod  (n)), ed = k*  (n) + 1, for some integer k. M k*  (n)+1  (M k*  (n)+1 mod p, M k*  (n)+1 mod q) = (M k*  (n) * M mod p, M k*  (n) * M mod q) = (M (p-1)*(q-1)*k * M mod p, M (q-1)*(p-1)*k * M mod q) [since n = pq] = ((M (p-1) ) (q-1)*k * M mod p, (M (q-1) ) (p-1)*k * M mod q) = (M mod p, M mod q) [By Fermat’s theorem] Therefore, by the CRT, M k*  (n)+1  M (mod n).