21 lines
418 B
C#
21 lines
418 B
C#
using System;
|
|
using System.Security.Cryptography;
|
|
namespace BITKit.Crypto
|
|
{
|
|
public class BITCrypto:ICryptography
|
|
{
|
|
public string Salt { get; set; } = "2196F3";
|
|
public string Hash(string password)
|
|
{
|
|
var data = System.Text.Encoding.UTF8.GetBytes(password + Salt);
|
|
return Convert.ToBase64String(data);
|
|
}
|
|
|
|
public bool Verify(string password, string hash)
|
|
{
|
|
return Hash(password) == hash;
|
|
}
|
|
}
|
|
}
|
|
|