Skip to content

Commit

Permalink
pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed May 17, 2015
1 parent 6275504 commit 2c8ebe3
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
.pydevproject
.settings
.ropeproject
.pypirc
dist
south.log
*.bz2
.DS_Store
Expand All @@ -12,3 +14,5 @@ htmlcov
db.sqlite3
*.key
*.pem
build
django_crypto_fields.egg-info
Empty file added CHANGES
Empty file.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include AUTHORS CHANGES README.md LICENCE
recursive-include docs *
38 changes: 35 additions & 3 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[![Build Status](https://travis-ci.org/erikvw/django-crypto-fields.svg?branch=master)](https://travis-ci.org/erikvw/django-crypto-fields)
[![Coverage Status](https://coveralls.io/repos/erikvw/django-crypto-fields/badge.svg)](https://coveralls.io/r/erikvw/django-crypto-fields)
[![Documentation Status](https://readthedocs.org/projects/django-crypto-fields/badge/?version=latest)](https://readthedocs.org/projects/django-crypto-fields/?badge=master)
[![Documentation Status](https://readthedocs.org/projects/crypto-fields/badge/?version=latest)](https://readthedocs.org/projects/crypto-fields/?badge=latest)

django-crypto-fields
=====================

Add encrypted fields classes to your Django models.
Add encrypted field classes to your Django models.

For example:

Expand All @@ -24,6 +24,36 @@ For example:
comment = EncryptedTextField(
max_length=500)

Installation
------------

pip install django-encrypted-fields

Add to INSTALLED_APPS:

INSTALLED_APPS = (
...
'django_crypto_fields',
...
)

Add KEY_PATH to the folder in settings:

# folder where the encryption keys are stored
KEY_PATH = '/Volumes/secure_drive/keys')

Add KEY_PREFIX (optional, the default is "_user_"):

# optional filename prefix for encryption keys files:
KEY_PREFIX = 'bhp066'

Run _migrate_ to create the _crypto_fields_crypt_ table:

python manage.py migrate

Generate encryption keys:

python manage.py generate_keys

History
-------
Expand All @@ -40,10 +70,12 @@ Features
Advantages
----------

- encryption keys are automatically created
- unique constraint on encrypted fields: because the hash is stored in the model's db_table and not the secret, the unique=True parameter works as well as the django.form validation messages.
- de-identified dataset: the data analysis team should never need to see PII. They just want a de-identified dataset. A de-identified dataset is one where PII fields are encrypted and others not. With the RSA key removed, the dataset is effectively deidentified.
- datasets from other systems with shared values, such as identity numbers, can be prepared for meta-analysis using the same keys and algorithms;
- To completely obscure the encrypted data, the secret reference table may be dropped before releasing the database.
- to completely obscure the encrypted data, the secret reference table may be dropped before releasing the database.
- by default field classes exist for two sets of keys. You can customize KEY_FILENAMES to create as many sets as needed. With multiple sets of keys you have more control on who gets to see what.

Disadvantages
-------------
Expand Down
45 changes: 45 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from setuptools import find_packages

#with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
# README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

setup(
name='django-crypto-fields',
version='0.1.0',
author=u'Erik van Widenfelt',
author_email='ew2789@gmail.com',
packages=find_packages(),
include_package_data=True,
url='http://github/erikvw/django-crypto-fields',
license='GPL licence, see LICENCE',
description='Add encrypted field classes and more to your Django models.',
# long_description=README,
zip_safe=False,
keywords='django fields encryption security',
install_requires=[
'Django>=1.7',
'pycrypto>=2.6.1',
'django-extensions>=1.5.5',
'unipath>=1.1',
],
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
# 'Programming Language :: Python :: 3',
# 'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.4',
'Topic :: Security :: Cryptography',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)

0 comments on commit 2c8ebe3

Please sign in to comment.