-
Notifications
You must be signed in to change notification settings - Fork 0
/
decryption.py
53 lines (48 loc) · 1.23 KB
/
decryption.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
__author__ = 'Cyber-01'
import hashlib
import multiprocessing
encrypted="EC9C0F7EDCC18A98B1F31853B1813301".lower()
flag=None
def init(args):
global flag
flag=args
def decryptor(info):
print(encrypted)
start=long(info[0])
end=long(info[1])
percentage=0
jumps=(end-start)/100
recorder=jumps
global flag
while start < end and flag.value == 0:
md5format = hashlib.md5(str(start)).hexdigest()
if md5format == encrypted:
flag.value=1
return str(start)
start += 1
if recorder<=0 :
percentage+=1
print percentage
recorder=jumps
recorder-=1
def divider(parts, start , end):
jump= end- start
jump=jump/parts
sections=[]
for times in range(parts):
sections.append([start,start+jump])
start=start+jump
return sections
def main():
print encrypted
procecess=[]
start = 1000000000
end = 9999999999
devision=divider(8,start,end,)
pool= multiprocessing.Pool(initializer = init, initargs = (flag, ))
x=pool.map_async(decryptor,devision,chunksize = 1)
print x.wait()
print x.get()
if __name__=="__main__":
flag = multiprocessing.Value('i', 0)
main()