From The Compiler, 6 Years ago, written in Python.
Embed
  1. import hashlib
  2. import base64
  3. import re
  4.  
  5. def b64_md5(string):
  6.         md5 = hashlib.md5(string.encode('UTF-8')).digest()
  7.  
  8.         altchars = '98'.encode('ASCII')
  9.         b64 = base64.b64encode(md5, altchars)
  10.         b64 = b64.decode('ASCII').replace('=', 'A')
  11.  
  12.         return(b64)
  13.  
  14. def sgp_gen(pwd, length):
  15.         for i in range(10):
  16.                 pwd = b64_md5(pwd)
  17.  
  18.         while not re.match('^[a-z].*[A-Z0-9].*', pwd[:length]):
  19.                 pwd = b64_md5(pwd)
  20.  
  21.         return(pwd[:length])
  22.  
  23. def sgp(domain, password, length=10, salt=""):
  24.         pwd = password + salt + ':' + domain
  25.         pwd = sgp_gen(pwd, length)
  26.         return(pwd)

Replies to sgp rss

Title Name Language When
RE: sgp anonymous python 6 Years ago.