Tag: rc2 cipher

Node.JS RC2-CBCencryption和解密密码与C#不匹配

我有一个现有的encryption和解密login在C#中使用RSC2-cbcalgorithm使用Key和IV。 现在我要在node.js中实现相同的function 所以我写了下面的代码来encryption和解密。 我面临的问题是node.jsencryption的string(chiper)或解密的string与C#encryptrdstring不匹配。 现有的C#代码 byte[] arrbIV = Encoding.ASCII.GetBytes("dleftaba"); byte[] arrbKey = Encoding.ASCII.GetBytes(Key); byte[] arrbData = Encoding.ASCII.GetBytes(sData); //Text to be encryptrd RC2 oEncryptor = new RC2CryptoServiceProvider(); oEncryptor.Mode = CipherMode.CBC; oEncryptor.Key = arrbKey; oEncryptor.IV = arrbIV; // Create memory stream to store encrypted string MemoryStream oMemoryStream = new MemoryStream(); CryptoStream oCryptoStream = new CryptoStream(oMemoryStream, oEncryptor.CreateEncryptor(), CryptoStreamMode.Write); […]