Skip to main content

Encryption over django CharField

Project description

Hyval

Hyval will store your information encrypted and decrypt it when needed :>

Usage:

instalation:

for install package :

pip install django-hyval

example :

1- in settings.py:

HIDE_MY_VALUE = {
	'salt' : 'test',
	'key': 'test',
	'length' : 32,
	'iteration': 1000,
}

2- in model:

from django.db import models
from hyval import HideMyValue


class TestHyval(models.Model):
    name = models.CharField(max_length=50)
    password = HideMyValue(max_length=32)

then:

action = TestHyval()
action.name = "test"
action.password = "test"
action.save()

Now your 'password' field on database stored with encryption so to retrieve value :

my_model = TestHyval.objects.get(pk=1)
my_model.password
>>> 'test'

mistake

there was mistake by me , so i deleted 'repository' and '.git' folder anciently, so there isn't any commit about past.

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-hyval-1.0.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Supported by

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