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
the keys 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.create_database(path_db)
# Add a new key
skd.user.add_key_to_database(
path_db=path_db,
name='key_name',
)
# Get a key
key = skd.user.get_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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c517fc21acbfd34dc798e1a993506369a858d00fd1503d811093aeffa9cbcd76 |
|
MD5 | 6b1cf5a3b73a3985fd2b21926eec147d |
|
BLAKE2b-256 | bde31febd7c5f3c6981f3594d1e763ca0622b8c566e444e379352a1be9ffd235 |
Close
Hashes for secret_key_database-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90810126f9ef6e6fc9ccdefa88838a6687d8816b895f1acaad7fc58962dc5c3e |
|
MD5 | 7071fa2b86a9b8cd292d0324f33c716b |
|
BLAKE2b-256 | 86d5ca0fd18a90d44995b613682aedafc8423072ee14a5009151efeb5b6305df |