Adds SHA512 support for ServUO (#124)

This commit is contained in:
Kamron Batman 2020-05-02 00:32:00 -07:00 committed by GitHub
parent dad8a64fad
commit 2b4a6e1de1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 99 additions and 82 deletions

View file

@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using Server.Misc;
namespace Server.Accounting.Security
{
@ -16,7 +16,7 @@ namespace Server.Accounting.Security
byte[] bytes = new byte[Encoding.ASCII.GetByteCount(password)];
Encoding.ASCII.GetBytes(password, bytes);
return BitConverter.ToString(m_SHA1HashProvider.ComputeHash(bytes));
return HexStringConverter.GetString(m_SHA1HashProvider.ComputeHash(bytes));
}
public bool ValidatePassword(string encryptedPassword, string plainPassword) =>