Endpoint Encryption

 View Only
Expand all | Collapse all

How to Change PGP Command Line Suggested File Name When Decrypting

  • 1.  How to Change PGP Command Line Suggested File Name When Decrypting

    Posted Feb 02, 2012 10:43 AM

    We recently upgraded our PGP Command Line to 10.2. We receive files from a cutomer with a unique file name. The problem is, once we decrypt, the decrypted file is renamed to the "suggested output file name" instead of the filename it was before decryption. For example, we receive a file called ABC_20120201_120000.csv.pgp.  Once we decrypt the file, the file is named ABC.CSV. Until we upgraded, we had no issues.

    Is there a way to bypass the "suggested output file name" and have the file decrypt to the filename before decryption?

    We receive multiple files at a time and run a simple DOS command to decrypt and change the output location.

    Any assistance would greatly be appreciated.



  • 2.  RE: How to Change PGP Command Line Suggested File Name When Decrypting

    Posted Feb 02, 2012 11:28 AM

    Moving this thread to the PGP forums.



  • 3.  RE: How to Change PGP Command Line Suggested File Name When Decrypting

    Posted Feb 02, 2012 12:27 PM

    There is no direct way to do what you want in PGP Command Line.  The output file will either be the "Suggested file name" (which should match the original file name before encryption), or the name you specify using the "--output" (or "-o") option.

    To do what you want, then, you'll have to construct the appropriate output file name, and pass it as the "-o" option.  E.g., use a script like this:

     

    #!/bin/sh
    # call as "scriptname input-file passphrase"
    # output file will be the input file name with ".pgp" removed
    pgp --decrypt $1 -o `echo $1 | sed s/.pgp//` --passphrase $2
     
    Obviously you'll construct your own script based upon your own environment and usage.
     
    Regards,