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',
)

# 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

secret_key_database-0.1.3.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secret_key_database-0.1.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

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

Hashes for secret_key_database-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5a6639ee4daa2bed5ef7cbea6ff0bcb46217d17309e0a402c61a2120292f03f6
MD5 d457f16b85a998df4d6f3275670cf8ea
BLAKE2b-256 bbf220f24c21e78b98d3c8ba32bc2302eeda5ad829a337353113e766d6b152da

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for secret_key_database-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 011462f4ed470e4a654068aa5f81ef30b82b5c8c85fd1c0d3a22b6589f956e66
MD5 05b1896f4d3078ce6b1592be691b5e46
BLAKE2b-256 af58f3a104493020a5534eb862f77f1a031add30949a2e8626ea6af7239f429c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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