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?
 
careybConnect With a Mentor Author 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
 
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.