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

A flexible option to encrypt and decrypt a sensitive yaml or json configuration file.

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 

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.101.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.

enconfigs-0.0.101-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: enconfigs-0.0.101.tar.gz
  • Upload date:
  • Size: 5.9 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.101.tar.gz
Algorithm Hash digest
SHA256 26bad7d36955ed75edcaa798d1f9f1a1e01857413afd59c38675c00171371427
MD5 841eb4f367e9cde1a1e062d0e75604bb
BLAKE2b-256 e1d8d1c441ae4e4bb55bf983657f6f10ef12bab895c0ebe9051388549a08cd40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: enconfigs-0.0.101-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.101-py3-none-any.whl
Algorithm Hash digest
SHA256 b12b461cd564c75ab1baabaa475cff23e61595814abf643df920f9c675bf6f23
MD5 cac8f560c1df86a5e3ba8071c4a607db
BLAKE2b-256 fcfc2f0a96a06f6e5fc2497427ce1dfbfd4df9371a2fcd30032edfa4573ceec7

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