Note: You might want to consider using OpenSSL for file encryption instead. Please see this post.
In this post we will see how to use GnuPG to make a simple symmetric encryption and decryption. This method applies to encrypt a file so that it is unreadable.
GPG supports 11 cipher algorithms that you can use:
By default, GPG will use AES256 cipher for encryption. However, you can change the cipher algorithm by supplying
--cipher-also CIPHER option.
$ gpg --output encrypted.data --symmetric --cipher-algo AES256 un_encrypted.data
$ gpg --output un_encrypted.data --decrypt encrypted.data
Note: You will be prompted for a password when encrypting or decrypt.