Linux File Encryption: Encrypt & Decrypt with GPG

In a Linux system, you can use the GnuPG (GPG) tool to encrypt and decrypt files. Here are some basic steps:

  1. Encrypt files:
gpg -c file.txt

This command will prompt you to enter a password, which will be used to encrypt the file. The encrypted file will be named file.txt.gpg.

  1. Decrypt document:
gpg file.txt.gpg

This command will prompt you to enter the password that was previously set, then it will decrypt the file and save it as the original filename file.txt.

In addition to using the GPG tool, there are other tools like OpenSSL and ccrypt that can be used for encrypting and decrypting files.

bannerAds