# kmstool
kmstool helps you encrypt data using the Amazon Key Management Service in AWS.
## Installing
```
pip install .
```
## Usage
kmstool has two modes: pack and unpack
### store
```
kmstool pack <key_id> <source>
```
This command takes a KMS key ID, produces a data key, and uses that key to
encrypt the file <source>. An encrypted copy of the data key is stored, along
with the encrypted files, in the current directory.
### retrieve
```
kmstool retrieve <source>
```
This command reads the contents of <source> passing the encrypted data key to
KMS, and using the resulting plaintext key to decrypt the original data. The
files are extracted to the current directory.
### Additional Options
Additional options are available: see `kmstool -h` for usage information.
Unless otherwise specified, AWS credentials are determined by first examining
the environment, then a search of the AWS metadata service, and finally using
the "default" botocore profile.
```
--profile
AWS (botocore) profile to use when contacting the KMS.
--region
AWS region to connect to for KMS.
```
An optional encryption context may be passed when storing files. The same
context must be passed when retrieving them.
```
-c --encryption-context foo=bar,baz=qux
```
## Internals
The output of `kmstool pack` is a gzipped GNU tar file containing the
KMS-encrypted data key plus an encrypted tar.gz of the source data. The
encrypted data is stored as follows (numbers are byte offsets).
```
0-15 Initialization Vector
16-N Encrypted data:
0-15 Original filesize
16-N Original data
```
kmstool helps you encrypt data using the Amazon Key Management Service in AWS.
## Installing
```
pip install .
```
## Usage
kmstool has two modes: pack and unpack
### store
```
kmstool pack <key_id> <source>
```
This command takes a KMS key ID, produces a data key, and uses that key to
encrypt the file <source>. An encrypted copy of the data key is stored, along
with the encrypted files, in the current directory.
### retrieve
```
kmstool retrieve <source>
```
This command reads the contents of <source> passing the encrypted data key to
KMS, and using the resulting plaintext key to decrypt the original data. The
files are extracted to the current directory.
### Additional Options
Additional options are available: see `kmstool -h` for usage information.
Unless otherwise specified, AWS credentials are determined by first examining
the environment, then a search of the AWS metadata service, and finally using
the "default" botocore profile.
```
--profile
AWS (botocore) profile to use when contacting the KMS.
--region
AWS region to connect to for KMS.
```
An optional encryption context may be passed when storing files. The same
context must be passed when retrieving them.
```
-c --encryption-context foo=bar,baz=qux
```
## Internals
The output of `kmstool pack` is a gzipped GNU tar file containing the
KMS-encrypted data key plus an encrypted tar.gz of the source data. The
encrypted data is stored as follows (numbers are byte offsets).
```
0-15 Initialization Vector
16-N Encrypted data:
0-15 Original filesize
16-N Original data
```
Metadata
Release files for kmstool 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| kmstool-0.7.0.tar.gz | 4.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kmstool-0.7.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 12.0 kB
Release files / kmstool-0.7.0.tar.gz
| Download URL | kmstool-0.7.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cb11956bcb60a9639a27987a087bc44aa9f3181d0ebb9b94346f28a813c5282
|
|
BLAKE2b-256 checksum How to use checksums |
80f1b6cf4116bdb3234925f809082e40c3b8e00ee7826254be2ed25b9f8c0358
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / kmstool-0.7.0-py2.py3-none-any.whl
| Download URL | kmstool-0.7.0-py2.py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f7c089f37ef663435fb28e7c0ff34f3854200dbe756bfeeeb7c09e8b31d49bfa
|
|
BLAKE2b-256 checksum How to use checksums |
e70549ba4e44f4963f9464932a3ebaec76e9d6669e0d1a31cf110948d2ffff3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for kmstool 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.