Public Key Encryption
Public Key Encryption
• Prime number
• Modular arithmetic
• Euclid’s algorithm
• Fermet’s and Euler’s theorem
• Primality
• Chinese remainder theorem
• Discrete logarithm
Prime Numbers
• is 'clock arithmetic'
• uses a finite number of values, and loops back
from either end
• modular arithmetic is when do addition &
multiplication and modulo reduce answer
• can do reduction at any point, ie
– a+b mod n = [a mod n + b mod n] mod n
Modular Arithmetic
+ 0 1 2 3 4 5 6 7
0 0 1 2 3 4 5 6 7
1 1 2 3 4 5 6 7 0
2 2 3 4 5 6 7 0 1
3 3 4 5 6 7 0 1 2
4 4 5 6 7 0 1 2 3
5 5 6 7 0 1 2 3 4
6 6 7 0 1 2 3 4 5
7 7 0 1 2 3 4 5 6
Greatest Common
Divisor (GCD)
• a common problem in number theory
• GCD (a,b) of a and b is the largest number that
divides evenly into both a and b
– eg GCD(60,24) = 12
• often want no common factors (except 1) and
hence numbers are relatively prime
– eg GCD(8,15) = 1
– hence 8 & 15 are relatively prime
Euclidean Algorithm
• ap-1 = 1 (mod p)
– where p is prime and gcd(a,p)=1
• also known as Fermat’s Little Theorem
• also ap = p (mod p)
• useful in public key and primality testing
Euler Totient Function ø(n)
• have considered:
– prime numbers
– Fermat’s and Euler’s Theorems & ø(n)
– Primality Testing
– Chinese Remainder Theorem
– Discrete Logarithms
Chapter‐2 Public key
cryptography
• public‐key/two‐key/asymmetric cryptography
involves the use of two keys:
– a public‐key, which may be known by anybody, and can be
used to encrypt messages, and verify signatures
– a private‐key, known only to the recipient, used to decrypt
messages, and sign (create) signatures
• is asymmetric because
– those who encrypt messages or verify signatures cannot
decrypt messages or create signatures
Public‐Key Cryptography
Public‐Key Characteristics
c = 0; f = 1
for i = k downto 0
do c = 2 x c
f = (f x f) mod n
if bi == 1 then
c = c + 1
f = (f x a) mod n
return f
Efficient Encryption
• have considered:
– principles of public‐key cryptography
– RSA algorithm, implementation, security
Chapter‐3 Key Management
• have considered:
– distribution of public keys
– public‐key distribution of secret keys
– Diffie‐Hellman key exchange
– Elliptic Curve cryptography