# 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
- Check that you have the gpg command available,
gpg --version
- 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
# Method 2. Search
This method is pretty easy too, but just requires the manual process of confirming the key by eye.
- Search for my key by my name, email, or handle ("mobalt").
- Confirm my key id is correct.
- Select the key to download ("
1 <enter>
")
# Step 3. Encrypt the File
# Method 1. Single File
- If it is a single file, just use:
gpg --encrypt --recipient mobalt secret_file # (long form) gpg -er mobalt secret_file # (concise alternative)
- A file ending in
.gpg
has been created.
# Method 2. Universal Method
- You can create a file using any utility like
zip
ortar
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.).