Django Model Field that supports AES encryption
Project description
AES Field
=============
Provides an AES field for Django that does AES encryption and decryption
using `m2secret-py3`_, a Python wrapper for OpenSSL.
.. _M2Crypto: 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*.
=============
Provides an AES field for Django that does AES encryption and decryption
using `m2secret-py3`_, a Python wrapper for OpenSSL.
.. _M2Crypto: 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*.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-aesfield-2.1.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for django_aesfield-2.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e571e08812fef8a873cfa09b7a4eb3af02a1e422e3b6cede10834738a8cf1fd |
|
MD5 | 97ed7b6f01b91b73a62356a3df140c0f |
|
BLAKE2b-256 | b1889b8f9dee27f234368231b084c6421607014c9f4d6ca0f2302e7ead347ed3 |