• R/O
  • SSH

MakePW: Commit

The main repository. Contains both Python and Javascript implementations.


Commit MetaInfo

Revision321bd15ccd3bba860eca3fba9b3b3d0f1eb248ab (tree)
Time2012-06-21 08:17:47
AuthorEric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

A small program to generate passwords for websites.

Change Summary

Incremental Difference

diff -r 000000000000 -r 321bd15ccd3b makepw.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/makepw.py Wed Jun 20 16:17:47 2012 -0700
@@ -0,0 +1,18 @@
1+#!/usr/bin/python
2+
3+import binascii
4+import hmac
5+import hashlib
6+import getpass
7+
8+try:
9+ readstr = raw_input
10+except NameError:
11+ readstr = input
12+
13+hasher = hmac.HMAC(key=getpass.getpass().encode('utf-8'),
14+ digestmod=hashlib.sha256)
15+sitename = readstr("Last two components of site name (aka slashdot.org): ")
16+hasher.update(sitename.encode('utf-8'))
17+result = binascii.b2a_base64(hasher.digest()).decode('ascii')
18+print('0' + result[0:5] + '*' + result[5:10] + 'l')
Show on old repository browser