Encrypting and Decrypting Files in GPG

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 | gpg –import` (replace `` with your actual email). This will allow others to encrypt files for you using your public key.
4. To encrypt a file, navigate to the directory containing the file and run `gpg –keyring ./my-pubring.kbx –no-default-keyring –encrypt –recipient `. Replace `` with the email address of the recipient you want to encrypt for, and replace `` with the name of the file you want to encrypt.
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 –output –decrypt . Replace `` with the passphrase you used to encrypt the file, and replace `` with the name of the decrypted file.
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 ` (replace `` with the email address of the person you want to receive a copy of their key from).
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.

SICORPS