Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secret_key_database-0.1.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

secret_key_database-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file secret_key_database-0.1.2.tar.gz.

File metadata

  • Download URL: secret_key_database-0.1.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for secret_key_database-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c517fc21acbfd34dc798e1a993506369a858d00fd1503d811093aeffa9cbcd76
MD5 6b1cf5a3b73a3985fd2b21926eec147d
BLAKE2b-256 bde31febd7c5f3c6981f3594d1e763ca0622b8c566e444e379352a1be9ffd235

See more details on using hashes here.

File details

Details for the file secret_key_database-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for secret_key_database-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90810126f9ef6e6fc9ccdefa88838a6687d8816b895f1acaad7fc58962dc5c3e
MD5 7071fa2b86a9b8cd292d0324f33c716b
BLAKE2b-256 86d5ca0fd18a90d44995b613682aedafc8423072ee14a5009151efeb5b6305df

See more details on using hashes here.

Supported by

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