我有一個用於生成存儲在內部數據庫中的密碼哈希下面的Visual Basic .NET函數:一個PHP相當於一個VB.NET密碼哈希函數
Public Function HashPassword(ByVal Password As String, ByVal Salt As String) As String
Dim pwd As String = Password & Salt
Dim hasher As New Security.Cryptography.SHA256Managed()
Dim pwdb As Byte() = System.Text.Encoding.UTF8.GetBytes(pwd)
Dim pwdh As Byte() = hasher.ComputeHash(pwdb)
Return Convert.ToBase64String(pwdh)
End Function
我需要幫助創建PHP當量的上述功能的:
實施例:
Assuming a password string of: warn
A salt value of: i<|Xf":n_y_Yr"Lor`qAA].QK(2C8AJ:Z"\f&TC7bi=Acw_.w|
The returned hash should be: 0Yq3gR09U1GKfFRzmRxdJXK5jSQowHp/YLGA88p0s18=
我無法複製在PHP散列。
親切的問候,
Voxinator
我花*可不是鬧着玩的*與此玩弄並沒有運氣再現哈希研究對谷歌兩小時。非常感謝您的禮遇! – Voxinator
幹得好IIya。你快一分鐘! –