Skip to content

Library and CLI to encrypt and decrypt text using AES CBC mode (ported from Sprig)

License

Notifications You must be signed in to change notification settings

iromli/sprig-aes

Repository files navigation

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

pip install 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

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

About

Library and CLI to encrypt and decrypt text using AES CBC mode (ported from Sprig)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages