File encryption and decryption is very easy with OpenSSL, which is installed on most any Linux system. Consider the following commands:
Encryption:
This will prompt for a password to use as an encryption key. The -a switch uses Base64 encoding for the encrypted output, which is handy for representing encrypted data as text.
Decryption:
These commands can then be placed within Bash functions and added to .bashrc:
.bashrc:
These functions shorten above encryption and decryption commands to:
Encryption:
Decryption: