5 lines
202 B
Python
5 lines
202 B
Python
|
#!/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)
|