Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate Encryption of a File Using PGP 8.0

Status
Not open for further replies.

delrio7

Programmer
Nov 27, 2002
4
0
0
US
Is it possible to automate the encryption of a file for a client? Or is there a DOS command that will encrypt a file using someone else's key?

A little explanation:

We have a client who has sent us their key. They would like us to generate a file weekly, encrypt it and email it. Is it possible to use Dos batch files or...? to make this happen?

We are currently using PGP v8.0.

Thanks in advance for any suggestions
 
I do this with a freeware library called NSDPGP2 written by Gerard Thomas. The library is a COM wrapper for PGP. I am using Visual Foxpro but as I recall there are also versions for VB and Delphi. The documentation lists a web address of I email 50-60 reports a month to 15-20 clients, all automated.

I'm not sure the DOS command line version of PGP is available anymore; you might have to write a program to do what you want. If you can find an older version of PGP that has the DOS command line capability in it, you might be able to do something with DOS batch files.


Mike Krausnick
Dublin, California
 
You might also look at CryptOCX from I use this to encrypt and FTP files to and from suppliers.

I got this when it turned out that to automate PGP you have to buy the SDK or the command line version; both cost a lot. I think this OCX is a wrapper on the SDK.

If you do get hold of this then I have a few tips I could share - docs are not A1 and there are some tricks you'll need to know.

Bill.
 
I downloaded and it didn't work. I tried the echo command line in DOS with no luck. I'm running a ProComm aspect script that ftp's files back and forth and I need to encrypt those files using PGP. This script runs at night so I need a way to totally automate this using PGP 8.0.
 
Your best bet for automation is using Robo-FTP. It allows you to create your own keys. Here's a script that will grab the latest zip file in a directory and pgp encrypt it.

WORKINGDIR "S:\Client Services\LETTERS\"

GETNEXTFILE "*.zip" /timeout=5

SET filename = "S:\XXXXXXXXXXXXX\LETTERS\" & %nextfile & ".pgp"

PGPENCRYPT %nextfile filename /user="James" /pw="XXXXXXXX"

It basically encrypts the latest file with the the same name. There are settings you can use to schedule the ftp/ or encryptions but I use the following ProComm aspect script to run this program.


proc main
set aspect keys on

winminimize $PWMAINWIN

run "C:\Program Files\Robo-FTP\Robo-FTP.exe"

pause 10

sendkey ALT 'F'
pause 2
sendkey 'O'
pause 2
sendkeystr "test.s"
pause 2
sendvkey 0x0D
pause 10
sendkey ALT 'F'
pause 2
sendkey 'F'
pause 2
sendkey 'X'
pause 2

winrestore $PWMAINWIN

The "test.s" is the filename for Robo-FTP script
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top