Cryptography: ECDSA

Overview "If you can't explain it simply, you don't understand it well enough" Albert Einstein Elliptic curve cryptography (ECC) and digital signature algorithm (ECDSA) are more complex than RSA or ElGamal but I will try my best to hide the hairy math and the implementation details. Here is the ELI5 version in 18 lines of SageMath / Python code. I use Sage because it provides elliptic curves as first-class citizens (`FiniteField` and `EllipticCurve`) and we can take multiplication operation for granted. [Read More]

Cryptography: ElGamal

Overview "If you can't explain it simply, you don't understand it well enough" Albert Einstein ElGamal is a public key cryptosystem that is used in encryption , digital signature and homomorphic cryptography. Here is my take in 12 lines of Python code: 1 p = 7 2 g = [x for x in range(1, p) if len(set([x**i % p for i in range(1, p)])) == p-1][0] 3 k = 4 4 t = g**k % p 5 m = 6 6 import random 7 r = random. [Read More]