flava wrote:Anyone have any ideas for a quick way to find d where de % m = 1 and m = (p -1)(q - 1)?
# Find d
mult = 1
d = 1
while ((d*e) % m) != 1 & bool(d == math.floor(d)):
d = ((int(m)*mult) + 1) / (e ** mult)
mult += 1
if d == 0:
mult = 1
e = find(e) # Gets the next prime number after the current e
Users browsing this forum: No registered users and 0 guests