Skip to main content

No project description provided

Project description

Testcases

sprig-aes

Library and CLI to encrypt and decrypt text using AES CBC mode.

Note that the implementation is ported from:

  1. http://masterminds.github.io/sprig/crypto.html#encryptaes
  2. http://masterminds.github.io/sprig/crypto.html#decryptaes

Installation

Typical installation using pip:

pip install sprig-aes

This will install the sprig_aes library and sprig-aes CLI.

Note that as per version 0.6.0, users may install self-contained Python zipapps (CLI-only) using the following command:

pip install shiv
make zipapp
mv sprig-aes.pyz ~/.local/bin/sprig-aes

Using The Library

from sprig_aes import sprig_encrypt_aes
from sprig_aes import sprig_decrypt_aes

key = "6Jsv61H7fbkeIkRvUpnZ98fu"
enc_text = sprig_encrypt_aes("a secret message", key)
dec_text = sprig_decrypt_aes(enc_text, key)

Using The CLI

Encrypt/decrypt simple string:

enc_text=$(sprig-aes encrypt 'a secret message' --key 6Jsv61H7fbkeIkRvUpnZ98fu)
sprig-aes decrypt "$enc_text" --key 6Jsv61H7fbkeIkRvUpnZ98fu

Encrypt/decrypt contents of a file:

sprig-aes encrypt-file /path/to/file --key 6Jsv61H7fbkeIkRvUpnZ98fu > /path/to/encrypted-file
sprig-aes decrypt-file /path/to/encrypted-file --key 6Jsv61H7fbkeIkRvUpnZ98fu

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

sprig_aes-0.7.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

sprig_aes-0.7.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file sprig_aes-0.7.0.tar.gz.

File metadata

  • Download URL: sprig_aes-0.7.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for sprig_aes-0.7.0.tar.gz
Algorithm Hash digest
SHA256 93e3a7d8beb7f76a426d477d023b48ea5005b0f0d3dc8b9547d80d2cccde2a35
MD5 9b25f9e98fb352e8e77f83d4cd7f1364
BLAKE2b-256 0828a4722fbe03f62672fbf65babbfcb537ae0a842f7c6351ee4e4a72cd0232e

See more details on using hashes here.

File details

Details for the file sprig_aes-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: sprig_aes-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for sprig_aes-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 033c96ab888a0ab1b6b3d6091afa8cacf7b7b25b44fe257a4a45482317c8c3e5
MD5 a96a484cc9059a6e6e757ceb1977d52d
BLAKE2b-256 306175dd99a5744cdebd591cb68b499738738c7e73e9d6196690df32d079ec77

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