-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path22.py
More file actions
executable file
·31 lines (25 loc) · 793 Bytes
/
22.py
File metadata and controls
executable file
·31 lines (25 loc) · 793 Bytes
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
#!/usr/bin/env python3
from random import randint
import time
from mycrypto.random import MT19937
def unix_time():
return int(time.time())
if __name__ == '__main__':
secs = randint(40, 1000)
print(f'Sleeping for {secs} seconds...')
time.sleep(secs)
seed = unix_time() - randint(40, 1000)
randnum = MT19937(seed).get()
secs = randint(40, 1000)
print(f'Number generated. Sleeping for another {secs} seconds...')
time.sleep(randint(40, 1000))
offset = 0
ctime = unix_time()
print('Cracking seed...')
while True:
current_randnum = MT19937(ctime + offset).get()
if current_randnum == randnum:
assert ctime + offset == seed
print(f'Seed found: {ctime + offset}')
break
offset -= 1