This article describes scenarios in which you might encounter unexpected behavior from PGP Command Line when passing data to the Standard Input (stdin) of PGP Command Line. This pertains to PGP Command Line 8.5.0 running on Solaris, Linux, and Windows platforms.
PGP Command Line is designed to receive/process data from a file or files. Therefore, passing output data from one application directly to PGP Command Line's stdin is unsupported behavior, and will cause unanticipated results. Similarly, passing input directly from the keyboard to PGP Command Line's stdin is also unsupported. Proper behavior is to write the data (which PGP Command Line must process) to a file or files, then pass the file(s) to PGP Command Line.
Suppose 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.
While it seems like the above example might work, encrypted data is being passed directly to PGP Command Line's stdin stream--which is not supported. Proper behavior is to write the encrypted data to file first, then invoke PGP Command Line for decryption.
Since 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
Pressing enter at this point will simply create an empty file called
encrypted.pgp. This occurs because PGP Command Line is expecting to receive input from a file or files, not from standard input.
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
Imported Document ID: TECH148898
Subscribing will provide email updates when this Article is updated. Login is required.