Utility for encrypting and decrypting secrets with the AWS KMS service
Project description
Utility for encrypting and decrypting secrets with the AWS KMS service.
Installation
Install from PyPI with pip
pip install aws-kms-crypt
Usage
Requires Python 3.8 or newer.
import kmscrypt
# Encrypting Data
>>> result = kmscrypt.encrypt('secretp4ssw0rd!', key_id='alias/common', encryption_context={
... 'purpose': 'automation'
... })
>>> result
{
"EncryptedDataKey": "AQIDAHhyrbU/fPcQ+a8pJiYC<snip>",
"Iv": "689806fe9d571afeffa4c7c24247c766",
"EncryptedData": "YRjZDQ2KzcEAZqUy7SpWWA==",
"EncryptionContext": {
"purpose": "automation"
}
}
# Decrypting data
>>> kmscrypt.decrypt(result)
b'secretp4ssw0rd!'
Changelog
v3.0.0 (2024-01-31)
- Dropped Python 3.7 support.
v2.0.0 (2022-09-15)
- Dropped Python 3.6 support.
v1.0.0 (2021-09-25)
- Dropped Python 2.7 support.
- Replaced pycrypto with cryptography.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aws_kms_crypt-3.0.0.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file aws_kms_crypt-3.0.0.tar.gz
.
File metadata
- Download URL: aws_kms_crypt-3.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24f9c761707608642decceef2f1519c05ad4c42425b8ebc0815aea3962a6078a |
|
MD5 | 8b18c3dab05c31fff897c48bb5f3f17e |
|
BLAKE2b-256 | b3fb8774c37b51be7fc6f71704d2bf3720355aa96548cef57b16d77799dd2890 |
File details
Details for the file aws_kms_crypt-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: aws_kms_crypt-3.0.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c4c876245e78c18e95b2bf596547e7c5dabd71d1e3941ae682b6e6172d6070 |
|
MD5 | 6a4b232996eea95c8836f8cf673fdd43 |
|
BLAKE2b-256 | 2d901ed34fab5ded9d31ac862889adde3c25c8990e53ef5e5185ae6c87d6a5bc |