Skip to main content

A field for database backed password crypto

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_cryptofield-0.1.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file django_cryptofield-0.1.tar.gz.

File metadata

File hashes

Hashes for django_cryptofield-0.1.tar.gz
Algorithm Hash digest
SHA256 7bce4190d129e023eab6c5c9d0ed236111d2b66fc40c79e15a6057a2aca8f4ff
MD5 315c9737c3b68e3da246ba94e51bacb2
BLAKE2b-256 949e436d82ce81d297f5567fdcdb109f4a5329f74c6d3f9fefbeb70c0ab02116

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page