Skip to main content

Module which enables storing encrypted, password protected secrets in a single file. Also allows for easy encryption and decryption of data

Project description

secure_module Python

Security module which stores important and confidental information. Information is stored encrypted and password protected. The module also provides the WebEncr and WebDecr functions which encrypts and decrypts any object with AES-GCM 256-bit encryption. Have a look at SECURITY.md and read the information below for security informations.

How to use the module

Have a look at the example.py file on GitHub. Try to always keep the latest version in your code. New Versions will be named with semantic versioning https://semver.org/. You need to have pycryptodomex installed. Example command for pip: pip install pycryptodomex. Keep aware always adding secrets without making a commit with the secret in plaintext!

General information about AES-GCM

AES-GCM provides data integrity and confidentiality (it belongs to the class of authenticated encryption with associated data - AEAD algorithms). For further information about GCM I recommend you to have a look at http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf. You can also have a look at https://en.wikipedia.org/wiki/Galois/Counter_Mode.

Security

Information about my implementation

nonce

I use a pseudo random nonce with 64 bytes length. If high security is needed or something like file encryption is wanted, I would recommend using a deterministic nonce, like described in section 8.2.1 in http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf. As the pycryptodomex implementation supports 16 byte nonces, I would use a 16 byte nonce. If you change the length of the nonce, the decrypt function must be adapted to the new length.

authentication tag

I use the longest possible tag length, which ensures the highest possible authentication strength. Smaller tag lengths are highly discouraged.

Key Generation

Generates a random key. For information about Key Establishment have a look at section 8.1 in http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf.

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

hc671123_secure_secrets-2.2.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

hc671123_secure_secrets-2.2.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file hc671123_secure_secrets-2.2.0.tar.gz.

File metadata

  • Download URL: hc671123_secure_secrets-2.2.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for hc671123_secure_secrets-2.2.0.tar.gz
Algorithm Hash digest
SHA256 26e45c59b6c95477071ecd4f42c53453bba1bfbd1853ed73df7d49818e3afd75
MD5 3d753d0a73e86cc0e272edcd51423cff
BLAKE2b-256 5ee785cad4fe455bbee9ff3bd088100bc240d52634674e6d56603b8683d05762

See more details on using hashes here.

File details

Details for the file hc671123_secure_secrets-2.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hc671123_secure_secrets-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2db7e130baadd3ef03bb6f128eb3f507962017adf89a353377ffaaadf0cab286
MD5 e7a1795bd767107bd2e37d96fe533675
BLAKE2b-256 fcbcdf65d0b0be1a36eb5eebd2276171b3e5b0589e76cdf3c5249ef7c36f7109

See more details on using hashes here.

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