# How to Securely Send Me Files

Sending me a file with strong encryption is super easy with GPG.

# Step 1. Make sure GPG is installed

  1. Check that you have the gpg command available, gpg --version
  2. If that failed, you might need to install gpg first:
    sudo apt install gnupg      # Debian, Ubuntu, Mint
    sudo yum install gnupg      # CentOS, Fedora, RHEL
    sudo pacman -S gnupg        # Arch, Manjaro
    

# Step 2. Download my key

# Method 1. Copy-and-Paste

This is the easiest method, just copy the following command and paste it directly into the terminal. We're specifying the full key id so no checking is required.

gpg --recv-keys AA99B195B0D42A0BDA9B0F939B8D7D67729C16EE

This method is pretty easy too, but just requires the manual process of confirming the key by eye.

  1. Search for my key by my name, email, or handle ("mobalt").
  2. Confirm my key id is correct.
  3. Select the key to download ("1 <enter>")

# Step 3. Encrypt the File

# Method 1. Single File

  1. If it is a single file, just use:
    gpg --encrypt --recipient mobalt secret_file    # (long form)
    gpg -er mobalt secret_file                      # (concise alternative)
    
  2. A file ending in .gpg has been created.

# Method 2. Universal Method

  1. You can create a file using any utility like zip or tar with arbitrary flags/options so long as it outputs to stdout:
tar -c   secrets/ secret_file | gpg -er mobalt > secrets.tar.gpg
tar -cz  secrets/ secret_file | gpg -er mobalt > secrets.tar.gz.gpg
zip -9 - secrets/ secret_file | gpg -er mobalt > secrets.zip.gpg
cat single_secret_file | gpg -er mobalt > single_secret_file.gpg

Note: Be sure to give an appropriate extension so the receiver (me) can figure out how to open the file.

# Step 4. Send me the File

Now that the file is protected by strong encryption, you can send me the file ending in .gpg via conventional means (eg, email, slack, dropbox, etc.).

# Thanks for taking the time to keep things secure!