-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathFactorization.py
53 lines (44 loc) · 1.24 KB
/
Factorization.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
46
47
48
49
50
51
52
53
from banner import *
banner()
from Factorizations.factordb import *
from Factorizations.fermat import *
from Factorizations.ecm import *
from Factorizations.qs import *
print("""
[1] - Factordb Factorization \033[92m
[2] - Fermat Factorization \033[96m
[3] - ECM Factorization \033[93m
[4] - Quadratic sieve Factorization \033[95m
[0] - Exit \033[92m
""")
x = int(input(">>> "))
#Factordb
if x == 1:
n = int(input("%s\n>>> n = %s"%(B,B)))
print("\n[+] Please Wait ...\n")
def factordb(n):
f = FactorDB(n)
f.connect()
return f.get_factor_list()
print("%sprimes =%s"%(Y,Y),"%s"%(G),factordb(n))
#Fermet
elif x == 2:
n = int(input("%s\n>>> n = %s"%(B,B)))
print("\n[+] Please Wait ...\n")
fermat(n)
#ECM
elif x == 3:
n = int(input("%s\n>>> n = %s"%(B,B)))
print("\n[+] Please Wait ...\n")
print("%sprimes =%s"%(Y,Y),"%s"%(G),primefactors(n))
elif x == 4:
N = int(input("%s\n>>> n = %s"%(B,B)))
if not factorise(N):
print("Number Must Be Greater Than 0 and Must Be Integer")
elif factorise(N) == "Long":
print("N is Too Long ")
else:
print("\n[+] Please Wait ...\n")
print ("%sprimes =%s"%(Y,Y),"%s"%(G),factorise(N))
else:
exit()