-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathdachshund.py
18 lines (12 loc) · 1.16 KB
/
dachshund.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# the main purpose of the program is to solve for d, and decrypt the message
import owiener
c = 51729254814612320597643328450085959536599727372680938760771949307679773005615308695648114596258975136775968889388756216401496118257971113771919925769604554578645725822883285841825381936016630539284003180253228150727414300152034618534378132051795168049160397854013369582290350212981743918731826059625571659195
e = 26708677238429428374170262208931535733743911260604248499407092969454401069520229604707421630650361943655516583033522359546446670546154254638564481680864845797555129549483370241281955795119447253220108830835178572671949509316867647933241089013588496517578768012481040939437738400995777121296915356470885241301
n = 102050270322368919270668432655276557677924971440195120212230040263372875358539516722287129116966588442412373177849929844163493405962383401732877189240511737479294203917101072408029656805628085793609392233931279848866908950627490592662932946058562223278970874388262808195065269805169207346022676107536878090839
d = owiener.attack(e, n)
if d is None:
print("Failed")
else :
print("Found d: = {}".format(d))
M = pow(c, d, n)
print("Decrypted message: ", M)