Title: Number Theory and Advanced Cryptography 2' Primes
1Number Theory and Advanced Cryptography 2.
Primes Discrete Logarithms --Primes
distribution testing, DL background
applications
Part I Introduction to Number Theory Part II
Advanced Cryptography
2The 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, ?(75) 4, and so on.
3Some values of ?(x)
4The Sieve of Eratosthenes
- This is an algorithm for generating all the
primes up to a given bound k.
5The prime number theorem
6The error term in the prime number theory (1)
7The error term in the prime number theory (2)
8Sophie Germain primes
9Probabilistic primality testing
10Trial division
11The Miller-Rabin test
12Error parameter (1)
13Error parameter (2)
14Carmichael numbers
15Good Primality testing (1)
16Good Primality testing (2)
17Error parameter
18Generating random primes using the Miller-Rabin
Test
19Sieving up to a small bound
20Generating a random k-bit prime
21Perfect power testing (1)
22Perfect power testing (2)
23Perfect power testing (3)
24Deterministic Primality Testing
25AKS algorithm
26Running time
27Notes
28Primality testing in Java
- Public BigInteger ( int bitLength,int
certainty,Random rnd ) - Public boolean isProbablePrime (int certainty)
29Cyclic groups
30Order of group element
31(Example)Powers of Integers, Modulo 19
32Cyclic group Group generator
33Example of Cyclic Group
34Theorem of Cyclic Group
35Prime Order group
36The Multiplicative Group Zn
37The Multiplicative Group Zn
38Example of The Multiplicative Group
39Finding Primitive Root
Page 166
40Application 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
41The Diffie-Hellman Key Exchange Protocol
42Example of D-H Key Exchange (1)
5
XA 36 XB58
q97
YA53650 mod 97 YB55844 mod 97
K(YB)XA mod 97 4436 75 nod 97 K(YA)XB mod
97 5058 75 nod 97
43Example of D-H Key Exchange (2)
44Hybrid Encryption
- Diffie-Hellman based hybrid encryption system
A
B
YA
K(YB)xA (YA)xB Mod q SKh(K)
YB
ESK(M)
128 256 bits
SK can be a key of the AES symmetric cryptosystem
45The Man-in-the-Middle Attack (1)
46The Man-in-the-Middle Attack (2)
47The DH Problem and DL Problem (1)
48The DH Problem and DL Problem (2)
Example a loggh log3 5 mod 19 4
49Importance of Arbitrary Instances for
Intractability Assumptions
CRT
akiqiai ri g(p-1)/qi mod p
riairia (mod qi) h(p-1)/qi mod p
50Chinese Remainder Theorem (1)
51Chinese Remainder Theorem (2)
52Chinese Remainder Theorem (3)
53Example of CRT
54ElGamal (1)
55ElGamal (2)
56Meet-in-the-middle attack Active attack of
ElGamal