19 lines
449 B
C#
19 lines
449 B
C#
using System.Security.Cryptography;
|
|
using System.Text;
|
|
|
|
namespace StopShopping.Services.Implementions;
|
|
|
|
public class CipherService : ICipherService
|
|
{
|
|
public string EncryptUserPassword(string input)
|
|
{
|
|
string hmacKey = "stopshopping";
|
|
|
|
using HMACSHA256 sha256 = new(Encoding.UTF8.GetBytes(hmacKey));
|
|
|
|
var hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(input));
|
|
|
|
return Convert.ToHexStringLower(hash);
|
|
}
|
|
}
|