Bitwarden.Server.Sdk.PasswordHashing 0.1.0

Prefix Reserved
dotnet add package Bitwarden.Server.Sdk.PasswordHashing --version 0.1.0
                    
NuGet\Install-Package Bitwarden.Server.Sdk.PasswordHashing -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="Bitwarden.Server.Sdk.PasswordHashing" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitwarden.Server.Sdk.PasswordHashing" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Bitwarden.Server.Sdk.PasswordHashing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitwarden.Server.Sdk.PasswordHashing --version 0.1.0
                    
#r "nuget: Bitwarden.Server.Sdk.PasswordHashing, 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.
#:package Bitwarden.Server.Sdk.PasswordHashing@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitwarden.Server.Sdk.PasswordHashing&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Bitwarden.Server.Sdk.PasswordHashing&version=0.1.0
                    
Install as a Cake Tool

Bitwarden.Server.Sdk.PasswordHashing

About

Hashes a password hash a client derived (a master password hash or a Send password hash) before a service stores it, and checks a client's hash against the stored one. Hashes are compatible with those the Bitwarden server stores: either side verifies the other's.

Installing

dotnet add package Bitwarden.Server.Sdk.PasswordHashing

Usage

services.AddServerPasswordHasher();

Wrap what the client sent in ClientCreatedHash and store the ServerStorableHash it returns. The wrappers keep the two from being swapped, and their ToString hides the value:

var clientHash = new ClientCreatedHash(request.MasterPasswordHash);
user.MasterPassword = hasher.CreateStoredHash(clientHash).Value;

Check it, and replace a hash stored with older parameters:

var clientHash = new ClientCreatedHash(request.MasterPasswordHash);
var result = hasher.VerifyStoredHash(new ServerStorableHash(user.MasterPassword), clientHash);
if (result == PasswordHashVerification.SuccessRehashNeeded)
{
    user.MasterPassword = hasher.CreateStoredHash(clientHash).Value;
}

return result != PasswordHashVerification.Failed;

Algorithm

ASP.NET Core Identity's V3 format: PBKDF2-HMAC-SHA512, 100,000 iterations, 128-bit random salt, 256-bit subkey. A host's own PasswordHasherOptions do not change it.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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 30,489 11/16/2026