Skip to content

Instantly share code, notes, and snippets.

@ebubekirtrkr
Last active January 22, 2022 21:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebubekirtrkr/99e0dc3efba9d06c310ebb9e7a5cdc2a to your computer and use it in GitHub Desktop.
Save ebubekirtrkr/99e0dc3efba9d06c310ebb9e7a5cdc2a to your computer and use it in GitHub Desktop.
Python bcyrpt example with multi-threading
import concurrent.futures
import bcrypt
VERBOSE=False
output_file=open("bcrypted_passwords.txt","w+")
def do_bcyrpt(passw):
hashed =bcrypt.hashpw(passw.encode(), bcrypt.gensalt()).decode()
if VERBOSE:
print(hashed)
output_file.write(hashed+"\n")
output_file.flush()
MAX_THREADS=100
passwords = [ i for i in open("./hashcat/example.dict").read().splitlines()]
threads = min(MAX_THREADS, len(passwords))
with concurrent.futures.ThreadPoolExecutor(max_workers=threads) as executor:
executor.map(do_bcyrpt, passwords)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment