13 lines
537 B
C#
13 lines
537 B
C#
using System;
|
|
using System.Security.Cryptography;
|
|
using System.Text;
|
|
|
|
var password = "Admin@2026";
|
|
var iterations = 100000;
|
|
var salt = RandomNumberGenerator.GetBytes(32);
|
|
var hash = Rfc2898DeriveBytes.Pbkdf2(Encoding.UTF8.GetBytes(password), salt, iterations, HashAlgorithmName.SHA256, 32);
|
|
var combined = new byte[salt.Length + hash.Length];
|
|
Buffer.BlockCopy(salt, 0, combined, 0, salt.Length);
|
|
Buffer.BlockCopy(hash, 0, combined, salt.Length, hash.Length);
|
|
Console.WriteLine($"PBKDF2.{iterations}.{Convert.ToBase64String(combined)}");
|