Command Line Decrypting without PassPhrase

I recently had to move my automated powershell tasks from one VM to newer device. On the previous device (Win10) the following line worked WITHOUT needing to enter the password every time. (FYI, the material is sensitive, I cannot use a key w/out a password/phrase)

gpg --output “C:\working\Test.pdf” --decrypt “C:\working\Test.pgp”

On the new device (Win Server 2019), the password dialog frequently is required. Occasionally it’s in the GPG cache, but usually it’ll ask for the pass phrase. Evidently when I originally wrote these scripts I neglected to include notes for the gpgconf and/or options I used to achieve this goal. And I havn’t found any clues in my old backups either.

I tried something new, by adding it to the command line, like so…

 gpg --passphrase-fd "MY_PHRASE_HERE" --batch --output "C:\working\Test.pdf" --decrypt "C:\working\Test.pgp"

Unfortunately this line will just hang up the command. I have to use CTRL-Break to return to the command prompt. I tried putting the phrase into a file instead… but that’s not working either. Besides, entering the passphrase in the batch file or other file isn’t the most secure method.

I know I found a way around this before, but I can’t remember how I did it. Any thoughts?

Jeremiah Campbell

Explained here: