Information you requested on Salt SHA512
Robert Graham
robert_graham at uhaul.com
Thu Jan 15 18:50:40 CET 2015
Unicode encoding and we're hashing the salt and password in salt, then
password order.
Hash( salt + password );
Password
Salt
Hash
Hellohello1
8888702
0x20D6AB7A8B3E40F62D8DC1022D0B0FDE4388FEA53C3ECD63395BA382B2596FFCD15711EEBCC3CCC5620A1B1BCFB4B89914609985994B1E3CB30C568D5FCD0311
Testtesttest1
8888975
0xDDF4C53D3AD71CB04A4BDD5F6B9B8586BB65723CE027EF26D0E0C121DD4A88311ECA987F5100360C2BD89675531A7AB261F283C64CC64B5DD57563A89507D5DF
public static byte[] Hash(string salt, string password)
{
byte[] passwordBytes = Encoding.Unicode.GetBytes(password);
byte[] saltedPasswordBytes;
if (string.IsNullOrEmpty(salt))
{
saltedPasswordBytes = new byte[passwordBytes.Length];
}
else
{
byte[] saltBytes = Encoding.Unicode.GetBytes(salt);
saltedPasswordBytes = new byte[passwordBytes.Length +
saltBytes.Length];
Array.Copy(saltBytes, 0, saltedPasswordBytes,
passwordBytes.Length, saltBytes.Length);
}
Array.Copy(passwordBytes, saltedPasswordBytes,
passwordBytes.Length);
using (var hashProvider = new SHA512Managed())
{
return hashProvider.ComputeHash(saltedPasswordBytes);
}
}
Robert Graham
Network Engineer
U-Haul International
2727 N. Central Ave
Phoenix, AZ 85004
More information about the Freeradius-Users
mailing list