Files
brute-force-hello-world/brute_force_hello_world.py
Daniel Cortes caddf8a767 initial commit
2020-05-22 01:51:01 -04:00

21 lines
421 B
Python
Executable File

import time
import sys
import random
import string
target = 'Hello, World!'
guess = list('*'*len(target))
for i, c in enumerate(target):
while True:
cc = random.choice(string.ascii_letters + string.punctuation + " ")
guess[i] = cc
sys.stdout.write(f"\r{''.join(guess)}")
sys.stdout.flush()
time.sleep(0.01)
if cc == c:
break
print('\n\nACCESS GRANTED')