Search code examples
ssisgnupgpgp

SSIS PGP decryption - How to enter Passphrase without the popup window?


I have a file with pgp encryption. I want to decrypt the file using SSIS. Whenever I run the package it prompts me to enter passphrase. How can I bypass this?

I'm using execute process task to run the decrypt command from command prompt.

\C echo XXXXXXXXX|gpg --keyring "\\LSRSQL08\Share\DataServices_Key\public.pgp" --secret-keyring "\\LSRSQL08\Share\DataServices_Key\private.pgp" --batch --yes --passphrase-fd 0 -o \\LSRSQL08\Share\WorkingFolders\ACXM\DataLoad\Razor_FEB21_Install.txt -d \\LSRSQL08\Share\WorkingFolders\ACXM\Razor_FEB21_Install.txt.pgp

I have extracted public and private key like below:

gpg --output public.pgp --armor --export DataServices@company.com
gpg --output private.pgp --armor --export-secret-key DataServices@company.com

Solution

  • Below command worked for me. Just we need to make sure that we import the key in same account under which SSIS package will be running.

    --pinentry-mode=loopback --passphrase XXXXXX  -o \\LSRSQL08\Share\WorkingFolders\ACXM\DataLoad\Razor_FEB21_Install.txt -d \\LSRSQL08\Share\WorkingFolders\ACXM\DataLoad\Razor_FEB21_Install.txt.pgp