This commit is contained in:
mmrbnjd
2025-06-29 16:14:42 +03:30
parent 86de5d3e39
commit bc65878608
7 changed files with 165 additions and 3 deletions

View File

@@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace Hushian.Application.Services
{
public static class HashPassword
{
public static string GetHash(this string Password)
{
string hashed = Convert.ToBase64String(KeyDerivation.Pbkdf2(
password: Password!,
salt: Encoding.ASCII.GetBytes("CGYzqejKH50&kjh(02**Id1Q"),
prf: KeyDerivationPrf.HMACSHA256,
iterationCount: 100000,
numBytesRequested: 256 / 8));
return hashed;
}
}
}