how to add a pgp passphrase to an ftp script

I've got a script for wsftp pro to download some pgp encrypted files.  my log shows that it is working up to the point where it expects to receive the pasphrase for the pgp key... see below.  Is there any way to add this to the script?  In the wsftp gui I also get a dialog box asking for this phrase

<snip>
LIST

125 Data connection already open; Transfer starting.

# transferred 225 bytes in < 0.001 seconds, 1800.000 kbps ( 225.000 kBps), transfer succeeded.

226 Transfer complete.

Starting request
Starting OpenPGP decoding 'C:\DOCUME~1\syscdb\LOCALS~1\Temp\{AEE4FC48-0082-434C-BA7F-A5B3DA020DDD}LEGT_ACTIVITY.pgp'

File is encrypted. Private key is required to decrypt it.

Invalid passphrase

Invalid passphrase

OpenPGP decoding failed: PGP Invalid pass phrase
Transfer request completed with status: Failed, 1 SubItem(s) failed
careybAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

giltjrCommented:
I may be missing something, but typically you don't need the key to download, or upload, an encrypted file.  

You only need the key to decrypt/encrypt the file.

0
careybAuthor Commented:
that's correct, but I should be able to decrypt it as I retrieve it, right? You can see in the log that I'm getting the message "Private key is required to decrypt it.", so it looks like it just needs to be passed that key somehow.
0
giltjrCommented:
You can't decrypt as you receive, you would need to wait until you have completely received the file and then start the decrypt process.

What program are you using to do the decryption?  I am assuming you have the key to decrypt it.
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

careybAuthor Commented:
I have the key (we generated it).  We're using PGP Command Line 6.5.8

0
giltjrCommented:
If you issue the command:

     pgp <keyring_filename>

from the same directory you are in when you run the ftp script do you get a list of the valid keys?  Based the message either you don't have your private key in the keyring file, or you do have access to that file from where you running the command.
0
careybAuthor Commented:
not that I can tell.  Can I issue a command to get the keyring_filename?

command pgp -kv   does give me a list of 2 keys and their user ID


0
giltjrCommented:
How did you add the key into the keyring?

By default the keyring should be located at:

     C:\Documents and Settings\<user>\Application Data\PGP

However, you can change where this is located.
0
careybAuthor Commented:
ok, it looks like I've just got to split the process.

ftp filename.pgp newFilename

then after I get them all downloaded
pgp -p newFilename -z"passphrase"

and I end up with the decrypted files.  Thanks for your help giltjr, looks like I've still got a lot to learn about pgp but this will get me going.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
giltjrCommented:
Yes, getting the file and decrypting it need to be two separate processes.
0
giltjrCommented:
What was wrong with my answer:

http://www.experts-exchange.com/Software/Server_Software/File_Servers/FTP/Q_25835541.html?cid=1135#31270724

I stated that the decrypt had to be done separately from the download.  That you could not decrypt as you download.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Server Software

From novice to tech pro — start learning today.