Signing, Encryption, Decryption and Verification with GnuPG

  1. Create a sample message file

›_ Console

# echo "Welcome to Utimaco" > message.txt 
  1. Sign the file using the key name.

›_ Console

# gpg --output message.txt.signed --sign --default-key test@utimaco.com message.txt

Provide slot PIN when prompted. This will generate a signed file message.txt.signed

tmpixca2bhm.jpg

Signing the file

  1. Verify the file message.txt.signed

›_ Console

# gpg --verify message.txt.signed 
tmp5e6ibz5a.jpg

Verifying the signed file

  1. Encrypt the file. Provide recipient user ID when prompted

›_ Console

# gpg --output message.txt.enc --encrypt  message.txt 
tmpd8_ysml6.jpg

Encrypting the file

This will generate an encrypted file message.txt.enc

  1. Decrypt the encrypted file

›_ Console

# gpg --output message.txt.dec --decrypt  message.txt.enc 

Provide slot PIN when prompted. This will generate a decrypted file message.txt.dec

tmpcrzcibo2.jpg

Decrypting the file

  1. Verify the content of original file

›_ Console

# cat message.txt.dec 
tmp47zj4_ru.jpg

Original content of the file