Tools and things that make my life easier - y'all might like them too
fernet
Perform fernet encryption/decryption.
Syntax: fernet [-v|--verbose] [-d|--decrypt]
| Option | Description | Default |
| —— | ———– | ——- |
| -v
| Enable verbose debugging | Debugging is not enabled |
| -d
| Enable fernet decryption | Fernet encryption is performed |
$ date | fernet | tee /tmp/secret
Encryption key:
gAAAAABcaH8gaUJzCzoOprHr3RxuNnQo9Utqc9bA4UiU3SiBm0MaPdxmYqpDXOUr_KY0yIJ-kBRQ78NmEo2qdWZNiYd4C1HX4bsGzjQX0lMD4nVy7pzRjNM=$
$ fernet -d < /tmp/secret
Encryption key:
Sat Feb 16 16:22:37 EST 2019
$
fernet
tool to decrypt a secure key store file in $HOME/.private
if you know the encryption key.I tried to do an example with a single pipeline the encrypted and decrypted the data like so:
$ date | encrypt | decrypt -d
but did not give this as the primary example because it demonstrates a flaw in not echo’ing the encryption key. Since both the encryption and decryption commands were essentially running at the same time, both blocked reading stdin, as soon as I entered the key the first time, the terminal had reset its echo mode and the second time the encryption key was entered, it appeared on the screen as I typed it. So be aware of using encryption and decryption in a pipeline like this.