Skip to main content

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

Metadata

Release files for secret-key-database 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for secret-key-database 0.1.3
File Size Uploaded
secret_key_database-0.1.3.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for secret-key-database 0.1.3
File Interpreter ABI Platform
secret_key_database-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / secret_key_database-0.1.3.tar.gz

Download URL secret_key_database-0.1.3.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5a6639ee4daa2bed5ef7cbea6ff0bcb46217d17309e0a402c61a2120292f03f6
BLAKE2b-256 checksum
How to use checksums
bbf220f24c21e78b98d3c8ba32bc2302eeda5ad829a337353113e766d6b152da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 8, 2025.

Transparency log

Release files / secret_key_database-0.1.3-py3-none-any.whl

Download URL secret_key_database-0.1.3-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
011462f4ed470e4a654068aa5f81ef30b82b5c8c85fd1c0d3a22b6589f956e66
BLAKE2b-256 checksum
How to use checksums
af58f3a104493020a5534eb862f77f1a031add30949a2e8626ea6af7239f429c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 8, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page