Link to home
Start Free TrialLog in
Avatar of CodeJunky
CodeJunkyFlag for United States of America

asked on

Encryption after converting from 4.8 Framework to .NET 6.0

Hi All,

I converted a .net framework 4.8 c# project to .NET 6.0.

First issue I have run into is that my Rijndael encryption is broken.  The two lines below are an issue.  Is there another assembly or method(s) I should be using now?

 System.Security.Cryptography.RijndaelManaged AES = new System.Security.Cryptography.RijndaelManaged();
            System.Security.Cryptography.SHA256 SHA256 = new System.Security.Cryptography.SHA256();

Open in new window

Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Did you check if you are still having a reference to System.Security.Cryptography? as per RijndaelManaged Class (System.Security.Cryptography) | Microsoft Docs , it is still supported
is broken....  What error message?
Avatar of CodeJunky

ASKER

So, the first line is indicating that RijndaelManaged types are obsolete and to use Aes instead. I did make that change to but get the same error as the second line. The second line "new System.Security.Cryptography.SHA256();" errors with "Cannot create an instance of the abstract type or interface 'SHA256'.
Additionally I change the first line to below without an error; but did not change the error of the second line.
System.Security.Cryptography.AesCng AES = new System.Security.Cryptography.AesCng();

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial