我是密码学的新手,为了学习它,我尝试使用AESin进行加密/解密C#。
遗憾的是我意识到,这并不像我想象的那么容易。\n所以我正在寻找一个更简单的解决方案。
\n\n后来我发现了一些代码片段,其中包括一些解释。
\n\n我复制了代码并尝试将其实现到一个小应用程序中。
\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Security.Cryptography;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace aes\n{\n class Program\n {\n\n public static string passwd = null;\n public static string content = null;\n public static string encryptedcontent = null;\n\n public static byte[] IV = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };\n public static int BlockSize = 128;\n\n\n static void Encrypt()\n {\n\n if (passwd == …Run Code Online (Sandbox Code Playgroud)