diff --git a/README.rst b/README.rst index 019eb2e..9502e62 100644 --- a/README.rst +++ b/README.rst @@ -15,7 +15,7 @@ Installation 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: diff --git a/docs/usage.rst b/docs/usage.rst index 20dcd06..ecaeabc 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -2,6 +2,17 @@ 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.