Files

19 lines
487 B
ReStructuredText
Raw Permalink Normal View History

2021-10-08 16:42:25 +02:00
=====
Usage
=====
2021-10-17 21:32:27 +02:00
You can use cryptbase with django ORM or with SQLAlchemy.
2021-10-08 16:42:25 +02:00
2021-10-17 21:32:27 +02:00
To use with SQLAlchemy:
from cryptbase import EncryptedText
sensitive = Column(EncryptedText(key=DB_KEY))
To use with django:
from cryptbase import EncryptedTextField
sensitive = EncryptedTextField(key=DB_KEY)
DB_KEY is 32 bytes encryption key as hex encoded string. Fields behave as TEXT fields, data are transparently encrypted
when storing into the database and decrypted on retrieval.