ElGamal
Nο»Ώ
positive integer
pο»Ώ
prime number
greatest common divisor GCD
The highest number that is shared by the factorization of two numbers.
Modular inverse
If
gcd(x,N)=1ο»Ώ
then
βxβ1:xβ
xβ1=1ο»Ώ
Set of invertible elements inZNβο»Ώ
ZNββ:={xβZNββ£gcd(x,N)=1}ο»Ώ
for prime numbers:Zpββ=Zpβ/{0}={1,2,β¦,pβ1}ο»Ώ
Euler's Theorem
βgβZpββ:Zpββ={g0,g1,g2,β¦}ο»Ώ(that can express every element)
This is not true for all elements. Somegο»Ώcan not express the entireZpββο»Ώ.
Example:
g=3ο»Ώ
β¨3β©=Z7ββ={30,31,32,33,34,35}={1,3,2,6,4,5}ο»Ώ
Order ofgο»Ώ
β£β¨gβ©β£=ordpβ(g)ο»Ώ
ord7β(3)=6ο»Ώ
(=
β£Z7βββ£ο»Ώ
)
Lagrange Theorem
βgβZpββ:(pβ1)modordpβ(g)=0ο»Ώ
βgβZpββ:(pβ1)=0ο»ΏinZordpβ(g)βο»Ώ
Fermat's little theoreminZpββο»Ώ
βp,xβZpββ:ο»Ώ
xpβ1=1ο»Ώ
xordpβ(x)=x0=1ο»Ώ
Example:47β1mod7=1ο»Ώ
Discrete logarithm - Dlog
We want a function with the following property
In
Zpββο»Ώ
:
Let prime
p>2ο»Ώ
and
ordpβ(g)=qο»Ώ
Let
f(x)=gxο»Ώ
Let
fβ1=Dloggβ(gx)=xο»Ώ
where
xβ{0,β¦,qβ2}ο»Ώ
Example:
Z11ββο»Ώ1,2,3,4,5,6,7,8,9,10ο»Ώ
Dlog2β(β
)ο»Ώ0,1,8,2,4,9,7,3,6,5ο»Ώ
There is no easy way to find a function for
Dlogο»Ώ
.
Best known algorithm: GNFS has
O(e3nβ)ο»Ώ
- only for small numbers
RSA
Factorization
For prime numbers
p,qο»Ώ
Easy to compute:
N=pβ
qο»Ώ
Hard to compute: The factors behind the result
Nο»Ώ
Euler'sΟο»Ώfunction (Euler's totient function)
Ο(N):=β£ZNβββ£ο»ΏforNβNο»Ώ
The size of a group, only with members that have an inverse in
ZNβο»Ώ
.
Examples:
Ο(N)=(pβ1)(qβ1)ο»ΏwhereN=pβ
qο»Ώ
for primes:
Ο(p)=pβ1ο»Ώ
Eulers Theorem (Generalization of Fermat)
βxβZNββ:xΟ(N)=1ο»ΏinZNβο»Ώ
That means
xβ£Z
N
βββ£=1ο»ΏinZNβο»Ώ
Chinese Remainder Theorem CRT
Let
pξ =qο»Ώ
be primes and
N=pβ
qο»Ώ
βa,bβZ:(a=bmodN)β(a=bmodp)β§(a=bmodq)ο»Ώ