https://github.com/godaddy/asherah-python
https://github.com/godaddy/asherah-python
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/godaddy/asherah-python
- Owner: godaddy
- License: mit
- Created: 2022-02-25T23:36:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-13T18:34:14.000Z (over 1 year ago)
- Last Synced: 2025-07-18T09:59:23.683Z (11 months ago)
- Language: Python
- Size: 91.8 KB
- Stars: 5
- Watchers: 13
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# asherah-python
Asherah envelope encryption and key rotation library
This is a wrapper of the Asherah Go implementation using the Cobhan FFI library
## Usage
Example code:
```python
from asherah import Asherah, AsherahConfig
config = AsherahConfig(
kms='static',
metastore='memory',
service_name='TestService',
product_id='TestProduct',
verbose=True,
enable_session_caching=True
)
crypt = Asherah()
crypt.setup(config)
data = b"mysecretdata"
encrypted = crypt.encrypt("partition", data)
print(encrypted)
decrypted = crypt.decrypt("partition", encrypted)
print(decrypted)
```
## Benchmarking
Included is a `benchmark.py` script that will give you an idea of the execution
speeds you can see from this library. Our goal is to make this as performant as
possible, as demonstrated by this example output:
```sh
> python benchmark.py
Benchmarking encrypt/decrypt round trips of "mysecretdata".
Executed 100 iterations in 0.026045440000000003 seconds.
Executed 1000 iterations in 0.237702095 seconds.
Executed 10000 iterations in 2.3570790550000003 seconds.
Executed 100000 iterations in 23.717442475 seconds.
```