Project

fernet-cli

0.0
No commit activity in last 3 years
No release in over 3 years
CLI for Fernet
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.14

Runtime

~> 2.0
~> 1.6
 Project Readme

fernet-cli

Now, the power of Fernet is available from the shell!

tl;dr

tmaher@og-kush:~$ gem install fernet-cli
Fetching: fernet-cli-0.4.gem (100%)
Successfully installed fernet-cli-0.4
Parsing documentation for fernet-cli-0.4
Installing ri documentation for fernet-cli-0.4
Done installing documentation for fernet-cli after 0 seconds
1 gem installed
tmaher@og-kush:~$ fernet-encrypt --help
Usage: fernet-encrypt [-p | -k <keyfile>] -i <infile> -o <outfile>
    -p, --prompt                     Prompt for keys
    -k, --keyfile KEYFILE
    -i, --infile INPUTFILE
    -o, --outfile OUTPUTFILE

And there's a corresponding fernet-decrypt too. The key should be a base64-encoded blob of 256-bits. If you'd rather not write it out to a file or get promted for it, you can save it to shell environment variable FERNET_CLI_KEY.

For fernet-encrypt, the infile is plaintext and the outfile is ciphertext. For fernet-decrypt, the infile is ciphertext and the outfile is plaintext.

For more information, see https://github.com/fernet/spec

WARNING

These helpers support the convention of specifying - for a filename to mean stdin/stdout. However, the Ruby implementation of Fernet currently has to read the complete message into memory before encrypting/decrypting. If you're planning on using this in any vaguely complicated shell pipeline, your computer's memory usage will assplode.