0

In my application I'm using System.Security.Cryptography (Microsoft dll) for decryption of my logic, at present I'm already using Rijndael Class from 4.0 version, now I've to use AesGCM of 5.0 version too to decrypt the content which was encrypted using AesGcm class however I'm unable to upgrade the version of assembly below are the workarounds I tried

  1. If I tried to reinstall it installs 4.0 instead of 5.0, I couldn't find exact assembly in Nuget console
  2. To use AesGcm intellisense prompted to upgrade C# version from older to 8.0 I did by editing .csproj file under PropertyGroup ->LangVersion to 8.0

However intellisense went off but still I'm unable to use AesGcm class

 using var aes = new AesGcm("_key to be enter alter");

Error: Type or Namespace AesGCM couldn't find in assembly ref 3. I tried to add below attributes for AesGcm method call, still didn't worked bcz I don't have ver 5 installed [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
I need to use both method Rijndael and AesGcm, could someone suggest me what am I doing wrong here?

1 Answers1

1

Sadly AesGcm is only for .NET Core >= 3.0 or .NET 5.0 (that in truth is .NET Core 5.0, a totally different beast from .NET Framework 4.x).

You can't import the single 5.0 System.Security.Cryptography.Algorithms.

If you want you can try to convert it from source code, or you can use BouncyCastle or similar libraries.

xanatos
  • 109,618
  • 12
  • 197
  • 280
  • Can you pls check my post so far I haven't got any answers yet posted on (13/6/2021) if you have any answers for this.... https://stackoverflow.com/questions/67961086/api-abuse-security-vulnerability-issue-mvc-app – Sayeed Ahmed Jun 14 '21 at 14:23