560 likes | 589 Views
Number Theory and Advanced Cryptography 2. Primes and Discrete Logarithms. Chih-Hung Wang Feb. 2011. Part I: Introduction to Number Theory Part II: Advanced Cryptography. The distribution of primes.
E N D
Number Theory and Advanced Cryptography2. Primes and Discrete Logarithms Chih-Hung Wang Feb. 2011 Part I: Introduction to Number Theory Part II: Advanced Cryptography
The distribution of primes • The natural way of measuring the density of primes is to count the number of primes up to a bound x, where x is a real number. For a real number x ¸ 0, the function (x) is defined to be the number of primes up to x. Thus, (1) = 0, (2) = 1, (7.5) = 4, and so on.
The Sieve of Eratosthenes • This is an algorithm for generating all the primes up to a given bound k.
Probabilistic primality testing • Trial Division
Deterministic Primality Testing • The basic idea
Primality testing in Java • Public BigInteger ( intbitLength,intcertainty,Randomrnd ) • Public boolean isProbablePrime(intcertainty)
Cyclic groups • Order of group element
Finding Primitive Root Page 166
Application 1: Diffie-Hellman Key Exchange • Diffie and Hellman 1976 • A number of commercial products employ this key exchange technique • This algorithm enables two users to exchange key securely
Example of D-H Key Exchange (1) =5 XA = 36 XB=58 q=97 YA=536=50 mod 97 YB=558=44 mod 97 K=(YB)XA mod 97 = 4436 = 75 nod 97 K=(YA)XB mod 97 = 5058 = 75 nod 97
Hybrid Encryption • Diffie-Hellman based hybrid encryption system A YA B K=(YB)xA =(YA)xB Mod q SK=h(K) YB ESK(M) 128 – 256 bits SK can be a key of the AES symmetric cryptosystem
The DH Problem and DL Problem (2) Example:a = loggh = log3 5 mod 19 = 4
Importance of Arbitrary Instances for Intractability Assumptions CRT a=kiqi+ai ri= g(p-1)/qi mod p riai=ria (mod qi) = h(p-1)/qi mod p