Create a unified format for my wiki. Unfortunately, since most of my notes are created on a whim and I don't care much about metadata at the time, the timestamps are only approximations from my memory.
1.5 KiB
Executable File
File encryption with GPG
GPG is mostly used for public-key cryptography, allowing you to publicly communicate with the recipient. Using GPG boils to generating a key-pair, managing them, and signing and receiving encrypted messages from others and/or to yourself for security purposes.
Basic usage
A GPG key-pair is made up of two things: the public key and the private key. The public key can be shared… to the public while the private key should be guarded in secret.
# List out the available keys.
gpg --list-keys
# Generate a new key-pair.
gpg --full-gen-key
Encrypting and decrypting files
Encrypting and decrypting files are one of the main points of GPG.
# This will encrypt a file and generate an obscured version of it at <FILE>.gpg.
gpg --recipient <EMAIL> --encrypt <FILE>
# Decrypting is almost the same process.
gpg --recipient <EMAIL> --output <FILE> --decrypt <FILE>.gpg
You can make more secured versions of encrypted file especially when you intended it to send it to a particular recipient. For example, you can encrypt your file with your private key and the public key of your recipient and only both of you know how to receive the file.