Django-fields is an application which includes different kinds of models fields.
Right now, application contains two fields with encryption support: EncryptedCharField and EncryptedTextField.
- Fixed: Django admin needs to be able to create blank instances of the fields in order to create a new model. This broke with
BaseEncryptedNumberField. (via defrex)
block_typewasn't added to the south rules. (via defrex)
- Fixed: Newer code paths with
block_typespecified couldn't reuse the
cipherobject on the field class.
to_pythonwas already redefining it before decrypting the value, but
get_db_prep_valuewasn't before encrypting. The first time you used a model it would be fine, but the second would fail. Thus the tests were passing but the classes were functionally useless in an application. (via defrex)
EncryptedUSSocialSecurityNumberField, which handles the special-case logic of validating and encrypting US Social Security Numbers, using
django.contrib.localflavor.us.forms.USSocialSecurityNumberField. (via Brooks Travis)
- Fixed: Issue #21.
django_fields.fields.BaseEncryptedFieldnow supports specification of cipher
block_typevia keyword argument. (via kromem)
- Added: Deprecation warning for fields that do not specify a
- Added: Class
django_fields.models.ModelWithPrivateFields, which allows to use private fields, starting from two underscores.
- Changed: Now virtualenv is used for test enviroment. Buildout.cfg was removed.
- Changed: Buildout file was changed to test against Django 1.2.5 and include
- Added: South support.
- Added: Unit tests and associated utility functions.
- Fixed: Deprecation warnings related to the settings in example project.
- Fixed: Deprecation warnings, related to
- Fixed: Edge case in encryption consistency.
EncryptedCharFieldnow enforces max length.
- Added: Encrypt field.
- Added: Buildout config and example application.
- Fixed: Issue #1 - "
EncryptedCharFieldraises a traceback in the django admin".
- Changed: Now
__import__compatible with python 2.4 in
- Changed: Code was moved to
- Changed: Get rid of custom string class. It was replaced with string prefix.
- Changed: Settings were changed to test with mysql.
This application depends on python-crypto, which can be found in many Linux repositories, or downloaded from http://www.dlitz.net/software/pycrypto/.
Under Ubuntu, just do:
sudo apt-get install python-crypto
Examples can be found at the
examples directory. Look at the,
Same project is used to run unittests. To run them, just fire
- zbyte64 — thanks to for his django snippet for encrypted fields. After some fixes, this snippet works as supposed.
- John Morrissey — for fixing bug in PickleField.
- Joe Jasinski — different fixes and new fields for encripted email and US Phone.
- Colin MacDonald — for many encripted fields added.
- Igor Davydenko — PickleField.
- kromem - Added support for specifying
block_typeon encrypted fields.
- Brooks Travis - new field for encrypted US Social Security Number and other fixes.