Skip to main content

Encrypt sensitive yaml/json data with user managed encryption key or a default package managed key.

Project description

  Author: Sujay RS
  Email: sujayy1983@gmail.com

Encrypted configurations

Encrypt and decrypt a sensitive yaml or json configuration file with ease.

Encrypt/Decrypt YAML or JSON configurations

This module encrypts sensitive yaml/json configurations and decrypts data as needed by the application/script. It offers the following two modes to handle encryption/decryption keys.

Modes - Managing symmetric keys

  1. Default mode: Library generates encryption keys and maintains it for decryption/distribution.

  2. User owns responsibility of managing his/her encrypted key in a secure vault solution and feeds the key to ths library as required.

Install this package

pip install enconfigs

Tested on

  1. Ubuntu 22.04 with python 3.11
  2. MacOS Sonoma 14.5 with python 3.11

Create sample scripts to test functionality

>>> from enconfigs.secureconfigs import SecureConfig
>>> inputdata={'key1': 'value1', 'key2': ['val2', 2]}  ## Input a json data
>>> secureobj = SecureConfig("/tmp/encryptedfile.yml") ## Target location of file where encrypted data must be stored.
True                                                   ## Indicates data was encrypted and stored successfully
>>> secureobj.update_encrypted_data(inputdata)         ## Directly provide config data that must be securely stored
>>> secureobj.decrypt_read_file()                      ## When application needs to read secure data then must call decrypt_read_file() method
{'key1': 'value1', 'key2': ['val2', 2]}

Note: Similar to the above string or list maybe an input for encryption 

Future plan

  • Easy key rotation and thus auto reencryption of data.
  • Offer options to choose an asymmetric encryption algorithm.
  • Test more complex data types.
  • Test on more OS platforms.
  • Test with more python versions.
  • Actively support bugs.

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

enconfigs-0.0.102.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

enconfigs-0.0.102-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file enconfigs-0.0.102.tar.gz.

File metadata

  • Download URL: enconfigs-0.0.102.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for enconfigs-0.0.102.tar.gz
Algorithm Hash digest
SHA256 5ee827b1e3ebf4970eb09c89b285707dda36fe4992740bee24db24cf8280f090
MD5 375f99ee4424fe93b1f0a9b1885a82ee
BLAKE2b-256 f5cb3d6ca2e085eca8f7d659b1621b83877a999c6d17a44e0b85c12813abb9f1

See more details on using hashes here.

File details

Details for the file enconfigs-0.0.102-py3-none-any.whl.

File metadata

  • Download URL: enconfigs-0.0.102-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for enconfigs-0.0.102-py3-none-any.whl
Algorithm Hash digest
SHA256 f162149150b4881c43470e18876997522de9671c685124c2264913ea241da105
MD5 992f632d6dc742570faf638c2abcbe81
BLAKE2b-256 9436bb319f46830a83bbcec0734c3b03dc0acb088244d667f3d73edfe39cd525

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