在加密中,如果两个对称算法的密钥大小相等,那么它们在安全性方面是否会被认为是相同的?(即64位RC2算法是否提供与64位AES算法相同的安全性?)
使用64位RC2算法有多安全(或不安全)?
我有多长时间可以期待蛮力攻击来破解这种加密?
用这种算法保护什么样的数据是可以的?(例如,我猜测信用卡信息不能用这种算法加密,因为算法不够安全).
我使用Key和IV使用RSC2-cbc算法在C#中使用现有的加密和解密登录.现在我将在node.js中实现相同的功能.所以我写了以下代码来加密和解密.我面临的问题是node.js加密字符串(chiper)或解密字符串与C#encryptrd字符串不匹配.
现有的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);
// Peform the encryption
oCryptoStream.Write(arrbData, 0, arrbData.Length);
// We have written all the data in the stream and now we can apply padding
oCryptoStream.Close();
string sRetVal = Convert.ToBase64String(oMemoryStream.ToArray()); …Run Code Online (Sandbox Code Playgroud)