diff options
Diffstat (limited to 'src/slskd/Common/Cryptography/PBKDF2.cs')
| -rw-r--r-- | src/slskd/Common/Cryptography/PBKDF2.cs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/slskd/Common/Cryptography/PBKDF2.cs b/src/slskd/Common/Cryptography/PBKDF2.cs deleted file mode 100644 index 4b8b83e4..00000000 --- a/src/slskd/Common/Cryptography/PBKDF2.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace slskd.Security -{ - using Microsoft.AspNetCore.Cryptography.KeyDerivation; - using System.Security.Cryptography; - - /// <summary> - /// PBKDF2/RFC 2898 implementation - /// </summary> - public static class PBKDF2 - { - /// <summary> - /// Gets a 256 bit (32 byte) key derived from the specified <paramref name="password"/> using PBKDF2/RFC 2898 - /// </summary> - /// <param name="password"></param> - /// <returns></returns> - public static byte[] GetKey(string password) - { - byte[] salt = new byte[16]; - int iterations = 1000; - - using var rng = RandomNumberGenerator.Create(); - rng.GetBytes(salt); - return KeyDerivation.Pbkdf2(password, salt, KeyDerivationPrf.HMACSHA256, iterations, 32); - } - } -} |
