>_ IzzyLab

Hands-on task

This task is step 15 of the course “Linux server security”

GPG: symmetric encryption

medium~5 min

Encrypt the file /root/secret.txt symmetrically (with the password izzypass) into /root/secret.txt.gpg. Decrypting with the same password must return the original contents.

What you'll practise:
  • gpg
  • symmetric encryption
  • batch mode
  • passphrase
  • security

Topic breakdown

Symmetric encryption needs no key pair: the same password (passphrase) both encrypts and decrypts the data — handy for quickly protecting a single file. gpg supports this mode but by default asks for the password interactively, so in scripts it's switched to batch mode and the passphrase is supplied non-interactively. You practice choosing the symmetric encryption mode and substituting the password so that decrypting back returns the original text.

What's checked

  1. file is encrypted and decrypts with the password

What it looks like