Skip to main content
PyCon US is happening May 14th-22nd in Pittsburgh, PA USA.  Learn more

Command line tools to compress and encrypt your keys

Project description

Keystore - keeps your keys in one place.
----------------------------------------

THIS IS AN EXPERIMENT. DO NOT USE IN PRODUCTION.
================================================

Prerequisites
=============
Python 3.4+.

Install
=======
You can install straight from `pip`.

pip install keystore

Before using it for the first time, you will need to setup a `~/.keystorerc` in
your home directory.

{
"keystore": "~/Dropbox/keystore",
"files": [
"~/.ssh",
"~/.gnupg/gpg-agent.conf",
"~/.gnupg/gpg.conf",
"~/.gnupg/private-keys-v1.d",
"~/.gnupg/pubring.gpg",
"~/.gnupg/secring.gpg",
"~/.gnupg/trustdb.gpg",
],
"verbose": true
}


Example usage
=============

**Saving keys:**

keystoresaveInspecting /.ssh:Adding/Users/spaxe/.ssh/idrsa...Adding/Users/spaxe/.ssh/idrsa.pub...Adding/Users/spaxe/.ssh/knownhosts...Added3key(s)tokeystore.Thispassphraseisusedtodecryptyourkeystore.Pleaserememberit.Pleaseenterapassphrase:Pleaseverifyyourpassphrase:Passphraseaccepted.Encrypting...Keyringsuccessfullycreated:AwGd2MtDWRkOFdyJoRZTdFApvKnoBQ2PXsqqE[...]Loadingkeys: keystore-load

Located encrypted keystore at ~/Dropbox/keystore:
Please enter the passphrase:
Keyring decrypted successfully.
File /Users/spaxe/.ssh/id_rsa exists. Are you sure you want to overwrite? (y)/n:
Writing key to /Users/spaxe/.ssh/id_rsa ...
File /Users/spaxe/.ssh/id_rsa.pub exists. Are you sure you want to overwrite? (y)/n:
Writing key to /Users/spaxe/.ssh/id_rsa.pub ...
File /Users/spaxe/.ssh/known_hosts exists. Are you sure you want to overwrite? (y)/n:
Writing key to /Users/spaxe/.ssh/known_hosts ...
Keyring loaded. Restored 3 keys.

**Loading keys to the same directory (useful for a new machine):**

mkdirkeys keystore-load --copy-to keys

Located encrypted keystore at ~/Dropbox/keystore:
Please enter the passphrase:
Keyring decrypted successfully.
Writing key to /Users/spaxe/keys/id_rsa ...
Writing key to /Users/spaxe/keys/id_rsa.pub ...
Writing key to /Users/spaxe/keys/known_hosts ...
Keyring loaded. Restored 3 keys.

**Running tests:**

python3 test.py

License
=======
© Xavier Ho <contact@xavierho.com>

License under MIT License.


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page