Skip to main content

Encrypt sensitive data. Emulates much of the functionality of Ansible Vaults but for Python.

Project description

pyvaulter

A very simple Python module that can be used to encrypt sensitive data. Emulates much of the functionality of Ansible Vaults but for Python.

Basic Usage (Creating/Editing Encrypted Files)

All encrypted files are placed in the current working directory.

pyvaulter [--help] <edit|create|view|encrypt> <file_name>

pyvaulter create <file_name>: Create and encrypt a new file

pyvaulter edit <file_name>: Edit an encrypted file that has been encrypted by pyvaulter

pyvaulter view <file_name>: View an encrypted file a file that has been encrypted by pyvaulter

pyvaulter encrypt <file_name>: Encrypt an existing, unencrypted file (path). This is intended to encrypt a copy of an already-existing file on your system. It will not encrypt the original file, but rather create a copy of it.

Basic Usage (In a script)

You can use pyvaulter in your script or application to decrypt the contents of files at runtime. So, in practice the workflow looks like this:

  1. Encrypt an existing file, or create a new encrypted file with pyvault
  2. In your script or application, decrypt the file like so:
from pyvaulter import decrypt
from getpass import getpass

# You could also just pass in the decryption password using an environment variable, that way you're not prompted to
# type it each time, but for the sake of simplicity, you can also do it this way.
secure_password = getpass('Enter decryption password')

# Decrypt the file, returning the contents as a string
my_secret_file_content = decrypt(file_path='/path/to/encrypted/file', decryption_password=secure_password)

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

pyvaulter-0.3.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

pyvaulter-0.3.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pyvaulter-0.3.0.tar.gz.

File metadata

  • Download URL: pyvaulter-0.3.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyvaulter-0.3.0.tar.gz
Algorithm Hash digest
SHA256 73080237bb080c7eb25f7a00a0e5b1d51d9dc7dbe07861e3b50d7e155798f1af
MD5 2e2bccf69377a81cda0dd5dbef1af67a
BLAKE2b-256 2b2615d20f6a23e11c92c5a5e6b9965c0fe1ab1f4e4daefdde607e337e863351

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvaulter-0.3.0.tar.gz:

Publisher: python-publish.yml on kwilt/pyvaulter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvaulter-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyvaulter-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyvaulter-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40c9ad693bc9b80e2241be333ccb2afa65f1ca3326a959c6d6942b308da06b70
MD5 7681eb5838e37cb00f48ebe9ef1aca1b
BLAKE2b-256 5808c56bb7cca355d7210f117e0b05f3bf1de72e29917dab51a81e268ec0dc2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvaulter-0.3.0-py3-none-any.whl:

Publisher: python-publish.yml on kwilt/pyvaulter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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