Download presentation
Presentation is loading. Please wait.
Published byJasmin Lyons Modified over 9 years ago
1
LOGO Public Key Encryption Kyle Schmidt
2
A Brief History of Cryptography Ancient Greeks Scytale Cipher Julius Caesar Caesar Cipher “Enigma” Automated Cipher
3
What is Cryptography? Secure and private communication Encryption Rendering a message unintelligible WEDNESDAY THE SIXTEENTH JRQARFQNL GUR FVKGRRAGU
4
Symmetric vs. Asymmetric Symmetric Single key Asymmetric (Public Key) Two keys Public key & Private key Mailbox Concept Digital Signature
5
Branches of Cryptology Cryptology CryptographyCryptanalysis SymmetricAsymmetric Encryption Message Authentication Encryption
6
Advantages of Asymmetric Secure Exchange of Keys Can’t trust the middleman Nonrepudiation Keep track of your own key More Uses Encryption Message Authentication Digital Signatures
7
Modular Arithmetic Most cryptosystems based on finite, discrete sets modulus = 12
8
Modulus Operation Formal Definition: Given integers a, r, and m, we say a ≡ r mod m if (r – a) is divisible by m a = r mod m Note that there are infinitely many remainders Not to be confused with:
9
The Ring Z m Ring of integers with properties: Arithmetic operations always yield result in Z m e.g. ∀ a, b ε Z m then (a + b) ε Z m Neutral elements 0 for addition, 1 for multiplication e.g. ∀ a ε Z m, a + 0 ≡ a mod m Additive inverse always exists i.e. ∀ a ε Z m, ∃ b = -a such that a + b ≡ 0 mod m Multiplicative inverse only exists for some elements
10
Euclidean Algorithm Calculates Greatest Common Divisor (GCD) Simplify the problem GCD(a, b) = GCD(a – b, b)
11
Euclidean Algorithm a = bq + r a = su b = tu r = a – bq r = (su) – (qt)u r = (s – qt)u a = bq + r a = (s’v)q + (t’v) a = (s’q + t)v b = s’v r = t’v
12
Euclidean Algorithm 1q 1 = a / ba = bq 1 + r 1 r 1 = a – b q 1 2q 2 = b / r 1 b = q 2 r 1 + r 2 r 2 = b – q 2 r 1 3q 3 = r 1 / r 2 r 1 = q 3 r 2 + r 3 r 3 = r 1 – q 3 r 2 nq n = r n-2 / r n-1 r n-2 = q n r n-1 + r n r n = r n-2 – q n r n-1 n+1q n+1 = r n-1 / r n r n-1 = q n+1 r n + 0--- Procedure of Euclidean Algorithm
13
Extended Euclidean Algorithm Modular Division Multiplication by multiplicative inverse ba -1 instead of b/a Multiplicative Inverse: aa -1 ≡ 1 mod m Extended Euclidean Algorithm: Fast, efficient way to find multiplicative inverse
14
Extended Euclidean Algorithm Perform regular Euclidean Algorithm GCD(a, b) must be 1 Then for ax + by = 1, x is the multiplicative inverse of a, and y is the multiplicative inverse of b
15
Extended Euclidean Algorithm a = bq 1 + r 1 b = q 2 r 1 + r 2 r 1 = q 3 r 2 + r 3 r n-2 = q n r n-1 + 1 r 1 = a – bq 1 r 2 = b – q 2 r 1 r 3 = r 1 – q 3 r 2 1 = r n-2 – q n r n-1 1 = r n-2 – q n (r 1 – q 3 r 2 ) 1 = r n-2 – q n (r 1 – q 3 (b – q 2 r 1 )) 1 = r n-2 – q n (r 1 – q 3 (b – q 2 (a – b q 1 ))) 1 = ax + by
16
Extended Euclidean Algorithm Proof ax + by = 1 ax + by 1 mod a by 1 mod a aa -1 1 mod a
17
Euler’s Totient Function Essential for RSA Scheme and most likely others Totient (n) Number of totatives of an integer n Totative: An integer m, 0 < m < n, GCD(m, n) = 1 Prime factorization of n must be known
18
{1, 2, 3, …, 30} Example: (30) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 (5) (2) (3) S = C = A = = B
19
Example: (30) Calculate totients from frequency De Morgan’s Theorem: Probability a number is in a subset is equal to Probability a number is not in all other subsets Probability a number is NOT in a set is equal to 1 – (Probability of being IN the set) Probability = (1 – 1/2) * (1 – 1/3) * (1 – 1/5) Frequency = (1 – 1/2) * (1 – 1/3) * (1 – 1/5) * 30
20
Euler’s Totient Function Formula: (n) = n(1 – 1/p 1 )(1 – 1/p 2 )…(1 – 1/p m ) = (n) = (p 1 – 1)p 1 k1–1 (p 2 – 1)p 2 k2–1 …(p m – 1)p m km–1
21
RSA Ronald Rivest, Adi Shamir, Leonard Adleman 1977 Most widely used asymmetric scheme today Two main uses: Secure exchange of keys Digital signatures
22
How RSA Works Keys are pairs of integers Encrypting key: (e, n) Decrypting key: (d, n) Encryption/Decryption: Exponentiation within Z n Encrypt message: C = M e Decrypt cyphertext: M = C d Before encrypting: Convert plaintext to integer with hash function
23
RSA: Key Generation 1.Choose two arbitrary prime numbers p and q 2.Calculate n = pq 3.Calculate (n) = (p – 1)(q – 1) 4.Choose arbitrary integer e < (n) – 1 such that GCD(e, (n) ) = 1 5.Calculate d = multiplicative inverse of e mod (n) using Extended Euclidean Algorithm
24
RSA: Key Generation Basic requirement: After choosing p, q, choose e, d, k satisfying: ed – 1 = k(p – 1)(q – 1) Extended Euclidean Algorithm requires two integers that are relatively prime Thus, requiring e and (n) to be relatively prime ensures that there will be a matching private key
25
How RSA Works M e = C; C d = M Prove C d ≡ (M e ) d ≡ M ed ≡ M mod n Fermat’s Little Theorem M (n) ≡ 1 mod n if M and n are relatively prime M k (n) ≡ 1 mod n M*M k (n) ≡ M mod n M k (n)+1 ≡ M mod n M ed ≡ M mod n ed – 1 = k(p – 1)(q – 1) ed = k(p – 1)(q – 1) + 1 ed = k (n) + 1
26
How RSA Works M = M ed = M 1+ (n)k = (M)M (n)k = (M)(M (n) ) k = (M)(1) k = M M = M
27
RSA: Faster Encryption “Square-and-Multiply” Algorithm Quick and efficient, even with large numbers Based on binary representation of exponent Iterative through bits, left to right Consider y = x h mod n Starting with 2 nd bit from left: 1.Calculate y = x 2.Calculate y = y 2 mod n 3.If current bit of h is 1, calculate y = yx mod n 4.Repeat steps 2 and 3 for each bit in exponent
28
RSA: Faster Encryption Example: y = 2 26 mod 5 IterationCurrent BitCalculationValue of y y = x2 11 [1] 0 1 0y = y 2 mod n4 mod 5 = 4 11 [1] 0 1 0y = y * x mod n8 mod 5 = 3 21 1 [0] 1 0y = y 2 mod n9 mod 5 = 4 31 1 0 [1] 0y = y 2 mod n16 mod 5 = 1 31 1 0 [1] 0y = y * x mod n2 mod 5 = 2 41 1 0 1 [0]y = y 2 mod n4 mod 5 = 4
29
RSA: Faster Encryption Square-and-Multiply has complexity O(log n), where n is the number of bits in the exponent Relatively efficient Although still intensive for small devices Speed up encryption more: smaller public key No significant loss of security
30
RSA: Faster Decryption Can’t use smaller private key Major security loss Chinese Remainder Theorem Allows computation of y = x mod (pq) given: y 1 = x mod p and y 2 = x mod q Break down C d mod n into smaller computations More computations, but less intensive Requires knowledge of p and q, thus cannot be used to speed up encryption
31
RSA: Faster Decryption Variation of Fermat’s Little Theorem: x p-1 ≡ 1 mod p Using this, break down exponent d into d 1 = d mod (p – 1) and d 2 = d mod (q – 1) Decryption now requires two exponentiations: Using Chinese Remainder Theorem, compute: y ≡ y 1 q(q –1 mod p) + y 2 p(p –1 mod q) mod n On average, four times faster
32
Practical Uses of RSA Even with these methods to speed up RSA, it is still much slower than symmetric systems Not typically used for large-scale encryption Encrypt smaller messages Passwords Symmetric keys Digital Signatures Used together with symmetric systems Secure key exchange + fast, efficient encryption
33
Problem Modern computers becoming more efficient Factoring large numbers is becoming easier Larger keys required for RSA to remain secure –RSA becoming slower and slower
34
Alternative Elliptic Curve Cryptography (ECC) 1985 Neal Koblitz, Victor S. Miller Estimated to be widespread within next decade
35
Elliptic Curve Cryptography: Premise Point “Addition” (addition of ordered pairs) Given a set E of points, and an operator “+”: Compute “sum” of two points as another point P + Q = R; P, Q, R ɛ E NOT actual arithmetic addition Point “Multiplication” G = P + P + … + P k = kP; G, P ɛ E, k ɛ R
36
Elliptic Curve Cryptography: Premise The set E is drawn from points of an elliptic curve y 2 = x 3 + ax + b Security comes from difficulty of finding k if given G and P Elliptic Curve Discrete Logarithm Problem Can’t just divide G by P Not arithmetic multiplication! More similar to finding k in a = b k No efficient algorithm exists to solve this problem
37
Computing P + Q Since elliptic curves are cubic, there are generally three points a line intersects the curve Use this fact to calculate P + Q 1.Draw line from P to Q 2.Define the third point of intersection to be –R 3.Thus R is the mirror reflection of –R
38
Computing P + Q If there is no third point (the line is vertical), P + Q is said to be “infinity”, denoted as O O is an additive identity (P + O = P) To compute P + P, use P’s tangent line instead
39
Elliptic Curve Algebra Algebraic Formulae: P + Q x P+Q = β 2 – x P – x Q y P+Q = β(x P – x R ) – y P –β is the slope of the line P + P (or 2P) x 2P = ([3x 2 P + a] / 2y P ) 2 – 2x P y 2 P = ([3x 2 P + a] / 2y P ) * (x P – x R ) – y P –a is the same parameter from the cubic equation
40
How it is Applied to Cryptography To ensure security, some restrictions: Curve must be smooth (no cusps, intersections, etc) Can’t use all real numbers – must be discrete In particular, prime numbers or binary numbers No longer a “curve,” but algebra still holds Why ECC is harder to crack than RSA: Algebra is more complex than factoring numbers
41
Secure Key Exchange Variation of Diffie-Hellman Scheme 1.Alice and Bob agree on parameters for curve a, b in y 2 = x 3 + ax + b and a point G ɛ E 2.Alice chooses a private integer X A and calculates a point Y A = X A G 3.Bob does similar, calculating Y B from integer X B 4.Alice and Bob publicly exchange Y A and Y B 5.The secret key K is computed by: For Alice, K = X A Y B For Bob, K = X B Y A
42
Secure Key Exchange Alice and Bob get the same private key, because: K = X A Y B = X A (X B G) = X B X A G = X B Y A = K
43
The Bigger Picture ECC found to be 10x faster than RSA Requires less memory and computational power Equal security as RSA Ideal for use on: Smart cards Wireless devices Other constrained devices RSA is unsuitable for
44
The Bigger Picture Security of RSA Increasingly more vulnerable Security of ECC No significant increase in vulnerability over 25 years Symmetric Key SizeRSA Key SizeECC Key Size 801024160 1122048224 1283072256 1927680384 25615360521 NIST Recommended Key Sizes for Equal Security
45
References [1] Alayont, Feryâl. (2005). “ RSA: A Public Key Cryptosystem ”. [2] Kak, Avi. (2011). “ Elliptic Curve Cryptography and Digital Rights Management ”. Lecture Notes on Computer and Network Security. [3] Kotas, William A. (2000). “ A Brief History of Cryptography ”. University of Tennessee Honors Thesis Projects. [4] National Security Agency. (2009). “ The Case for Elliptic Curve Cryptography ”. [5] Paar, Christof and Pelzl, Jan. (2010). “ Introduction to Cryptography ”. Understanding Cryptography – A Textbook for Students and Practitioners (online slides). [6] Paar, Christof and Pelzl, Jan. (2010). “ The RSA Cryptosystem ”. Understanding Cryptography – A Textbook for Students and Practitioners (online slides). [7] RSA Laboratories. (2000). “ RSA Laboratories ’ Frequently Asked Questions About Today ’ s Cryptography, Version 4.1 ”. [8] Turner, Clay S. (2008). “ Euler ’ s Totient Function and Public Key Cryptography ”. [9] Vinck, A.J. Han. (2011). “ Introduction to Public Key Cryptography ”. [10] Wagner, Neal R. (2003). “ The RSA Public Key Cryptosystem ”. The Laws of Cryptography with Java Code. [11] Weisstein, Eric W. “ Euclidean Algorithm ”. MathWorld – A Wolfram Web Resource.
46
References Additional images for this presentation retrieved from: http://en.wikipedia.org/wiki/Enigma_machine http://en.wikipedia.org/wiki/Public-key_cryptography http://www.usc.edu/dept/molecular-science/RSA-2003.htm http://en.wikipedia.org/wiki/Leonhard_Euler http://physicsworld.com/cws/article/news/47723 http://en.wikipedia.org/wiki/Credit_card
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.