--- id: django-fernet-encrypted-fields version: "0.4.0" license: unclear license_treatment: unclear maintenance: active --- # django-fernet-encrypted-fields — Symmetrically encrypted model fields for Django License: unclear · Maintenance: active · Downloads: 359.1K/mo ## What it is and what it does django-fernet-encrypted-fields adds transparent encryption to Django model fields using Fernet symmetric encryption from the cryptography library. When you define an encrypted field, data is automatically encrypted before storage and decrypted on retrieval, with the encryption key managed via Django settings. The package supports key rotation through SALT_KEY, which can be a list where the first key encrypts new data and all keys are tried for decryption. It also supports SECRET_KEY rotation via SECRET_KEY_FALLBACKS for Django >=4.1. The encrypted fields maintain the same APIs as their unencrypted Django counterparts. Use it for: - Encrypt personally identifiable information in a Django database without changing application code. - Implement key rotation policies by maintaining a list of SALT_KEY values and re-saving records to migrate to new encryption keys. - Store sensitive data encrypted at rest while maintaining Django ORM access. - Migrate from an older django-encrypted-fields package to a maintained successor. - Comply with data protection requirements by encrypting specific model fields without a separate encryption layer. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Django model fields that encrypt data at rest using Fernet symmetric encryption, storing encrypted values in the database while maintaining a standard Django field API. Yes, with conditions. The package is actively maintained, has low install friction, and solves a real problem for encrypting sensitive Django model fields. However, verify the license status before use—the metadata shows no SPDX or raw license text. Requires Python >=3.10 and Django 4.2+, so confirm compatibility with your project's versions. ## Install pip install django-fernet-encrypted-fields uv add django-fernet-encrypted-fields poetry add django-fernet-encrypted-fields ## Installing django-fernet-encrypted-fields Before you install: Low install friction with only two runtime dependencies (Django and cryptography). The package is actively maintained with a recent release and no known vulnerabilities. License in practice: License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before use in commercial or proprietary projects. Quickstart: pip install django-fernet-encrypted-fields # In settings.py SALT_KEY = '0123456789abcdefghijklmnopqrstuvwxyz' # In models.py from django.db import models class MyModel(models.Model): text_field = EncryptedTextField() Requires Python >=3.10 and Django 4.2 or later. Verify before relying: - Which specific encrypted field types are available and their exact APIs. - Whether key rotation via SALT_KEY list works with all supported Django versions. - Performance impact of encryption/decryption on query performance and bulk operations. - How SECRET_KEY_FALLBACKS interacts with the SALT_KEY rotation mechanism. ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 359.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django encrypted fields, fernet encryption django, database field encryption, django data at rest encryption, symmetric encryption django models, encrypted model fields, django cryptography fields, django-orm, encryption-at-rest, key-rotation [View on SkillFed](https://skillfed.io/packages/django-fernet-encrypted-fields) · [View on PyPI](https://pypi.org/project/django-fernet-encrypted-fields/)