Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamshedvesuna/cronos
Python module for safely and cleanly using sensitive data in code
https://github.com/jamshedvesuna/cronos
Last synced: about 1 month ago
JSON representation
Python module for safely and cleanly using sensitive data in code
- Host: GitHub
- URL: https://github.com/jamshedvesuna/cronos
- Owner: JamshedVesuna
- License: mit
- Created: 2014-12-21T19:13:29.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-16T21:59:27.000Z (over 8 years ago)
- Last Synced: 2024-10-12T23:22:50.770Z (about 1 month ago)
- Language: Python
- Size: 10.7 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
cronos
======Python module for safely and cleanly using sensitive data in shared code.
Cronos uses a secure encryption method, [AES256](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard), to store passwords and sensitive values locally. Simple (and unsecure) [Caesar Ciphers](http://en.wikipedia.org/wiki/Caesar_cipher) are used to create obfuscated keys in the cronos datastore. This means keys are simply human-unreadable and values are securely encrypted with a password file (defaults to your ssh private key).
Install
-------
Supports Linux and OS X.* Python Pip: `pip install cronos`
Usage
-----
While global keys are stored in your code (such as the plaintext `API_KEY` in the examples below), Cronos uses the single interface `get` to *initially* prompt the user for the value at runtime. Cronos stores the encrypted value in a keystore called `db.cronos`. Upon a second call to `get`, Cronos performs a lookup and decryption.You may want to add `*.cronos` to your `.gitignore`.
Using your ssh private key (`id_rsa`) as the default encryption key:
```python
from cronos import cronos
c = cronos.Cronos()
myKey = c.get("API_KEY") # Prompt user for API_KEY if not already stored
```Using `mypassword.txt` as the encryption key and `/tmp/db.chronos` as the db file:
```python
from cronos import cronos
c = cronos.Cronos(passFile='mypassword.txt', storeFile='/tmp/db.chronos')
myKey = c.get("API_KEY") # Prompt user for API_KEY if not already stored
```Requirements
------------
* [getpass](https://docs.python.org/2/library/getpass.html)
* [os](https://docs.python.org/2/library/os.html)
* [pickle](https://docs.python.org/2/library/pickle.htmlpassword)
* [simplecrypt](https://pypi.python.org/pypi/simple-crypt)
* [sys](https://docs.python.org/2/library/sys.html)