diff --git a/src/cryptbase/__init__.py b/src/cryptbase/__init__.py index 5833b19..3c7f8a2 100644 --- a/src/cryptbase/__init__.py +++ b/src/cryptbase/__init__.py @@ -8,6 +8,15 @@ try: from django.db import models class EncryptedTextField(models.TextField): + """ + Django model field to provide database encryption using AES-256-CTR. + Simply replace existing TextField with EncryptedTextField and add + hex encoded 256-bit long encryption key to use. In code, you can + read and write the data with no further changes. However, in the + underlying database they will be encrypted. + + Make sure to migrate the data appropriately. + """ description = 'Encrypted data' def __init__(self, *args, **kwargs): @@ -43,6 +52,15 @@ try: from sqlalchemy import types class EncryptedText(types.TypeDecorator): + """ + SQLAlchemy model field to provide database encryption using AES-256-CTR. + Simply replace existing TEXT field with EncryptedText field and add + hex encoded 256-bit long encryption key to use. In code, you can + read and write the data with no further changes. However, in the + underlying database they will be encrypted. + + Make sure to migrate the data appropriately. + """ impl = types.TEXT def __init__(self, *args, **kwargs):