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 on GitHub and read the information below for security informations.

PyPI published

This module is published on PyPI https://pypi.org/project/hc671123-secure-secrets/. You can install it with following pip command: pip install hc671123-secure-secrets .

How to use the module

Have a look at the example.py file on GitHub. Try to always update to the latest version. New Versions will be named with semantic versioning https://semver.org/. You need to have pycryptodomex installed (if you install the module with pip, this will be automatically done).
Keep aware always adding secrets without making a commit with the secret in plaintext!

Functions in the secrets class, which shall be used by developers

add_secret, get_secret, password_change, AES_Encr, AES_Decr, change_directory. You could use __check_permission, but normally you will not have to / have no reason to use it. All other functions are meant for internal use in the module only.

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 of AES-GCM

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.4.1.tar.gz (5.9 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.4.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hc671123_secure_secrets-2.4.1.tar.gz
Algorithm Hash digest
SHA256 53e5428bd1c2b755735bf0081abc6f5a96d3b01231f42cf10407dcb39e854704
MD5 a41db72d312bec45dda79462defb88fb
BLAKE2b-256 a96502c35c7436efcde2b6a701a6f6c4be2b6396fcf5b08e23f264ffb214dccc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hc671123_secure_secrets-2.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3f2f5c4b07b652260dea10275f1ec249bf8d51ec8293b0bd5bf180601ed29a0
MD5 dac44a5b7f485adb00fca795556a3f02
BLAKE2b-256 99d692d3b61fbbfe72a68eb3f076a502f3b3f84a4f9237c0f8354559759a10d9

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