[請益]跪求php使用des加密

看板PHP作者 (tnsshnews)時間15年前 (2010/12/20 10:28), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
目前要將下面程式碼(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
這是JAVA吧
12/22 01:58, 2F

12/22 01:58, , 3F
喔 C#~長的真像= =
12/22 01:58, 3F
文章代碼(AID): #1D3hzL5r (PHP)
文章代碼(AID): #1D3hzL5r (PHP)