Tag: 初始化 向量

C#无法生成初始化向量IV

当我尝试为TripleDES加密器创建IV初始化向量时,出现以下错误。 请参阅代码示例: TripleDESCryptoServiceProvider tripDES = new TripleDESCryptoServiceProvider(); byte[] key = Encoding.ASCII.GetBytes(“SomeKey132123ABC”); byte[] v4 = key; byte[] connectionString = Encoding.ASCII.GetBytes(“SomeConnectionStringValue”); byte[] encryptedConnectionString = Encoding.ASCII.GetBytes(“”); // Read the key and convert it to byte stream tripDES.Key = key; tripDES.IV = v4; 这是我从VS获得的例外。 指定的初始化向量(IV)与此算法的块大小不匹配。 我哪里错了? 谢谢