This article describes how to use PGP Command Line to encrypt files. This pertains to PGP Command Line 8.x running on Windows NT4/2000/XP, Linux, and Solaris platforms.
Important TIP: For information on how to encrypt with PGP Command Line using Symantec Encryption Management Server (AKA KMS) as well as a spreadsheet with all the useful PGP Command Line commands, see the following article:
159237 - Using PGP Command Line with Symantec Encryption Management Server (PGP Server)
This is very useful if you do not want to host your keyrings locally, or have several installations of PGP Command Line and want to have access to keys in a more secure fashion.
The file you intend to encrypt may be located in the current directory you have changed to in the command prompt, or you may specify the directory together with the file you want to encrypt. The file to be encrypted will be referred to in this document as (input). You will also need to specify a recipient, which will be referred to in this document as (user). Additional modifications can be used when encrypting a file, and these will be referred to as (options) in this document.
Note: PGP Command Line, by default, does not encrypt to the default key. If you want to encrypt to yourself, you will need to specify your key as a recipient. |
Encrypt the File
1. Open a command prompt.
2. From the command prompt, enter:
pgp --encrypt (input) --recipient (user)
3. Press Enter.
PGP Command Line will respond as follows: 0x12345678:encrypt(input).txt:encrypt {output file (input).pgp} Please review the following examples: Example 1 The following example will show you how to encrypt a file to a specified user.
1. From the command prompt, type:
pgp --encrypt "Joe's file.txt" --recipient "PGP Joe"
2. Press Enter.
Example 2 The following example will show you how to encrypt a file located in a different directory, to a specified user.
1. From the command prompt, type:
pgp --encrypt "C:\Documents and Settings\PGP_Joe\Desktop\Joe's file.txt" --recipient "PGP Joe"
2. Press Enter.
Example 3 The following example will show you how to encrypt a file to a specified user, changing the name of the encrypted file using the (options) feature.
1. From the command prompt, type:
pgp --encrypt "Joe's file.txt" --recipient "PGP Joe" --output "Joe's test file.txt"
2. Press Enter.
Encryption Options
There are several options available for encrypting. These options are:
Encryption Options Examples
The following are examples of how to use the options above:
Encrypt to multiple recipients where keys are on the local keyring:
pgp --encrypt report.txt README.rtf -r "Bill Brown" -r "Mary
Smith" -r "Bob Smith"
Use wildcards to specify the files to encrypt:
pgp -er "Bob Smith" *.doc
Encrypt multiple files into an archive:
pgp -er "Bob Smith" *.doc --output archive.pgp --archive