Misc - Not really random
495 points | 25 solves
Description
Downloads
Solution
import random
import time
import hashlib
seed = round(time.time())
random.seed(seed, version=2)
while True:
rand = random.random()
has = hashlib.sha256(str(rand).encode()).hexdigest()
flag = f"CTF{{{has}}}"
if "7a2" in has:
with open("./flag", "w") as f:
f.write(flag)
break
else:
print(f"Bad random value: {rand}")
Last updated