Maybe printing the values makes it clearer? sage: R = Integers(125) sage: g = R.multiplicative_generator(); g 2 sage: b = g^3; b 8 sage: a = b^17; a 123 sage: a.log(b) 17
So, 123 = 8^(17) mod 125: sage: R(123).log(8) 17 sage: R(123) == R(8)^(17) True On Dec 4, 2007 5:59 AM, Timothy Clemans <[EMAIL PROTECTED]> wrote: > > Hi I want to know how to compute discrete logarithms in Z_p, but I > can't seem to understand the explanation on > http://modular.math.washington.edu/sage/doc/html/const/node63.html > > I understand that 125 in "sage: r = Integers(125)" is m but what is 3 > and what is 17? Is 3 a or is it b? > > When I tried to figure it out: > "print Mod(3^17,125) > print Mod(17^17,125)" > I got > "38 > 52" > neither of which is 17 nor 3. > > Could someone please give me a clear example of computing a discrete > logarithm in Z_p. Like maybe using b = 25, a = 2, and m = 23. > > It would be nice if there was a function in Sage for computing this > since this kind of computation is the basis for analysis of > Diffie-Hellman which a lot of people learn about. > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---