mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-08 20:38:24 +02:00
This also migrates already created passwords on login Source for the number of iterations: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2
24 lines
714 B
C#
24 lines
714 B
C#
#pragma warning disable CS1591
|
|
|
|
using System;
|
|
|
|
namespace MediaBrowser.Model.Cryptography
|
|
{
|
|
public interface ICryptoProvider
|
|
{
|
|
string DefaultHashMethod { get; }
|
|
|
|
/// <summary>
|
|
/// Creates a new <see cref="PasswordHash" /> instance.
|
|
/// </summary>
|
|
/// <param name="password">The password that will be hashed.</param>
|
|
/// <returns>A <see cref="PasswordHash" /> instance with the hash method, hash, salt and number of iterations.</returns>
|
|
PasswordHash CreatePasswordHash(ReadOnlySpan<char> password);
|
|
|
|
bool Verify(PasswordHash hash, ReadOnlySpan<char> password);
|
|
|
|
byte[] GenerateSalt();
|
|
|
|
byte[] GenerateSalt(int length);
|
|
}
|
|
}
|