DiSHACrypt 1.0.1

dotnet add package DiSHACrypt --version 1.0.1
                    
NuGet\Install-Package DiSHACrypt -Version 1.0.1
                    
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="DiSHACrypt" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DiSHACrypt" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="DiSHACrypt" />
                    
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 DiSHACrypt --version 1.0.1
                    
#r "nuget: DiSHACrypt, 1.0.1"
                    
#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.
#addin nuget:?package=DiSHACrypt&version=1.0.1
                    
Install DiSHACrypt as a Cake Addin
#tool nuget:?package=DiSHACrypt&version=1.0.1
                    
Install DiSHACrypt as a Cake Tool

DiSHACrypt

Implementation of 'Unix crypt using SHA-256 and SHA-512'

This project provides an implementation of the 'Unix crypt using SHA-256 and SHA-512' algorithm (as specified by Ulrich Drepper in https://www.akkadia.org/drepper/SHA-crypt.txt).

It also includes a variant for MySQL's caching_sha2_password authentication plugin.

Example Usage

Generate SHA-256 digest string with random salt and default rounds
using DiSHACrypt;

string digest1 = new SHACryptSHA256().Crypt("my-SECURE-password!");

Console.WriteLine($"SHA-256 digest with random salt and default rounds:\n{digest1}");
Generate SHA-256 digest string with specified salt and default rounds
using DiSHACrypt;

string digest2 = new SHACryptSHA256().Crypt("a_password", "my_salt");

Console.WriteLine($"\nSHA-256 digest with specified salt and default rounds:\n{digest2}");
Generate SHA-512 digest string with specified salt and rounds
using DiSHACrypt;

string digest3 = new SHACryptSHA512().Crypt("yetanotherpwd", "yetanothersalt", 7000);

Console.WriteLine($"\nSHA-512 digest with specified salt and rounds:\n{digest3}");
Generate MySQL caching_sha2_password authentication string with random salt and specified rounds
using DiSHACrypt;

string digest4 = new SHACryptMySqlSHA256().Crypt("Another-password?", rounds: 15000);

Console.WriteLine($"\nMySQL caching_sha2_password authentication string:\n{digest4}");
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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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
1.0.1 99 a month ago

Initial release