EldoS | Feel safer!

Software components for data protection, secure storage and transfer

PGP operation failed: No appropriate key for decryption found

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
Posted: 07/07/2006 12:26:04
by Scott Cline (Basic support level)
Joined: 07/07/2006
Posts: 4

I am trying to use the C# ASPNET Demo that comes with SBB. I have placed key files and PGP files in the appropriate folders, and when I try to decrypt the file through the ASP page I get the following message:

"PGP operation failed: No appropriate key for decryption found"

Using the SBB C# PGPFiles DEMO, the same PGP encrypted file, and same pub/priv key files, the file is decrypted as expected. This tells me that I have the correct key files for the encrypted files.

Does anyone know how to correct this problem, OR does anyone have a VB or C# class (not wizard/gui) that can decrypt a PGP file.

Thank you
Posted: 07/07/2006 12:38:28
by Eugene Mayevski (Team)

Did you include a reference to SecureBlackbox.PKI.dll to your project?

Sincerely yours
Eugene Mayevski
Posted: 07/07/2006 12:39:33
by Eugene Mayevski (Team)

BTW there's an ASP demo for PGP included into the distribution (unfortunately the demo is only for VS 2003).

Sincerely yours
Eugene Mayevski
Posted: 07/07/2006 13:20:32
by Scott Cline (Basic support level)
Joined: 07/07/2006
Posts: 4

Yes, I am getting this exact error from the ASP PGP demo that you include with SBB.

I am using a version downloaded yesterday. I verified that your demo includes a reference to SecureBlackbox.PKI.dll in the project.

Can you verify that the demo works for Decrypting PGP files?

Thank you.
Posted: 07/07/2006 15:22:22
by Eugene Mayevski (Team)

It looks like on some systems CLR blocks use of SecureBlackbox.PKI.dll because of security restrictions.

Are you using .NET 1.1 and VS.NET 2005?

Sincerely yours
Eugene Mayevski
Posted: 07/07/2006 15:31:18
by Scott Cline (Basic support level)
Joined: 07/07/2006
Posts: 4

Using .Net 1.1 and VS 2003. How can we configure things to work around the security restrictions?
Posted: 07/08/2006 00:04:50
by Eugene Mayevski (Team)

We have to investigate the issue.

The strangest thing is that everything worked fine for a long time and the users use and deploy PGPBlackbox-based Web applications fine. And now (the last week) three "new" users reported the same problem.

Sincerely yours
Eugene Mayevski
Posted: 07/08/2006 05:32:45
by Ken Ivanov (Team)

Please replace the code of ProcessPGP() method with the following code and check if it solves the issue:
private bool ProcessPGP(Stream inF, Stream outF)
   TElPGPReader reader = new TElPGPReader();
      reader.DecryptingKeys = secretKey;
      reader.VerifyingKeys = publicKey;
      outputStream = outF;
      reader.OnCreateOutputStream += new TSBPGPCreateOutputStreamEvent(reader_OnCreateOutputStream);
      reader.KeyPassphrase = Request.Params["password"];
      reader.DecryptAndVerify(inF, 0);
   catch(Exception ex)
      errormsg = ex.Message;
      return false;
   return true;
Posted: 07/11/2006 07:07:40
by Scott Cline (Basic support level)
Joined: 07/07/2006
Posts: 4

This new code corrected the problem. Thank you for the support.
Posted: 07/19/2006 09:13:19
by Jim Bounce (Basic support level)
Joined: 07/11/2006
Posts: 13


well I am having the same problem with my VB.NET project. with some files encrypted with the same key I am able to decrypt, with some other files I get the same error, any help?


funny thing is that it allready worked, I was able to decrypt it two or three times, but now it just doesn´t works.
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.



Topic viewed 19265 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!