Photo by Nick Hillier on Unsplash

The Beauty of Finding Prime Numbers

--

You might not know it, but your core online security is dependent upon the magic of prime numbers. These special numbers are used in public-key encryption, such as for RSA and Elliptic Curve, and allow us to create puzzles which are easy to solve if you know a secret, but extremely difficult if you don’t know it. Overall we create a private key and a public key, and where we can sign (or encrypt) something with our private key, and then prove we have signed it with our public key.

The magic happens because of finite fields, and where we can mathematically operate on values using the mod of the prime number (mod p). And, so, these are all correct [demo]:

a (mod p) x b (mod p) = ab (mod p)
a (mod p) + b (mod p) = (a + b) (mod p)
a (mod p) — b (mod p) = (a — b) (mod p)

Where (mod p) is the remainder from an integer divide. Basically the (mod p) operation supports [here]:

Associate Law:
a+(b+c) (mod p)= (a+b)+c (mod p)
(a (b.c)) (mod p) = ((a.b) c) (mod p)

Commutative Law:
(a+b) (mod p) = (b+a) (mod p)
(a*b) (mod p) = (b*a) (mod p)

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.