In a DHKE scheme with the a prime p = 467. an element g = 4. The element 4 has order 233 and generates thus a subgroup with 233 elements. after Computing the common key for A. a=400, b=134 B. a=167, b=134 the session keys are identical = 161

Can someone tell me the answer as to why the key is the same for both schemes given different values for a ?


Since $\gcd(2,467)=1$, one can observe using Fermat's little theorem that $4^{233}\pmod{467}=2^{466}\pmod{467}=1$.


This results into identical session keys (shared secrets) $S=(g^a)^b=89^{134}\equiv161\pmod{467}$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.