Endpoint Encryption

 View Only
  • 1.  PGP File Decryption Path

    Posted Mar 12, 2014 09:17 PM

    PGP Server - Windows Server 2003
    PGP Version - 10.2 build 283
     

    Scenario:

    We've created a script to auto decrypt .PGP file. The script is triggered by 3rd party software (IBM Connect Direct via it's RunTask function).

    Script:

    @echo off

    set DecFilPath=D:\XXXXX\abc\%1 ⇔ to define the Decryption File path in set environment

    set VendrFile=%DecFilPath%\%2.gpg to define the location of client uploaded encrypted file
     

    set EncryptFile=%DecFilPath%\%2.pgp to define the targeted encrypted file

    ECHO [%TIME:~0,8% %DATE%] Start Decryption      >> %DecFilPath%\LogDownload.txt

    IF EXIST %EncryptFile% Del %EncryptFile% if similar targeted encrypted file exist, delete the old encrypted file

    Rename %VendrFile% *.pgp rename the client uploaded encrypted file to extension .pgp for PGP to able to decrypt.

    pgp --decrypt %EncryptFile% --overwrite remove  >> %DecFilPath%\LogDownload.txt 2>&1

    ECHO [%TIME:~0,8% %DATE%] End Decryption        >> %DecFilPath%\LogDownload.txt

    * %DecFilPath%\LogDownload.txt logging purpose

    Expected outcome:

    D:\XXXXX\abc\xyz\clientfile.txt.pgp:decrypt (0:output file D:\XXXXX\abc\xyz\clientfile.txt)

    Error outcome:

    D:\XXXXX\abc\xyz\clientfile.txt.pgp:decrypt (0:output file clientfile.txt)

    The decrypted file should always decrypted to the same path as the encrypted file located as above Expected outcome stated.

    But in our scenario, the decrypted file were decryted to the 3rd party software installation path:

    D;\Program Files\Sterling Commerce\Connect Direct v4.2.00\Server\program

    I know i could introduce the -o option during the decryption, but may i understand what is the behavior of PGP decryption if i do not introduce the -o function? Isn't pgp will always output the file to the same location as the encrpytion file path?

     



  • 2.  RE: PGP File Decryption Path

    Broadcom Employee
    Posted Mar 14, 2014 09:40 AM

    Hi ahhann,

    If you launch that script manually is the behavior the same?
    Perhaps if you echo all those variables (including current path) before each action, will provide a better understanding of what's happening...

    HTH,
    dcats