Skip to main content

This package provides database backed, encrypted fields for Django. The fields use database internal mechanisms to encrypt and verify strings completely inside the database. This functionality is interesting for use with passwords that are stored in a database as it allows the database to manage salting, hashing, and verification of the passwords.

Support notes

Currently only PostgreSQL is supported as a database backend. I would be happy if someone with experience in MySQL or other databases that support encryption would provide hints or implementations for their favourite database.

Usage

Using cryptofield is easy:

from django.db import models
import cryptofield

class ModelWithCrypto(models.Model):
    password = cryptofield.CryptoField()

Keyword arguments

The CryptoField class supports the following keyword arguments:

Keyword

Description

Values

algorithm

The hashing algorithm to use

bf (default), md5, xdes, des

Requirements (PostgreSQL)

To use this package with PostgreSQL, make sure that the database in use has the pgcrypto extension activated. To do so, issue the following command to the desired database:

CREATE EXTENSION IF NOT EXISTS pgcrypto;

If no error occurs, the CryptoField class can now be used with the database.

Release files for django_cryptofield 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django_cryptofield 0.2
File Size Uploaded
django_cryptofield-0.2.tar.gz 2.5 kB Details

Release files / django_cryptofield-0.2.tar.gz

Download URL django_cryptofield-0.2.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
864480e30972fb9f24f9e2d3e39c3e264f42f8f17cd1b6024791925f41de0e00
BLAKE2b-256 checksum
How to use checksums
147f4f57f0bf0305cbc29ec9fc707590b522fdb9697e715b9b4883cc8d2628cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page