bin-utils/pass_ssha_salt.py

5 lines
202 B
Python
Executable File

#!/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)