Algorithms from An Introduction to Mathematical Cryptography book.
Here, Bob sends an encrypted message to Alice using ElGamal public key cryptosystem.
Download code from here
Extended Euclidean algorithm
Matlab code for modular inverse:
Here, Bob sends an encrypted message to Alice using ElGamal public key cryptosystem.
Download code from here
Extended Euclidean algorithm
Matlab code for modular inverse:
[u,y,d] = gcd(x,p); y = mod(y,p);