Пример #1
0
        public void aes_test()
        {
            var encoding = Encoding.UTF8;

            var data = "123";

            var pass = AESHelper.GenericIvKey();

            var encrypt_data = AESHelper.Encrypt(encoding.GetBytes(data), pass.key, pass.iv);

            var decrypt_data = AESHelper.Decrypt(encrypt_data, pass.key, pass.iv);

            encoding.GetString(decrypt_data).Should().Be(data);
        }