Markdown is a lightweight and easy-to-use syntax for styling all forms of writing on the GitHub platform.
AsciiDoc is a lightweight markup language for authoring notes, articles, documentation, books, web pages, slide decks and man pages in plain text. This guide is a quick reference for the common AsciiDoc document and text formatting markup.
GPG Command Line Interface
Ah, a power user. Adjust the paths if your files are in different places. Anything inside <brackets> needs to be changed by the user. You can also use a graphical text editor to create and view these files instead of nano and less.
Step 0 - Prerequisites
You need to have the gpg binary installed.
You need to have your recipient's key in a file. In this example it will be located at /home/user/recipient-public-key.txt.
Step 1 - Generate your own keypair
This will open the generate key menu. The default options are secure. [1,2048,0,y,<username>,<blank>,<blank>,o,<passphrase>,<passphrase>] Do NOT enter your real-life name, just whatever username you want to be known by.
Step 2 - Import your recipient's key
gpg --import /home/user/recipient-public-key.txt
This adds your recipient's public key to your keyring.
Step 3 - Compose your message
Nano is a command line text editor. Use vim or a graphical one if you prefer.
Step 4 - Encrypt your message
gpg --encrypt --armor --recipient <recipient name or key id> /home/user/message.txt
This encrypts your message.txt file using your recipient's public key. The armor option tells GPG to encode th encrypted data using regular letters and numbers (ASCII-armor). The encrypted message file is located in /home/user/message.txt.asc.
Step 5 - Send your message
To view your encrypted message open /home/user/message.txt.asc
Now save your own public key to a file.
gpg --export <your-username> --output /home/user/<username>-public-key.txt
And to view it, open that file
Send your encrypted message and your public key to your recipient.
Step 6 - Decrypt a message
Your recipient will first use their private key to decrypt the message you sent to them. Then they will complete the process above using your public key and encrypt a message back to you. The message you receive will look similar to the message you sent, but your private key and passphrase can decrypt it. Save the response as the file /home/user/response.txt.asc.
gpg --output /home/user/response.txt --decrypt /home/user/response.txt.asc
Now view the file you created.
That's how you send and receive messages using the GPG command line interface.