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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Deliria.Cryptography.PasswordHashing.Konscious" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Deliria.Cryptography.PasswordHashing.Konscious --version 0.1.0                
#r "nuget: Deliria.Cryptography.PasswordHashing.Konscious, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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