Deliria.Cryptography.PasswordHashing.Konscious
0.1.0
dotnet add package Deliria.Cryptography.PasswordHashing.Konscious --version 0.1.0
NuGet\Install-Package Deliria.Cryptography.PasswordHashing.Konscious -Version 0.1.0
<PackageReference Include="Deliria.Cryptography.PasswordHashing.Konscious" Version="0.1.0" />
paket add Deliria.Cryptography.PasswordHashing.Konscious --version 0.1.0
#r "nuget: Deliria.Cryptography.PasswordHashing.Konscious, 0.1.0"
// Install Deliria.Cryptography.PasswordHashing.Konscious as a Cake Addin #addin nuget:?package=Deliria.Cryptography.PasswordHashing.Konscious&version=0.1.0 // Install Deliria.Cryptography.PasswordHashing.Konscious as a Cake Tool #tool nuget:?package=Deliria.Cryptography.PasswordHashing.Konscious&version=0.1.0
Deliria.Cryptography.PasswordHashing.Konscious
Deliria.Cryptography.PasswordHashing.Konscious
is a library implementing the password hashing interface from Deliria.Cryptography.PasswordHashing
using the Konscious.Security.Cryptography.Argon2
library as the concrete Argon2 algorithm implementation.
By default it uses OWASP's recommended parameters, but you can also take full control of the parameters if desired.
Disclaimer: The "verification and upgrade" feature is currently untested. We do not recommend using it in production environments, but you are welcome to experiment with it.
Table of Contents
Installation
To get started, install the Deliria.Cryptography.PasswordHashing.Konscious
package, which utilizes the Konscious.Security.Cryptography.Argon2
implementation.
Usage
To hash passwords, you can use the PasswordHasherKonscious
class, which implements the IPasswordHasher
interface. If you are using Dependency Injection, you can register the hasher as follows:
builder.Services.AddSingleton<IPasswordHasher, PasswordHasherKonscious>();
Examples
Here is an example demonstrating how to use the password hasher:
// Create an instance of the password hasher
IPasswordHasher hasher = new PasswordHasherKonscious();
// Prepare the input parameters with the password to be hashed
InputParams input = new InputParams("test-password".ToBytes());
// Hash the password
PasswordHashDto result = hasher.HashPassword(input);
// Verify the hashed password
bool verification = hasher.VerifyPassword(input, result);
Console.WriteLine($"Verified successfully: {verification}");
For more complex usage take a look at the IPasswordHasher
interface documentation.
Implementing Custom Hashers
Refer to Implementing Custom Hashers.
Contributing
We welcome contributions to improve this library! Please feel free to submit issues or pull requests.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Deliria.Cryptography.PasswordHashing (>= 0.1.0)
- Konscious.Security.Cryptography.Argon2 (>= 1.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.0 | 121 | 9/17/2024 |