Skip to content

Instantly share code, notes, and snippets.

@fovtran
Last active December 18, 2015 15:29
Show Gist options
  • Save fovtran/5804344 to your computer and use it in GitHub Desktop.
Save fovtran/5804344 to your computer and use it in GitHub Desktop.
email list HMAC digester by their names using a single passkey
#!/usr/bin/python
#
import base64
import hmac
import hashlib
import sys,os
mainpass="mysupersecreto"
sitelist = []
digest = hmac.new(mainpass, '', hashlib.sha1)
def digesto_incremental():
f = open("guestlist.txt", "rb")
try:
while True:
line = f.readline()
if not line:
break
sitelist.append(line)
finally:
f.close()
def digestar():
for site in sitelist:
digest.update(site)
r = digest.hexdigest()
print site,":", base64.encodestring(r)
digesto_incremental()
digestar()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment