summaryrefslogtreecommitdiff
path: root/password/openbsd/genpwd.py
blob: a64de57a1a9253139736688d48d34b3901bcfb19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python 
import sys
# you nee to install the bcrypt python library to use that script
# debian, ubuntu: sudo apt-get install python-bcrypt
import bcrypt

if len(sys.argv) != 2:
    print sys.argv[0]+" password"
    sys.exit(1)

# Hash a password for the first time
print bcrypt.hashpw(sys.argv[1], bcrypt.gensalt())