Encrypting Files

Files may encrypted for any recipient you have a public key for.

Note

If you are encrypting files for yourself, use your email address associated with your public key as the recipient.

Configure Yubikey for SSH authentication on windows.

Required Materials

  1. Pre-configured Yubikey using Export GPG Subkeys to Yubikey.

Import Public Key

If the public key is not your own and cannot be found on keyservers, it must be manually imported.

Import a publick key
gpg --import {KEY}

Encrypt File

Encrypt a file for a given recipient.
gpg --encrypt --recipient {EMAIL} {FILE}

Create a Detached Signature

This is used to validate that the GPG encrypted file has not been changed.

Create a detached signature for a given file.
gpg --detach-sign {FILE}.gpg

Validate File Using Detached Signature

Import the public key if needed.
gpg --import {PUBLIC KEY}
Verify the GPG encrypted file.
gpg --verify {FILE}.sig

References

  1. GPG Manual