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.3.0.tar.gz (5.2 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.3.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hc671123_secure_secrets-2.3.0.tar.gz
  • Upload date:
  • Size: 5.2 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.3.0.tar.gz
Algorithm Hash digest
SHA256 3dd08e78ac09dfef5d46d1b0484a000ddd3c8b16610dad84819f988349dc124a
MD5 0822796d764a4802bac1a254c9a31fab
BLAKE2b-256 eb27ca171af0943991ec10a0e5fd1a2f59c5cf471e019b740d2e311bcdc7fbc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hc671123_secure_secrets-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63845c7abca371f275bc87f65a32c73e105ed3b6aea09675d834df3a013bdc25
MD5 9e3b32f50289c386a4ca417f8bbc29fe
BLAKE2b-256 bb621ee812ddce36634575b3fbb73c9a4118c38a431016fcdb776cd24ee92f8a

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