More Number Theory and The RSA Cryptosystem... Write function gcda,b in Python example... The order of a group element... The order of group elements• Example: Find the order of 3 and 2
Trang 1More Number Theory
and The RSA Cryptosystem
Trang 2More number Theory
Trang 3Write function gcd(a,b)
in Python
example
Trang 4Exercise
Trang 5Write
gcdex(a, b, ’s’, ’t’)
in Python
example
Trang 6Exercise
Trang 7Multiplicative inverse
Trang 8• Proof
Trang 10Exercise
Trang 11Write
a^(-1) mod b in
Python
Trang 12Chinese Remainder Theorem
Trang 13Write function
chrem([a1, …, ar],[m1, …, mr]) in Python
Trang 15Exercise
Trang 16The order of a group element
Trang 17The order of group elements
• Example: Find the order of 3 and 2 in Z7*
Trang 18• The order of an element g in Z7* must divides 6, ord(g) is in{1, 2, 3, 6}.
• The order of an element g in Z11* must divides 10, ord(g) is in{1, 2, 5, 10}.
Trang 19Facts
Trang 20Primitive element
Definition: An element having order p – 1 modulo p is
call a primitive element modulo p
Trang 23Exercise
Trang 24Public key cryptosystem
Trang 25Symmetric key cryptosystem
Trang 26Public key cryptosystem (PKC)
Trang 27Remind: One-way function
Trang 28The RSA cryptosystem
Trang 30Exercise: show that (xb)a = x (mod n) if x in Zn\ Zn*.
Trang 31Example
Trang 32Cryptool it!
Trang 33The trapdoor in RSA
Trang 34RSA Parameter generation
Trang 35• Fast exponentiation
Trang 36Primality testing
Trang 37A simple deterministic algorithm
Trang 38Randomized Algorithm
• They can make random choices during their
execution
• Las Vegas algorithm:
– may fail to give an answer, but if the algorithm does return
an answer, then the answer must be correct.
• Mote Carlo algorithm:
Trang 39Quadratic residue
Trang 40Legendre symbol
Trang 42Jacobi symbol
Trang 43Example
Trang 44Compute Jacobi symbol
Trang 47The Solovay-Strassen Algorithm
Trang 48The Solovay-Strassen Algorithm properties
• This is a yes-biased Monte Carlo algorithm with
error probability at most ½
• If we run the algorithm m times, the probability that such an integer n is prime is 1 – 2-m
such an integer n is prime is 1 – 2
Write isprime(a) in Python;
Trang 49Factoring Algorithms
Trang 5060 = 2 * 2 * 3* 5
Trang 51The three most effective algorithms
1 The Quadratic Sieve
2 The Elliptic Curve Factoring Algorithm
3 The Number Field Sieve
write ifactor(n) in Python