AES Encryption Decryption .NET Core 2
So if you saw my earlier post about this the code there didn't work for me. but who know me knows i don't give up that easily, there might be a NuGet here or there that do this but i needed to know how this is done! so after 3 hours of digging code on the internet and trying the code for a dozen of times, below is the code which did work for me. i know that the IV should be dynamic in order to further protect this more and this is something i will work on. public static class Crypto { public static string EncryptString(string text, string keyString) { var key = Encoding.UTF8.GetBytes(keyString); var textToChiper = Encoding.UTF8.GetBytes(text); using (var aesAlg = Aes.Create()) { aesAlg.Padding = PaddingMode.PKCS7; aesAlg.Mode = CipherMode.CBC; aesAlg.KeySize = (key.Length * 8); aesAlg.IV = new byte[16]; aesAlg.Key = key; ...