Video Screencast Help

Problems with PGP Decryption !!!!

Created: 19 Apr 2011 | 3 comments

Dear Team,

Kindly note I'm facing some issues while decrypting some file. I used the following commands to encrypt a file 'UBL-DCM-06-Apr-2011-113513.dlt':

  1. pgp --encrypt "UBL-DCM-06-Apr-2011-113513.dlt" --recipient "bnk" --> Created an output file 'UBL-DCM-06-Apr-2011-113513.dlt.pgp'
  2. pgp --sign "UBL-DCM-06-Apr-2011-113513.dlt.pgp" --recipient "bnk" --passphrase "*******" --> Created an output file 'UBL-DCM-06-Apr-2011-113513.dlt.pgp.pgp'

When I tried to decypt the same file using command [pgp --decrypt "UBL-DCM-06-Apr-2011-113513.dlt.pgp.pgp" --passphrase "*******"], it did generate the original file but displayed garbage characters in it. It looks alike the text in it is still encrypted.

I'm also attaching a snapshot for your convenience. Please advice how can it be rectified.

Comments 3 CommentsJump to latest comment

Andreas Zengel's picture

you should sign and encrypt in one step, then you can also decrypt and verify in one step.


 pgp --encrypt "UBL-DCM-06-Apr-2011-113513.dlt" --recipient "bnk" --signer "alice" --passphrase "passphraseforAliceskey" 

You can then decrypt using

 pgp --decrypt "UBL-DCM-06-Apr-2011-113513.dlt.pgp" --passphrase "passphraseForbnk"  
dfinkelstein's picture

Andreas suggested doing the sign and encrypt in one step.  What part of the decryption didn't work?

You are encrypting a file, producing a ".pgp" file.  You then sign that file, producing a ".pgp.pgp" file.  You then try to decrypt the ".pgp.pgp" file, but this is the signature file.  By "decrypting it" you are removing the signature information and the output is the .pgp file, not your original .dlt file.  You need to do a second decryption.  Alternately just decrypt the ".pgp" file and not the ".pgp.pgp" file, or do a combined sign+encrypt as suggested in the first comment.


David Finkelstein

Symantec R&D