How to Use the PGP Command Line

Save

Many power users turn to the command line to get tasks done more efficiently, and the same applies with the PGP Command Line from Symantec. If you know how to work in the command line with your encryption software, you can quickly set up scripts to automate tasks or just work more efficiently with your encrypted documents.

Generating a Key Pair

  • Launch a command prompt or terminal window. On Windows, do this by pressing the Windows or Meta key and "R," then typing "cmd" in the box that appears before pressing "Enter." On Linux and Mac OS X simply use the Terminal shortcut in your applications menu.

  • Type "pgp --genkey USER --key-type TYPE --encryption-bits BITS --passphrase PASS" where USER is your key's public display name, TYPE is the key type, BITS is the number of bits in your key, and PASS is the passphrase for your private encryption key. BITS is either 1024, 2048, 3072 or 4096. TYPE is either rsa, rsa-sign-only, dh or dh-sign-only.

  • Press "Enter" to run the command and generate a PGP key.

Adding Public Encryption Keys to the Keyring

  • Create a plain text document, in a notepad-like application, that contains only the key or keys you want to import. Multiple keys can be listed in the same document. Both private and public keys can be imported this way.

  • Launch a command prompt or terminal window. On Windows, do this by pressing the Windows or Meta key and "R," then typing "cmd" in the box that appears before pressing "Enter." On Linux and Mac OS X simply use the Terminal shortcut in your applications menu.

  • Type "pgp --import FILE" where FILE is the name of the key document. Press "Enter" to import the keys to your keyring.

Encrypting Files

  • Launch a command prompt or terminal window. On Windows, do this by pressing the Windows or Meta key and "R," then typing "cmd" in the box that appears before pressing "Enter." On Linux and Mac OS X simply use the Terminal shortcut in your applications menu.

  • Execute the command "pgp --list-keys" to show a list of all the keys in your keyrings. The "--list-keys" option can be shortened to "-l" as well. Copy down the user ID for the person you want to encrypt this file for.

  • Type "pgp --encrypt FILE --recipient USERID" where FILE is the name of the file you wish to encrypt and USERID the user ID that corresponds to the public key of the recipient. Add multiple recipients by using the "-r" toggle and listing another user ID. Press "Enter" to encrypt the file.

Decrypting Files

  • Launch a command prompt or terminal window. On Windows, do this by pressing the Windows or Meta key and "R," then typing "cmd" in the box that appears before pressing "Enter." On Linux and Mac OS X simply use the Terminal shortcut in your applications menu.

  • Save any encrypted files you received either through email or over a network connection into an easily accessible folder. Use the "cd" command to change into the files' directory

  • Type "pgp --decrypt FILE" where FILE is the name of the file that was encrypted using your public key. Press "Enter" to decrypt the document using your private key.

References

Promoted By Zergnet

Comments

You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!