summaryrefslogtreecommitdiff
path: root/password/openbsd/genpwd.py
diff options
context:
space:
mode:
Diffstat (limited to 'password/openbsd/genpwd.py')
-rwxr-xr-xpassword/openbsd/genpwd.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/password/openbsd/genpwd.py b/password/openbsd/genpwd.py
new file mode 100755
index 0000000..a64de57
--- /dev/null
+++ b/password/openbsd/genpwd.py
@@ -0,0 +1,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())