110 likes | 246 Views
Diffie -Hellman Key Exchange. MATH 3396 Instructor: Alex Karassev. Discrete logarithm problem (DLP). a, b from F p * The smallest non-negative integer x such that a x = b is called the discrete logarithm of b to the base a Notation: x = Log a b числа b по основанию а
E N D
Diffie-Hellman Key Exchange MATH 3396 Instructor: Alex Karassev
Discrete logarithm problem (DLP) • a, b from Fp* • The smallest non-negative integer x such that ax = b is called the discrete logarithm of b to the base a • Notation: x = Log a bчисла b по основанию а • Example: 42 = 5 inF11 and therefore 2 = log45 • Knowing a and b it is hard to findx • Exhaustive search: O(p) • Improvement: O(p1/2)
Sophie Germain primes • A prime q such that 2q+1 is also prime • In this case p = 2q+1 is called safe prime • First few Sophie Germain primes:2, 3, 5, 11, 23, 29, 41, 53 • First few safe primes:5,11,23,47,59 • Largest known (as of 2016) Sophie Germain prime has 388342 digits • Conjecture: there are infinitely many Sophie Germain prime
Diffie-Hellman key exchange • Choose large prime p (preferably, a safe prime) • Choose g in Fp* such that ord g is a large prime • (if p = 2 q +1, ord g = q) • p and g are NOT secret (in fact, usually g = 2 or 3)
Diffie-Hellman Key exchange A B p, g non-secure channel Secret а A = ga Secretb B = gb Shared secret key: K = Ba = (gb)a = gab = (ga)b = Ab AlicecomputesK=Ba Bobcomputes K=Ab A possible way to find K = gab: knowing p, g, А, find а, such that ga = Amod pwhich is the Discrete Logarithm Problem
Example p = 11, g = 2 A = 8 B = 6 a = 3 A = 23=8 b = 9 B = 29=512 = 46*11+6 = 6 Bob computesK = Ab= 89== 134217728 == 12201611*11+ 7 = 7 Alice computesK = Ba= 63= 216= 19*11 + 7 = 7 Shared secret keyK = 7
Man-in-the-middle attack • Diffie-Hellman key exchange protocol is not protected against man-in-the middle attack: • An authenticated version of Diffie-Hellman protocol can be obtained with the use of digital signature
Digital signature – brief overview • Bob needs to send Alice a document m • Alice needs to make sure that document has been sent by Bob and not by somebody else • Bob send c=e(m), and encrypted E(f(m)), where s=f(m) is a function of m (digital signature), and E is the encryption function using Bob’s private key for digital signature • Alice receives c and s, and computes m=d(c) and s=D(E(f(m))), using Bob’s public key for digital signature • Verification: if f(m) = s, then the document has been sent by Bob