I know that in Diffie Hellman, the final key (from Bob's point of view the final key is calculated as follows)
KB = (gx mod n)y mod n, wherex represents Alice's private no. y represents Bob's private no. g and n the two public nos.
which can be evaluated as
K = (gxy mod n) OR (gyx mod n), wherex represents Alice's private no. y represents Bob's private no. g and n the two public nos.
My question is that How does KB = (gx mod n)y mod n evaluates to K = (gxy mod n) OR (gyx mod n). Does the mod operator has a property where (gx mod n)y mod n evaluates to gxy mod n?
mod nin(g^x mod n)^y(I have now edited the question) so should your answer be(a mod n).(b mod n) = (ab mod n) mod n? – Zaid Khan Jul 10 '16 at 09:59