Calculate the DLP of 9916780 = (5**y) mod 20876441?

91 views
Skip to first unread message

Madison Adams

unread,
May 13, 2020, 12:11:57 AM5/13/20
to sage-support
Hi,
So my goal is to find the variable y of this equation.
Does sage math provide a function for Discrete Logarithm Problems?

The equation is this: 9916780 = (5**y) mod 20876441.
I also would like to know if there is an efficient way to do this in Python 3.


GZ D

unread,
May 13, 2020, 6:00:37 AM5/13/20
to sage-support
You can use a function called discrete_log, and I have shown you a script below.

m=5
c=9916780
n=20876441
m=Mod(m,n)
c=Mod(c,n)
print(discrete_log(c,m))

在 2020年5月13日星期三 UTC+8下午12:11:57,Madison Adams写道:

Madison Adams

unread,
May 13, 2020, 9:04:02 AM5/13/20
to sage-support
From running this script do you get the value y = 17?  I used a wolfram calculator just to be sure.

GZ D

unread,
May 18, 2020, 12:25:54 AM5/18/20
to sage-support
Yes, I get the answer y = 17.

在 2020年5月13日星期三 UTC+8下午9:04:02,Madison Adams写道:
Reply all
Reply to author
Forward
0 new messages