Compare commits

..

No commits in common. '0daa67fc3cfc3f2dbefcda147a643f1371dcaa0d' and 'b4edd88cb46c369e9fccc8df413e4fd36022f915' have entirely different histories.

@ -18,7 +18,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="Blazored.Modal" Version="7.1.0" />
<PackageReference Include="Blazorise.Bootstrap" Version="1.4.0" />

@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
using Microsoft.AspNetCore.Identity;
using BCrypt.Net;
using System.Security.Cryptography;
using System.ComponentModel.DataAnnotations;
using System.Text;
@ -23,24 +22,18 @@ public class AdministratorModel
public void HashPassword(string password)
{
this.HashedPassword = BCrypt.Net.BCrypt.HashPassword(password, BCrypt.Net.BCrypt.GenerateSalt());
using (MD5 md5 = MD5.Create())
{
byte[] inputBytes = Encoding.UTF8.GetBytes(password);
byte[] hashBytes = md5.ComputeHash(inputBytes);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.Length; i++)
{
sb.Append(hashBytes[i].ToString("x2"));
}
HashedPassword = sb.ToString();
}
}
//public void HashPassword(string password)
//{
// using (MD5 md5 = MD5.Create())
// {
// byte[] inputBytes = Encoding.UTF8.GetBytes(password);
// byte[] hashBytes = md5.ComputeHash(inputBytes);
// StringBuilder sb = new StringBuilder();
// for (int i = 0; i < hashBytes.Length; i++)
// {
// sb.Append(hashBytes[i].ToString("x2"));
// }
// HashedPassword = sb.ToString();
// }
//}
}

@ -21,23 +21,18 @@ public class PlayerModel
public void HashPassword(string password)
{
this.HashedPassword = BCrypt.Net.BCrypt.HashPassword(password, BCrypt.Net.BCrypt.GenerateSalt());
using (MD5 md5 = MD5.Create())
{
byte[] inputBytes = Encoding.UTF8.GetBytes(password);
byte[] hashBytes = md5.ComputeHash(inputBytes);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.Length; i++)
{
sb.Append(hashBytes[i].ToString("x2"));
}
HashedPassword = sb.ToString();
}
}
//public void HashPassword(string password)
//{
// using (MD5 md5 = MD5.Create())
// {
// byte[] inputBytes = Encoding.UTF8.GetBytes(password);
// byte[] hashBytes = md5.ComputeHash(inputBytes);
// StringBuilder sb = new StringBuilder();
// for (int i = 0; i < hashBytes.Length; i++)
// {
// sb.Append(hashBytes[i].ToString("x2"));
// }
// HashedPassword = sb.ToString();
// }
//}
}

@ -10,7 +10,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />

Loading…
Cancel
Save