Giter Site home page Giter Site logo

kmstool's Introduction

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 . 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 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's People

Contributors

mwedgwood-rmn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.