ExamplesSuppose the output from one application is encrypted data, which must be decrypted by PGP Command Line before further processing of the data may continue. Below are some examples of how most users might attempt to accomplish this task with PGP Command Line. The first example shows improper use of PGP Command Line, while the second example depicts proper and supported use of PGP Command Line.
pgp --decrypt --passphrase passphrase --input - --output decrypted.txt
pgp --decrypt --passphrase passphrase --input - <encrypted.pgp
pgp --decrypt encrypted.pgp --passphrase passphraseSince the encrypted data was written to file first, the file can successfully be passed to PGP Command Line for decryption. As previously mentioned, passing data from the keyboard directly to PGP Command Line's stdin is also unsupported.
pgp --encrypt --recipient bob --input - --output encrypted.pgp
Note: The above improper example might work in Windows because of the way Windows handles standard input. Regardless, PGP Command Line for Windows is not designed to operate in this way, so the above usage is still considered improper and unsupported in Windows.) An example of proper use is similar to the above examples. The data to be encrypted should be written to file first, then the file is passed to PGP Command Line for encryption.
pgp --encrypt --recipient bob --input - <encrypted.txt
pgp --encrypt --recipient bob encrypted.txt