.NET implementation of scrypt

C#.NetCryptographyHashScrypt

C# Problem Overview


I've read about scrypt and some of its advantages over the bcrypt hashing algorithm in certain circumstances.

Anyhow, it seems scrypt isn't as widely used yet. Has anyone seen so far a .NET implementation of it (favored in C#)?

C# Solutions


Solution 1 - C#

Finally I found an implementation of scrypt in C# in the CryptSharp library.
The library is open source and uses the ISC license.

> Version History > > 1.2.0 January 23, 2011:
> The SCrypt KDF is now supported as CryptSharp.Utility.SCrypt.
> Added djb's Salsa20, required by SCrypt.

Solution 2 - C#

In case, like me, you came to this question via a quick google (came up as the top link) you can now download SCrypt as a Nuget package into your project.

PM> Install-Package Scrypt.NET

Use as follows:

ScryptEncoder encoder = new ScryptEncoder();
string hashsedPassword = encoder.Encode("mypassword");

and comparing

ScryptEncoder encoder = new ScryptEncoder();
bool areEquals = encoder.Compare("mypassword", hashedPassword);

Github link here

Solution 3 - C#

There's a new implementation of SCrypt for .NET here: https://github.com/replicon/Replicon.Cryptography.SCrypt

Unlike CryptoSharp, which is a great library, this one is implemented as a packaged wrapper around a native library. This allows it to use native-level instructions (like SSE2) to improve the performance of the implementation quite a bit.

The downside is that it has to contain native compiled assemblies, detect the right one to use, unpackage it, and then load it. That means it's not ideal for all environments, but it works great where it works.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMartin BuberlView Question on Stackoverflow
Solution 1 - C#Martin BuberlView Answer on Stackoverflow
Solution 2 - C#VictorySaberView Answer on Stackoverflow
Solution 3 - C#mfenniakView Answer on Stackoverflow