PGP software allows the encryption of files and folders. In most cases, PGP Encryption Desktop will allow you to encrypt individual files and folders on an as-needed basis.
If you need to automate encryption into your scripting, or your automated application, PGP Command Line is an appropriate solution. This article describes how to use PGP Command Line to encrypt files.
Important TIP: PGP Command Line integrates with a secure PGP Encryption Server to store and manager keys centrally on the PGP server. This allows for seamless encryption without the need to store keys locally, which is better for convenience if you have multiple installations of PGP Command Line (Shared central location for keys), but also provides better security, because PGP Keypairs are not available on the servers where PGP Command Line is installed. Starting with PGP Command Line 11, the PGP Encryption Server is now included with PGP Command Line for this integration.
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)
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
For further guidance, reach out to Symantec Encryption Support.