Guest User

tripcode gen

a guest
Aug 31st, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import hashlib, base64
  2. import re, sys
  3.  
  4. def main():
  5.     if len(sys.argv) != 2:
  6.         print("Give a regular expression as a command-line argument")
  7.         return
  8.     matcher = re.compile(sys.argv[1])
  9.     with open("/dev/urandom", "rb") as f:
  10.         for i in xrange(0, 1000000000): # 10000000
  11.             passpfx = base64.b64encode(f.read(5))[:-2]
  12.             for sfx in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789":
  13.                 password = passpfx + sfx
  14.                 trip = base64.b64encode(hashlib.sha256(password).digest())[0:6]
  15.                 if matcher.match(trip):
  16.                     print((password, trip))
  17. main()
  18.  
Add Comment
Please, Sign In to add comment