Metadata-Version: 2.1
Name: django-aesfield
Version: 3.1.0
Summary: Django Model Field that supports AES encryption
Home-page: https://github.com/andymckay/django-aesfield
Author: Andy McKay
Author-email: andym@mozilla.com
Maintainer: Christopher Grebs
Maintainer-email: cg@webshox.org
License: BSD
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security :: Cryptography
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Framework :: Django
Provides-Extra: tests
License-File: LICENSE.rst

AES Field
=========

Provides an AES field for Django that does AES encryption and decryption
using `m2secret-py3`_, a Python wrapper for OpenSSL.

.. _m2secret-py3: https://pypi.python.org/pypi/m2secret-py3

Usage
-----

Like any other field::

    from aesfield.field import AESField

    class SomeModel(...):
        key = AESField()

Configuration
-------------

AESField takes the following parameters beyond a normal CharField:

* `aes_prefix`: the prefix to use on fields, defaults to `aes:`

* `aes_key`: the key to use in the lookup method to find a suitable key for
  this field, defaults to `default`

Settings:

* `AES_METHOD`: the module to look in for a key lookup method, if you want
  something different from the default, `aesfield.default`

* `AES_KEYS`: used by the `aesfield.default` method. It's a dictionary of keys
  to filenames. Those files must be able to be read by the Django process. It
  must have a `default` key, unless you specify a specifc one in `aes_key`

Commands
--------

If you add `aesfield` to `INSTALLED_APPS` you'll get one more command,
`generate_aes_keys`. This will generate a new file for each file mentioned in
the `AES_KEYS` dictionary. *But only if that file does not already exist*.
