From c4dd980267382e548414e44a86452f1b59e4698e Mon Sep 17 00:00:00 2001 From: Alexandr Mansurov Date: Sun, 17 Oct 2021 21:09:34 +0200 Subject: [PATCH] README usage instructions --- README.rst | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/README.rst b/README.rst index 6950dc3..019eb2e 100644 --- a/README.rst +++ b/README.rst @@ -9,13 +9,26 @@ Protect yourself and your customers with database encryption. Installation ============ -:: - pip install cryptbase -You can also install the in-development version with:: - pip install git+ssh://git@https://code.eghuro.com/cryptbase/python-cryptbase.git@master +Usage +============ + +You can use cryptbase with django ORM or witg SQLAlchemy. + +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. Development @@ -24,20 +37,3 @@ Development To run all the tests run:: tox - -Note, to combine the coverage data from all the tox environments run: - -.. list-table:: - :widths: 10 90 - :stub-columns: 1 - - - - Windows - - :: - - set PYTEST_ADDOPTS=--cov-append - tox - - - - Other - - :: - - PYTEST_ADDOPTS=--cov-append tox