PassHash cmdline

I use the PassHash firefox extension to generate site-specific strong passwords. The idea behind the extension is that a master password and a siteTag (e.g. the domain name) is used to generate a sha1 hash. This hash is used as the password for the website. In python its essentially this code:

h = hmac.new(master_pass, site_tag, hashlib.sha1)
print(b64encode(h.digest())[:hash_len])

I want a commandline utility that can output me PassHash compatible hashes when I use w3m (or if the extension stops working for some reason).

To my delight I discovered that the upstream git repNice and hard to brute-force.o of PassHash already has a python helper to generate passhash compatible password. I added some tweaks to add pythons argparse [1] and now I'm really happy with it:

$ ./tools/passhash.py --hash-size 14 slashdot.org
Please enter the master key: 
KPXveo7bq7j1%X

Hard to brute-force and matches what the extension generates.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: