summaryrefslogtreecommitdiff
path: root/docs/lib/passlib.hash.plaintext.rst
blob: 2b1fb91c33ef93474d0cb4286e2210a005c89083 (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
==================================================================
: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.
This class should always be the last algorithm checked, as it will recognize all hashes.
It can be used directly as follows::

    >>> from passlib.hash import plaintext as plaintext

    >>> # "encrypt" password
    >>> plaintext.encrypt("password")
    'password'

    >>> # verify password
    >>> plaintext.verify("password", "password")
    True
    >>> plaintext.verify("secret", "password")
    False

.. seealso::

    * :ref:`password hash usage <password-hash-examples>` -- for more usage examples

    * :class:`ldap_plaintext <passlib.hash.ldap_plaintext>` -- on LDAP systems,
      this format is probably more appropriate for storing plaintext passwords.

Interface
=========
.. autoclass:: plaintext()