summaryrefslogtreecommitdiff
path: root/docs/lib
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2016-11-22 15:47:32 -0500
committerEli Collins <elic@assurancetechnologies.com>2016-11-22 15:47:32 -0500
commit5d26ffc04d36740a1c695023e36b1ee8114dffa8 (patch)
treebfe09700a586c978b57b03f8967b11c1675ffc7d /docs/lib
parent902c38d9cb75034eef973bda772bd0dac85814ee (diff)
downloadpasslib-5d26ffc04d36740a1c695023e36b1ee8114dffa8.tar.gz
passlib.handlers.django: added support for django_argon2
* added django_argon2 wrapper & docs * added method for PrefixWrapper to generically preserve custom attrs when creating variants, so .django_name attr is persisted across .using() calls.
Diffstat (limited to 'docs/lib')
-rw-r--r--docs/lib/passlib.hash.django_std.rst73
-rw-r--r--docs/lib/passlib.ifc.rst8
2 files changed, 68 insertions, 13 deletions
diff --git a/docs/lib/passlib.hash.django_std.rst b/docs/lib/passlib.hash.django_std.rst
index 47209b5..02116c6 100644
--- a/docs/lib/passlib.hash.django_std.rst
+++ b/docs/lib/passlib.hash.django_std.rst
@@ -13,18 +13,73 @@ This module's password hashing code supports a few simple salted digests,
stored using the format :samp:`{id}${salt}${checksum}` (where :samp:`{id}`
is an identifier assigned by Django).
Passlib provides support for all the hashes used up to and including
-Django 1.4
+Django 1.10.
-.. seealso::
+..
+ .. seealso::
- * :ref:`passlib.apps.django_context <django-contexts>` -
- a set of premade contexts which mimic Django's builtin hashing policy,
- and can read all of the formats listed below.
+ * :ref:`passlib.apps.django_context <django-contexts>` -
+ a set of premade contexts which mimic Django's builtin hashing policy,
+ and can read all of the formats listed below.
-..
- * :mod:`passlib.ext.django` - a plugin that
- updates Django to use a stronger hashing scheme,
- and migrates existing hashes as users log in.
+ * :mod:`passlib.ext.django` - a plugin that
+ updates Django to use a stronger hashing scheme,
+ and migrates existing hashes as users log in.
+
+Django 1.10 Hashes
+==================
+
+Argon2
+------
+Django 1.10 added a wrapper for Argon2:
+
+.. class:: django_argon2
+
+ This class implements Django 1.10's Argon2 wrapper, and follows the :ref:`password-hash-api`.
+
+ This is identical to :class:`!argon2` itself, but with
+ the Django-specific prefix ``"argon2"`` prepended.
+
+ See :doc:`argon2 </lib/passlib.hash.argon2>` for more details,
+ the usage and behavior is identical.
+
+ This should be compatible with the hashes generated by
+ Django 1.10's :class:`!Argon2PasswordHasher` class.
+
+ .. versionadded:: 1.7
+
+This hash has the exact same structure as :mod:`passlib.hash.argon2`,
+except that it has the prefix ``argon2`` added. For example,
+the django_argon2 hash...::
+
+ argon2$argon2i$v=19$m=256,t=1,p=1$c29tZXNhbHQ$AJFIsNZTMKTAewB4+ETN1A
+
+...corresponds to the argon2 hash::
+
+ argon2i$v=19$m=256,t=1,p=1$c29tZXNhbHQ$AJFIsNZTMKTAewB4+ETN1A
+
+Django 1.6 Hashes
+=================
+Django 1.6 added one new hash:
+
+Bcrypt SHA256
+-------------
+.. autoclass:: django_bcrypt_sha256
+
+This hash has the exact same structure as :class:`~passlib.hash.bcrypt`,
+except that it has the prefix ``bcrypt$`` added. For example,
+the django_bcrypt_sha256 hash...::
+
+ bcrypt_sha256$$2a$06$/3OeRpbOf8/l6nPPRdZPp.nRiyYqPobEZGdNRBWihQhiFDh1ws1tu
+
+...has the same structure as the bcrypt hash.::
+
+ $2a$06$/3OeRpbOf8/l6nPPRdZPp.nRiyYqPobEZGdNRBWihQhiFDh1ws1tu
+
+That said, the hash is calculated slightly differently... the password
+is run through sha256(), the result encoded to lowercase hexadecimal,
+and then handed to bcrypt proper. This very similar to passlib's
+:class:`~passlib.hash.bcrypt_sha256`, and addresses the same set of issues.
.. _django-1.4-hashes:
diff --git a/docs/lib/passlib.ifc.rst b/docs/lib/passlib.ifc.rst
index 0cc99f0..7612a95 100644
--- a/docs/lib/passlib.ifc.rst
+++ b/docs/lib/passlib.ifc.rst
@@ -11,8 +11,8 @@
.. _password-hash-api:
-Overview
-========
+PasswordHash API
+================
This module provides the :class:`!PasswordHash` abstract base class.
This class defines the common methods and attributes present
on all the hashes importable from the :mod:`passlib.hash` module.
@@ -25,8 +25,8 @@ designed to parallel many of this interface's methods.
:ref:`hash-tutorial` -- Overview of this interface and how to use it.
-PasswordHash API
-================
+Base Abstract Class
+===================
.. class:: PasswordHash()
This class provides an abstract interface for an arbitrary password hasher.