[請益]跪求php使用des加密
目前要將下面程式碼(C#)改寫成php的方式
public static string EnCode(string EnString)
{
byte[] Key = { 9, 8, 1, 1, 9, 1, 2, 6 };
byte[] IV = { 9, 8, 1, 1, 9, 1, 2, 6 };
byte[] b = Encoding.UTF8.GetBytes(EnString);
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
ICryptoTransform ict = des.CreateEncryptor(Key, IV);
byte[] outData = ict.TransformFinalBlock(b, 0, b.Length);
return Convert.ToBase64String(outData);
}
但我去查了php加密的function, 似乎只有放一個key, 好像沒有連IV都一起考慮進去,
拜託各位指點, 萬分感激
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.109.16.228
→
12/20 11:17, , 1F
12/20 11:17, 1F
推
12/22 01:58, , 2F
12/22 01:58, 2F
→
12/22 01:58, , 3F
12/22 01:58, 3F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
6
14