✨
This commit is contained in:
18
StopShopping.Services/Implementions/CipherService.cs
Normal file
18
StopShopping.Services/Implementions/CipherService.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user