EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Getting error 8195 when trying to decrypt stream

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 04/01/2016 10:23:25
by Luis Soto (Standard support level)
Joined: 07/07/2015
Posts: 4

I'm getting the error 8195 when trying to decrypt a Stream.

I was able to encrypt the Stream and I'm saving the encrypted file in a different location.
Later on, when trying to get the file and decrypt it, I'm getting that error.

This is the code we are using to decrypt:
int a;
Stream fsResult = new MemoryStream();
TElMessageDecryptor decr = new TElMessageDecryptor(null);            
memoryCertStorage = new TElMemoryCertStorage();

  memoryCertStorage.Add(certificateForDecrypt, true);
  decr.CertStorage = memoryCertStorage;
  a = decr.Decrypt(filestream, fsResult);
// Code omitted

We already made sure that we are using the same certificate we used to encrypt.

Posted: 04/01/2016 10:35:04
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Error code 8195 stands for SB_MESSAGE_ERROR_KEY_DECRYPTION_FAILED. It means that TElMessageDecryptor was unable to decrypt the content encryption key and there is high possibility that message is corrupted.

First of all check if all stream positions are reset to zero before Encryption/Decryption is performed. If its not the reason of the error, then it will be great if you can create a compilable test case that we can use to reproduce the problem.



Topic viewed 1081 times

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


Back to top

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

Got it!