summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@dev.spline.de>2008-12-11 10:33:19 +0100
committerroot <root@dev.spline.de>2008-12-11 10:33:19 +0100
commit28b77189402889e4d82cc7ab8fdb9267d3485c16 (patch)
treec31ffab8ae28cf143c9e59fe25535509eb3ea62a
parent0f7ed51935e8a49af547b75842a494b265eb90d2 (diff)
downloaddev-account-28b77189402889e4d82cc7ab8fdb9267d3485c16.tar.gz
dev-account-28b77189402889e4d82cc7ab8fdb9267d3485c16.tar.xz
dev-account-28b77189402889e4d82cc7ab8fdb9267d3485c16.zip
add password helper
-rw-r--r--gen_password.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gen_password.py b/gen_password.py
new file mode 100644
index 0000000..19b7781
--- /dev/null
+++ b/gen_password.py
@@ -0,0 +1,6 @@
+import base64, cracklib, sha, string, os
+
+# generate a htpasswd compatible sha1 digest in base64 encoding
+# see: http://httpd.apache.org/docs/2.2/misc/password_encryptions.html
+def generate_sha_base64(password):
+ print "{SHA}" + base64.encodestring(sha.new(password).digest()).rstrip('\n')