bc-csharp icon indicating copy to clipboard operation
bc-csharp copied to clipboard

InvalidCipherTextException: mac check in GCM failed when use BouncyCastle in Unity

Open milad-ahmadi opened this issue 3 years ago • 0 comments

Hi, I want to use BouncyCastle in Unity 2019.04.08 with Api compatibility level .NET standard 2.0 or .NET 4.x. when use GcmBlockCipher, I get the following error: InvalidCipherTextException: mac check in GCM failed Org.BouncyCastle.Crypto.Modes.GcmBlockCipher.DoFinal

I tried different versions of BouncyCastle but it did not change: BouncyCastle BouncyCastle.NetCore Portable.BouncyCastle Portable.BouncyCastle-GOST2012

When I run the same code with VS 2015 with .NET Framework 4, the code runs without error.

milad-ahmadi avatar May 30 '22 10:05 milad-ahmadi