blob: 1f40571322ad788f95f07bb694c6db721d1e359f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
.. index:: CryptContext; usage examples, CryptContext; overview
.. _cryptcontext-overview:
==============================================
:mod:`passlib.context` - CryptContext Overview
==============================================
.. module:: passlib.context
:synopsis: CryptContext class for managing multiple password hash schemes
Motivation
==========
Though there is a wide range of password hashing schemes,
within a specific context (like a linux "shadow" file)
only a select list of schemes will be used.
As time goes on, new schemes are added and made the default,
the strength of existing schemes is tweaked, and other schemes are deprecated entirely.
Throughout all this, existing password hashes that don't comply
with the new policies must be detected and rehashed using the
new default configuration. In order to automate as much of these tasks as possible,
this module provides the :class:`CryptContext` class.
Essentially, a :class:`!CryptContext` instance contains a list
of hash handlers that it should recognize, along with information
about which ones are deprecated, which is the default,
and what configuration constraints an application has placed
on a particular scheme. While contexts can be created explicitly,
Passlib also offers a number of predefined :class:`!CryptContext` instances
which can be used out-of-the box (see :mod:`passlib.apps` and :mod:`passlib.hosts`),
or :ref:`modified <using-predefined-contexts>` to suit the application.
Subtopics
=========
New users should see the usage examples
in the next section to get a feel for how the :class:`!CryptContext` class works.
.. toctree::
:maxdepth: 1
passlib.context-usage
passlib.context-interface
passlib.context-options
|