E
ncryption-Number TheoryEuclid’s Algorithm
Purpose->
To find the greatest common divisor (gcd) of two numbers. Euclid’s algorithm is the most efficient for finding gcd’s with numbers "a" and "b" both greater than zero.Example:
Why does Euclid's Algorithm work?
Let "x" be a common of "a" and "b"
a=kx b=lx
substitute into a=bq+r
kx=lxq+r
ó r=(k-lq)x ó "x" divides "r"this means that every divisor of "a" and "b" divides "r"
b=yp r=ys
a=bq+r
ó a=ypq+ys ó a=y(pq+s) ó a=(integer)y ó a=yzso all divisors of "b" and "r" also divide "a"
ó the greatest members of each set are the same
Diophantine Equations
Goal->
To solve or show no integer solution(s) to the equations:i. ax+by=1 ii. ax+by=k
Theorem #1->
The equation ax+by=(a,b) -as in gcd- always has integer solutions.Theorem #2->
ax+by=k has integer solutions if and only if (a,b)/kIn order to find these integer solutions we use Euclid's Algorithm backwards.
Example:
find integer solutions to 56x+72y=8Euclid's Algorithm Procedures: (72,56)
72=56(1)+16
56=16(3)+8
16=8(2)+0
Backwards: 8=56-16(3)
8=56-3(72-56)
8=56(4)+72(-3)
x=4 and y=-3
Modular Arithmetic
Definition->
aº b(mod n)ó
a-b=kn for some kó
a-b is divisible by nExample
: 5º 2(mod 3)5-2=3(1)
Definition->
[x] in mod n ó {yú xº y(mod n)}Example
in mod 5 of the equivalence class [3][3]=?
[3]={…3, 8, 13, 18,…}
Definition
of Z5[0] [1] [2] [3] [4]
Z5 can also have multiplication and addition. Multiply and add the numbers as you would normally do and assign the solution to the correct equivalence class.
Example:
[3]Ä[4]=[3x4]=[12]=[2]Multiplicative Inverses
For Zn if n=p, a prime number, then all multiplicative inverses exist, and if "x" and "y" are not equal then [x]
Ä[y] is not equal zero.Proof:
if n=p all numbers in Zp have multiplicative inversesLet "x" be any member of Zp. We want to show that there is always a "y" such that [x]
Ä[y]º k(mod p)xy-1=kp for some k
xy-kp=1
gcd=1
Mersenne Primes
A Mersenne prime is any prime number of the form p=2n-1. Not all of these numbers are prime though. By using these primes in the formula 2n-1(p) you are able to get perfect numbers whose factors excluding itself add up to the same number. Two of these numbers are 6 and 28.