Compare commits

2 Commits

Author SHA1 Message Date
1e46fa028a Merge branch 'release/1.0.0' 2021-10-17 21:36:40 +02:00
3667e790fc Usage docs 2021-10-17 21:32:27 +02:00
2 changed files with 14 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ Installation
Usage Usage
============ ============
You can use cryptbase with django ORM or witg SQLAlchemy. You can use cryptbase with django ORM or with SQLAlchemy.
To use with SQLAlchemy: To use with SQLAlchemy:

View File

@@ -2,6 +2,17 @@
Usage Usage
===== =====
To use cryptbase in a project:: You can use cryptbase with django ORM or with SQLAlchemy.
import cryptbase 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.