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',
)
# Check out available keys by name
print(skd.database.get_names_from_database(path_db=path_db))
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secret_key_database-0.1.3.tar.gz.
File metadata
- Download URL: secret_key_database-0.1.3.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a6639ee4daa2bed5ef7cbea6ff0bcb46217d17309e0a402c61a2120292f03f6
|
|
| MD5 |
d457f16b85a998df4d6f3275670cf8ea
|
|
| BLAKE2b-256 |
bbf220f24c21e78b98d3c8ba32bc2302eeda5ad829a337353113e766d6b152da
|
Provenance
The following attestation bundles were made for secret_key_database-0.1.3.tar.gz:
Publisher:
pypi_release.yml on RichieHakim/secret_key_database
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secret_key_database-0.1.3.tar.gz -
Subject digest:
5a6639ee4daa2bed5ef7cbea6ff0bcb46217d17309e0a402c61a2120292f03f6 - Sigstore transparency entry: 194109825
- Sigstore integration time:
-
Permalink:
RichieHakim/secret_key_database@926285294b8670a22b721bd8848b5d2f389d7034 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/RichieHakim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@926285294b8670a22b721bd8848b5d2f389d7034 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file secret_key_database-0.1.3-py3-none-any.whl.
File metadata
- Download URL: secret_key_database-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
011462f4ed470e4a654068aa5f81ef30b82b5c8c85fd1c0d3a22b6589f956e66
|
|
| MD5 |
05b1896f4d3078ce6b1592be691b5e46
|
|
| BLAKE2b-256 |
af58f3a104493020a5534eb862f77f1a031add30949a2e8626ea6af7239f429c
|
Provenance
The following attestation bundles were made for secret_key_database-0.1.3-py3-none-any.whl:
Publisher:
pypi_release.yml on RichieHakim/secret_key_database
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secret_key_database-0.1.3-py3-none-any.whl -
Subject digest:
011462f4ed470e4a654068aa5f81ef30b82b5c8c85fd1c0d3a22b6589f956e66 - Sigstore transparency entry: 194109827
- Sigstore integration time:
-
Permalink:
RichieHakim/secret_key_database@926285294b8670a22b721bd8848b5d2f389d7034 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/RichieHakim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@926285294b8670a22b721bd8848b5d2f389d7034 -
Trigger Event:
workflow_dispatch
-
Statement type: