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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PGP Command Line

Status
Not open for further replies.

shavon

Programmer
Jun 18, 2001
102
CA
Good afternoon:

I need to come up with a program that decrypts files encrypted with PGP. How do I use a command line and what are the parameters for the PGP decrypt? I really appreciate your help. Thank you.
 
I ran the -h on the pgp.exe executable and got:
[tt]

C:\Program Files\Network Associates\PGPNT>pgp -h
Pretty Good Privacy(tm) Version 6.5.2
(c) 1999 Network Associates Inc.
Uses the BSafe(tm) Toolkit, which is copyright RSA Data Security, Inc.
Export of this software may be restricted by the U.S. government.


Usage summary:
To encrypt a plaintext file with recipent's public key, type:
pgp -e textfile her_userid [other userids] (produces textfile.pgp)
To sign a plaintext file with your secret key:
pgp -s textfile [-u your_userid] (produces textfile.pgp)
To sign a plaintext file with your secret key, and then encrypt it
with recipent's public key, producing a .pgp file:
pgp -es textfile her_userid [other userids] [-u your_userid]
To encrypt with conventional encryption only:
pgp -c textfile
To decrypt or check a signature for a ciphertext (.pgp) file:
pgp ciphertextfile [plaintextfile]
To produce output in ASCII for email, add the -a option to other options.
To generate your own unique public/secret key pair: pgp -kg
For help on other key management functions, type: pgp -k
For help on group management functions, type: pgp -g
[/tt]

Almost 100% of the time the only options you'll need are the -e to encrypt, and no option to decrypt. You'll want to read the documentation in the PGPCmdLineGuide.pdf (it's in the Documentation folder). It'll explain how to make your passphrase visible to the commandline program (this isn't so safe, but sometimes it's necessary).

BTW, if you're using this for commercial purposes, you'll need to contact Network Associates and purchase an E-Business Server license. It's $10,000 for two years last time I checked.

Chip H.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top