EncryptionStrategy
Interface for encryption algorithms used to secure event data.
Implementations should provide methods for encrypting and decrypting data using a given key. Used by the Encryption service to process event fields marked for encryption.
Source code in event_sourcery/_event_store/event/encryption.py
decrypt(data, key)
Decrypts the given data using the provided key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data |
str
|
The encrypted data as a string. |
required |
key |
bytes
|
The encryption key. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
The decrypted data. |
Source code in event_sourcery/_event_store/event/encryption.py
encrypt(data, key)
Encrypts the given data using the provided key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data |
Any
|
The data to encrypt. |
required |
key |
bytes
|
The encryption key. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The encrypted data as a string. |