I am a beginner in cryptography. I studied the Elgamal algorithm.
secret key= (p,g,a)
Encryption= c1=(g^k mod p) , c2=(m.B^k mod p) // 0<k<p-1
Decryption= c1^(p-1-a)*c2 mod p
A simple example for decryption:
a=4
p=7
g=3
c1=2 , c2=3
decrypted message= 2^(7-1-4)*3 mod 7 = 2^(2)*3 mod 7 = 4*3 mod 7 = 12 mod 7 = 5
Numbers in the example are very small (2^2 *3), If they were very big numbers, How can I compute them?(power and multiplication)
Thanks