The Day I “Got” Public Key Encryption … Here’s The Mod Root
The day that I really got public key cryptography was when I realised why we used prime numbers and the modulus operation. Basically, we could perform any maths operation we wanted, and could then reverse it. So we could add:
c = a + b (mod p)
and which has the same result as:
c = a (mod p) + b (mod p) (mod p)
We could then multiply and reverse it with a divide (which is known as an inverse mod). Basically, we have a ring caused by the prime number (p), and where the values go between 0 and p-1. The laws that we then create are the Identity, Associated and Commutative laws:
Identity Law
a + 0= 5
0 + a= 5
Associate Law
a+(b+c)= 15
(a+b)+c= 15
Commutative Law
a+b= 27
b+a= 27
Identity Law
a * 1= 6
1 * a= 6
Associate Law
a*(b*c)= 13
(a*b)*c= 13
Commutative Law
a*b= 24
b*a= 24
These laws are normal in our maths, and where a*b is the same as b*a. You can learn more here:
https://asecuritysite.com/principles_pub/rings
If you don’t know it, the (mod) operation is the remainder from an integer division, and in cryptography, we are typically only interested in the remainder.