Using the Internet Securely

A guide on GPG/PGP keys and best practices for online security.

#security #encryption #privacy #pgp #gpg

March 16, 20254 min read


The internet is a powerful tool, but it comes with risks. Securing your online presence is essential to protect your data, privacy, and communications. One of the most effective tools for encryption and authentication is GNU Privacy Guard (GnuPG), which implements the Pretty Good Privacy (PGP) - Wikipedia standard. This guide covers the basics of GPG/PGP keys and general security practices for safer internet usage.

Understanding GPG/PGP Keys

PGP and GPG use public-key cryptography to encrypt and sign data. Each user has a key pair:

By using GPG, you can send encrypted emails, verify software integrity, and authenticate communications.

Generating a GPG Key

To create a new GPG key:

  1. Install GPG:

    • Linux/macOS: Check installation with gpg --version. If not installed, install it using:
      • macOS: brew install gnupg
      • Linux (Debian-based): sudo apt install gnupg
    • Windows: Use Gpg4win
  2. Generate a key:

    gpg --full-generate-key
    

    Follow the prompts to select key type, size, and expiration.

  3. Export your public key:

    gpg --export --armor your@email.com > publickey.asc
    
  4. Share the public key so others can encrypt messages for you. You can upload it to a keyserver like:

Encrypting and Signing Messages

To encrypt a message:

echo "Confidential message" | gpg --encrypt --armor -r recipient@email.com

To sign a message:

echo "Important document" | gpg --clearsign

To verify a signed message:

gpg --verify message.asc

For more details, refer to the GPG Command Line Guide.

General Internet Security Practices

Use Strong, Unique Passwords

Secure Your Email and Communications

Keep Software Updated

Browse the Web Safely

Verify Software Integrity

When downloading software, always check its authenticity by verifying its GPG signature:

gpg --verify software.sig software.tar.gz

Most open-source projects provide GPG signatures for their releases, which can be verified against their public keys. Check the project's official website for details.

For example, verifying a Arch Linux ISO download:

  1. Download the public key:
    gpg --recv-keys 3E80CA1A8B89F69CBA57D98A76A5EF9054449A5C
    
  2. Verify the signature:
    gpg --verify archlinux-2025.03.01-x86_64.iso.sig archlinux-2025.03.01-x86_64.iso
    

Conclusion

Online security is an ongoing effort. By using GPG for encryption and authentication, along with adopting strong security habits, you can significantly reduce your risk of data theft and surveillance. Stay informed, keep your software updated, and be cautious when sharing information online.

For further learning:


Similar Posts

View All