– In general, one can always compute a^{-1} mod b using the extended Euclidean algorithm. The details are in my book “Introduction to Modern Cryptography.”

– In this specific case, we know that the order of the group Z^*_{71} is 70 (because 71 is prime). Since a^{70} = 1 mod 71 for any a \in Z^*_{71}, we have that a^{-1} = a^{69} mod 71 for any a.

]]>Eg:- p = 11 and g = 2. and x = 3 e =g^x mod p= 2^3 mod 11= 8. So the public keys are (2, 8, 11) and the private(secret) key is 3. Sender receives the public keys (2,8,11) chooses random value r = 4 and calculates C1 and C2 for the plaintext(m= 7).

C1=g^r mod p = 2^4 mod 11 =16 mod 11 =5

C2=m*(e^r) mod p =7*(8^4) mod 11 = 7*4096 mod 11=28672=6

sender sends (c1,c2) as (5,6)

m=C2*(C1^-1/x)) mod p=6*(5^-1/3) mod 11= 6*5^(11-1-3) mod 11= 6*5^7 mod 11=6*78125 mod 11=468750 mod 11=7 =m(plain text)

note : please do it manually so you can understand

chakravarthy

S.V.Arts College

Tirupati

andhra pradesh

India

h = g^x mod p = 2^(29) mod 107 = 17

— public key = (p,g,h) = (107,2,17)

m = 100, r = 19

— c = (g^r , (h^r)*m) mod p = (95,15)

c = (95,15)

— m = (15*(95^-1)^29) = (15 * (-9)^29) = 15 * 78 mod 107 = 100