I am looking for an easy encryption program, usable from the linux command line. Preferably a single static binary. I tried scrypt (tarsnap), but it prompts for a password with no way to input as a flag. This means it cannot be used from a script.
Thank you for the help!
1 Answer
You could use PGP/gpg
:
# Encrypt
gpg --output file.gpg --encrypt --recipient [email protected] file
# Decrypt
gpg --output file --decrypt file.gpg
Before you can do that, you need to create a key pair and import it to your keyring. See the manual on how to do it: https://www.gnupg.org/gph/en/manual/book1.html
<<<
operator. Also, a standard way to automate tasks which require user input is the Expect program, which likely already comes installed on your system and is easily acquired if not.expect
, though the Wikipedia entry actually does have some nice examples already.