bin-utils/pass_ssha_salt.py

5 lines
202 B
Python
Raw Normal View History

2015-05-30 16:42:42 +00:00
#!/usr/bin/env python
import base64, getpass, hashlib, os
salt = os.urandom(8) # edit the length as you see fit
print '{SSHA}' + base64.b64encode(hashlib.sha1(getpass.getpass() + salt).digest() + salt)