Generate a public/private key pair for yourself using the command `gpg –full-generate-key`. Follow the prompts to set your name, email address, and other details.
3. Add your public key to your GPG keyring by running `gpg –export -a
4. To encrypt a file, navigate to the directory containing the file and run `gpg –keyring ./my-pubring.kbx –no-default-keyring –encrypt –recipient
5. To decrypt a file that someone has sent you, navigate to the directory containing the encrypted file (it will have a .gpg extension) and run `gpg –keyring ./my-pubring.kbx –no-default-keyring –pinentry-mode=loopback –passphrase
6. To enable bidirectional communication between two parties, each party should generate their own public/private key pair using step 2 above. They can then share their public keys with each other by running `gpg –keyserver hkp://pool.sks-project.org –recv
7. To encrypt and decrypt files between two parties, follow steps 4 and 5 above using each party’s public/private keys as appropriate.
8. When finished, delete your temporary GPG keyring by running `rm ./my-pubring.kbx`. This will prevent any accidental use of the wrong keyring in future sessions.
Encrypting and Decrypting Files in GPG
in Linux