You are on page 1of 4

RSA

Number theory relating to RSA


Residue class Zn is set of non negative integers less than n
{0,1,2,3,4..(n-1)}
The residue classes mod 4 are
[0] = {,-16,-12,-8,-4, 0,4,8,12,16..}
[1] = {-15,-11,-7,-3,1,5,9,13,17,..}If we perform arithmetic within Zn, if follows all laws of usual arithmetic except

[(a mod n) + (b mod n)] mod n = (a + b) mod n (follows)
[(a mod n) - (b mod n)] mod n = (a - b) mod n (follows)
[(a mod n) (b mod n)] mod n = (a b) mod n (follows)
(a + b)mod n = (a+c)mod n then b mod n = c mod n (follows, cancellation under addition)
(5 + 23) mod 8 = (5 + 7)mod8 ; 23mod 8 = 7 mod 8
(a * b )mod n = (a * c)mod n then b mod n = c mod n , only if a and n are relatively prime.



With a = 6 and n = 8
Z8 = { 0 1 2 3 4 5 6 7}
Multiply by 6 { 0 6 12 18 24 30 36 42}
Residue {0 6 4 2 0 6 4 2}

With a = 5 and n = 8
Z8 = { 0 1 2 3 4 5 6 7}
Multiply by 6 { 5 10 15 20 25 30 35 40}
Residue {0 5 2 7 4 1 6 3} (This is a permutation of Z8)

Eulers totient function

You might also like