How could I create the following PHP code in C# ?
Php code:
<?php
$salt = "salt";
$value = "hello";
$password_hashed = md5($salt.$value);
?>
I would appreciate any kind of help. Been testing the following:
https://stackoverflow.com/a/1300927/7312781
But it would only return a wrong string.
var salt = System.Text.Encoding.UTF8.GetBytes("salt");
var value = System.Text.Encoding.UTF8.GetBytes("hello");
var hmacMD5 = new HMACMD5(salt);
var saltedHash = hmacMD5.ComputeHash(value);
string hex = BitConverter.ToString(saltedHash);
MessageBox.Show(hex.Replace("-", ""));
Response: https://gyazo.com/340fe77979c1b0b531d07a8050ce66d1
The response should look like: 06decc8b095724f80103712c235586be
Hope this will help, it's some modification from given link