A simple Python package for encrypting and decrypting secret keys.
Project description
secret_key_database
This is a very simple library to encrypt and store secret keys (or any text) locally.
The keys are stored in a local sqlite database. The keys are encrypted using
AES-GCM. That's it. In theory, the database file can be shared publicly since
they are encrypted and require a password to decrypt, but it's best to keep it
private.
This approach works great when:
- Number of keys is small
- The keys are not very sensitive (e.g. low risk API keys)
- You store the database in a semi-secure location (computer with a password, private repository, etc.)
- You don't want to use an external or cloud service as a key/password manager
- You need a simple API to store and retrieve keys
Installation
pip install secret_key_database
from source:
git clone https://github.com/RichieHakim/secret_key_database
cd secret_key_database
pip install -e .
Demo
import secret_key_database as skd
# Create a new database
path_db = 'path/to/database.db'
db = skd.Database(path_db)
# Add a new key
skd.database.append_encrypted_key_to_database(
path_db=path_db,
name='key_name',
)
# Get a key
key = skd.database.get_decrypted_key_from_database(
path_db=path_db,
name='key_name',
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for secret_key_database-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6825b2b3354de96bbc653704d90c680890aa462c7a8f3f82856aca3593012e81 |
|
MD5 | 40162db6404cfaf03b405006d92d5e3c |
|
BLAKE2b-256 | 5045e2452c1ecc131645a50e3c9ce0659165c518914cd9435cac13fbbcad6af4 |
Close
Hashes for secret_key_database-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb43b60b7126d47f79067e90d0bb550ecb7eaacacef977d9b77ec13adaa13caa |
|
MD5 | e70f55d24a1511a5353a71b72ec377d4 |
|
BLAKE2b-256 | 4719c8490cc41245925dcc363bf57575813fec3c0a74af5905ca3ac1e70c9173 |