Rings
The Integer Ring $Z_m$ consists of -
- The set of {0,1,2,3… m-1}
- Two operators - plus and multiply, such that
- for all a, b,c in $Z_m$
- a+b === c mod m
- a.b === d mod m

- Closure of the ring - Multiply the ring, the result is in the ring
- Addition and multiplication are associative
- Additive inverse exits a+ (-a) = 0, exists
- multiplicative inverse exists, a. a^-1 === 1 mod m
- If gcd(x,y) == 1, then the inverse exists
- if gcd(x,y) != 1, then the inverse does not exists
Affine cipher
key - (a,b)
Encryption
$y = ax+b (mod 26)$