-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpa6.py
executable file
·45 lines (37 loc) · 1.62 KB
/
pa6.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
import gmpy2
from gmpy2 import mpz, powmod
N=[
mpz(
'17976931348623159077293051907890247336179769789423065727343008115\
77326758055056206869853794492129829595855013875371640157101398586\
47833778606925583497541085196591615128057575940752635007475935288\
71082364994994077189561705436114947486504671101510156394068052754\
0071584560878577663743040086340742855278549092581'),
mpz(
'6484558428080716696628242653467722787263437207069762630604390703787\
9730861808111646271401527606141756919558732184025452065542490671989\
2428844841839353281972988531310511738648965962582821502504990264452\
1008852816733037111422964210278402893076574586452336833570778346897\
15838646088239640236866252211790085787877'),
mpz(
'72006226374735042527956443552558373833808445147399984182665305798191\
63556901883377904234086641876639384851752649940178970835240791356868\
77441155132015188279331812309091996246361896836573643119174094961348\
52463970788523879939683923036467667022162701835329944324119217381272\
9276147530748597302192751375739387929'),
mpz(
'22096451867410381776306561134883418017410069787892831071731839143676\
13560012053800428232965047350942434394621975151225646583996794288946\
07645420405815647489880137348641204523252293201764879166664029975091\
88729971690526083222067771600019329260870009579993724077458967773697\
817571267229951148662959627934791540')
]
class RSA_cracker:
def __init__(self, cipher):
self.cipher = cipher
def toPrint(self):
print 'Cipher: ', self.cipher
rsa_cracker = RSA_cracker(N[0])
rsa_cracker.toPrint()
print 'hello, world'