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.

Requires Linux: Uses vim for editing, and less for viewing

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 pyvaulter
  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.1.tar.gz (4.9 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.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyvaulter-0.3.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyvaulter-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3fa9ef8593b92a18dade00e3a494f512dc20fc69a9e5b3fea9e9df538a0d4db9
MD5 0fd920fe2221c385930d047c3ae200a0
BLAKE2b-256 0697a99452ba266adeb4f20a0268689c89830bc9650e64827ad111abcc8fb354

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvaulter-0.3.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pyvaulter-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81d99003710cbbd2a4eda9135e1c577be6aa4f29217ea9c853a416c5a6dbcc18
MD5 0463f06808257a8da3656e922268bca8
BLAKE2b-256 3ec94af34b1f28b2fc63bed208e17d4256ffcf94750c447d6893fcd4502b5779

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvaulter-0.3.1-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