<<  Algebra`FiniteFields`
Prime[Range[100]]

p = Prime[57]

PowerList [GF[p, 1]]

g = PowerList [
          GF[p, 1]][[2]]

xA  =  Random[Integer, p]
xB  =  Random[Integer, p]

yA  =  PowerMod[g, xA, p]
yB  =  PowerMod[g, xB, p]

kA  =  PowerMod[yB, xA, p]
kB  =  PowerMod[yA, xB, p]