summaryrefslogtreecommitdiff
path: root/docs/lib/passlib.hash.postgres_md5.rst
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2011-01-31 23:34:37 +0000
committerEli Collins <elic@assurancetechnologies.com>2011-01-31 23:34:37 +0000
commit0eafd59fcee89cf4769add43c057a11e62c49a3a (patch)
tree19b476c6317f76ce39140900d1d671440aef34ae /docs/lib/passlib.hash.postgres_md5.rst
parent8903ccd8ecf8b26cd5e80466eecfdd8df140482b (diff)
downloadpasslib-0eafd59fcee89cf4769add43c057a11e62c49a3a.tar.gz
updated docs
Diffstat (limited to 'docs/lib/passlib.hash.postgres_md5.rst')
-rw-r--r--docs/lib/passlib.hash.postgres_md5.rst33
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/lib/passlib.hash.postgres_md5.rst b/docs/lib/passlib.hash.postgres_md5.rst
new file mode 100644
index 0000000..0b75dd5
--- /dev/null
+++ b/docs/lib/passlib.hash.postgres_md5.rst
@@ -0,0 +1,33 @@
+==================================================================
+:mod:`passlib.hash.postgres_md5` - Postgres MD5 password hash
+==================================================================
+
+.. module:: passlib.hash.mysql_md5
+ :synopsis: Postgres MD5 password hash
+
+Stats: 512 bit checksum, username used as salt
+
+This implements the md5-based hash algorithm used by Postgres to store
+passwords in the pg_shadow table.
+
+This algorithm shouldn't be used for any purpose besides Postgres interaction,
+it's a weak unsalted algorithm which could be attacked with a rainbow table
+built against common user names.
+
+.. warning::
+ This algorithm is slightly different from most of the others,
+ in that both encrypt() and verify() require you pass in
+ the name of the user account via the required 'user' keyword,
+ since postgres uses this in place of a salt :(
+
+Usage Example::
+
+ >>> from passlib.hash import postgres_md5 as pm
+ >>> pm.encrypt("mypass", user="postgres")
+ 'md55fba2ea04fd36069d2574ea71c8efe9d'
+ >>> pm.verify("mypass", 'md55fba2ea04fd36069d2574ea71c8efe9d', user="postgres")
+ True
+
+.. todo::
+
+ find references