forked from yanapermana/metadecryptor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dasilva3.py
39 lines (36 loc) · 897 Bytes
/
dasilva3.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
from lib3 import *
def Nrev(N):
return int(str(N)[::-1])
def dasilva(N):
Nv = Nrev(N)
stop = False
r = 2
while stop == False:
if gcd(N, Nv+r) != 1:
return gcd(N, Nv+r), int(N/gcd(N, Nv+r))
stop = True
if gcd(N, 2*Nv+r) != 1:
return gcd(N, 2*Nv+r), int(N/gcd(N, 2*Nv+r))
stop = True
if gcd(N, Nv-r) != 1:
return gcd(N, Nv-r), int(N/gcd(N, Nv-r))
stop = True
if gcd(N, 2*Nv-r) != 1:
return gcd(N, 2*Nv-r), int(N/gcd(N, 2*Nv-r))
stop = True
if gcd(N, Nv*r+1) != 1:
return gcd(N, Nv*r+1), int(N/gcd(N, Nv*r+1))
stop = True
if gcd(N, Nv*r+2) != 1:
return gcd(N, Nv*r+2), int(N/gcd(N, Nv*r+2))
stop = True
if gcd(N, Nv*r-1) != 1:
return gcd(N, Nv*r-1), int(N/gcd(N, Nv*r-1))
stop = True
if gcd(N, Nv*r-2) != 1:
return gcd(N, Nv*r-2), int(N/gcd(N, Nv*r-2))
stop = True
r += 1
if __name__ == '__main__':
N = 143
print(dasilva(N))