summaryrefslogtreecommitdiff
path: root/docs/lib/passlib.hash.plaintext.rst
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2011-03-14 17:36:41 -0400
committerEli Collins <elic@assurancetechnologies.com>2011-03-14 17:36:41 -0400
commit5076cf146f56122ed712f17849dfbc782ca36e93 (patch)
tree1d1527de8b50554ed9a641599e61f9ede557e23e /docs/lib/passlib.hash.plaintext.rst
parente7d9b1e3513c69df6ff580d499c5e4615cff069e (diff)
downloadpasslib-5076cf146f56122ed712f17849dfbc782ca36e93.tar.gz
supporting hashes added
======================= * added unix_fallback scheme, for detecting wildcard/disabled passwords in /etc/shadow files * added plaintext scheme, for migrating existing application * added hex md4/md5/sha1/sha256/sha512 schemes, for migrating existing applications * docs & UTs added for above schemes
Diffstat (limited to 'docs/lib/passlib.hash.plaintext.rst')
-rw-r--r--docs/lib/passlib.hash.plaintext.rst35
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/lib/passlib.hash.plaintext.rst b/docs/lib/passlib.hash.plaintext.rst
new file mode 100644
index 0000000..d0ad62d
--- /dev/null
+++ b/docs/lib/passlib.hash.plaintext.rst
@@ -0,0 +1,35 @@
+==================================================================
+:class:`passlib.hash.plaintext` - Plaintext
+==================================================================
+
+.. currentmodule:: passlib.hash
+
+This class stores passwords in plaintext.
+This is, of course, ridiculously insecure;
+it is provided for backwards compatibility when migrating
+existing applications. *It should not be used* for any other purpose.
+
+Usage
+=====
+This class is mainly useful only for plugging into a :class:`passlib.base.CryptContext`.
+When used, it should always be the last scheme in the list,
+as it will recognize all hashes.
+It can be used directly as follows::
+
+ >>> from passlib.hash import plaintext as pt
+
+ >>> #"encrypt" password
+ >>> pt.encrypt("password")
+ 'password'
+
+ >>> nt.identify('password') #check if hash is recognized (all hashes are recognized)
+ True
+
+ >>> nt.verify("password", "password") #verify correct password
+ True
+ >>> nt.verify("secret", "password") #verify incorrect password
+ False
+
+Interface
+=========
+.. autoclass:: plaintext