Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

PGP Encryption failed. Exit code was 162.

Created: 31 Jan 2011 • Updated: 04 Feb 2011 | 7 comments
This issue has been solved. See solution.

We're getting a "PGP Encryption failed. Exit code was 162." Error code 162 is "Complete failure during an encode."  Our thinking is around user permissions since users with elevated privileges don't get this error and the encryption works fine.  So what I'm really after is an explanation of what the error means and what precisely we should be looking at in order to resolve the issue.

Can anybody help?

Comments 7 CommentsJump to latest comment

Tom Mc's picture

This link may be of help:

http://stackoverflow.com/questions/1059723/php-exec-pgp-command

When you consider your issue resolved, please click Mark As Solution on the most helpful response.

Search the Knowledge Base &

zezima's picture

Hi Tom,

It doesnt help.  I now get 9000:invalid flag "--temp-dir". My PGP Command Line version is 8.5 and that flag is not supported in that version.

Any other ideas?

dfinkelstein's picture

Do you have read and write access to the current working directory?

Can you re-run your command with the "--debug --verbose" options, and post the result?

Thanks.

--------

David Finkelstein

Symantec R&D

zezima's picture

Hi David,

Here are the results:

 C:\PGP\pubring.pkr:open keyrings (1006:public keyring)
C:\PGP\secring.skr:open keyrings (1007:private keyring)
0x66666666:encrypt (1030:key added to recipient list)
0xFFFFFFFF:encrypt (1050:key added as signer)
Encoding \\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\temp.csv...
\\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\temp.csv:encrypt (3048:data encrypted with cipher AES256)
\\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\temp.csv:encrypt (3124:permission denied)
Encode complete
 Our error 162
Press any key to continue . . .

Here's an example of what it looks like when it runs properly:

 C:\PGP\pubring.pkr:open keyrings (1006:public keyring)
C:\PGP\secring.skr:open keyrings (1007:private keyring)
0x66666666:encrypt (1030:key added to recipient list)
0xFFFFFFFF:encrypt (1050:key added as signer)
Encoding \\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\tempinput.csv...
\\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\tempinput.csv:encrypt (3048:data encrypted with cipher AES256)
Encoding \\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\tempinput.csv... 100% (4.7KB)
Encode complete
Copying output to \\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\tempoutput.pgp... 100% (6.3KB)
Wiping pgp00000.tmp...
Wiping pgp00000.tmp (stream 1)...
Wiping file pgp00000.tmp... 100%
Wipe (stream 1) done
Wipe done
pgp00000.tmp:encrypt (0:file wiped successfully)
\\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\tempinput.csv:encrypt (0:output file \\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP
\tempoutput.pgp)
Press any key to continue . . . 
paulhen's picture

The successful run shows this:

Encoding \\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\tempinput.csv... 100% (4.7KB)
Encode complete

While the unsuccessful one shows:

 Encoding \\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\temp.csv...
\\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\temp.csv:encrypt (3048:data encrypted with cipher AES256)
\\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\temp.csv:encrypt (3124:permission denied)

Do the users who get the error have write permissions to in \\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\? Have the permissions on the folder changed recently or has the group membership of the users changed?

 Governments keep a lot of secrets from their people . . . Why aren't the people in return allowed to keep secrets from the government? --Philip Zimmerman, Der Spiegel

zezima's picture

Hi David,

Yes, we noticed that, and the users do have permissions to that folder.  However, we eventually figured out where the problem was.  The issue was that the users needed read/write access to the working directory.

Let me explain. What was missing from my screenshots was:

 C:\Program Files\MRI Real Estate Solutions>pgp.exe --e "\\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\temp.csv" -r 0x66666666 --verbose --debug --compress --output "\\SQLSTAGE\MRIAPPS\BOA_PAYMODE\OUTBOX\PGP\temp.pgp" --armor --sign --signer 0xFFFFFFFF --passphrase 123456 

That was the command that fired the PGP.  The users needed read/write access to C:\Program Files\MRI Real Estate Solutions\ as well as the \\SQLSTAGE\...\PGP\ folder.  For some reason, PGP 8.5 needs read/write access to the working directory. So we solved the problem by changing the working directory to one that the user had access to.

SOLUTION
dfinkelstein's picture

I believe that PGP 8.5 wrote its temporary files to the current working directory.

I'm glad you found your solution.

--------

David Finkelstein

Symantec R&D