Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viniciuschiele/scrypt
A .NET implementation of scrypt password hash algorithm.
https://github.com/viniciuschiele/scrypt
bcrypt c-sharp hash hashing-algorithm protect-passwords scrypt
Last synced: 13 days ago
JSON representation
A .NET implementation of scrypt password hash algorithm.
- Host: GitHub
- URL: https://github.com/viniciuschiele/scrypt
- Owner: viniciuschiele
- License: apache-2.0
- Created: 2014-11-14T01:02:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-07-16T11:50:46.000Z (4 months ago)
- Last Synced: 2024-10-15T08:43:26.652Z (29 days ago)
- Topics: bcrypt, c-sharp, hash, hashing-algorithm, protect-passwords, scrypt
- Language: C#
- Size: 42 KB
- Stars: 95
- Watchers: 9
- Forks: 22
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Scrypt.NET
[![Build Status](https://travis-ci.org/viniciuschiele/Scrypt.svg)](https://travis-ci.org/viniciuschiele/Scrypt)
scrypt is a password hash algorithm created by [Tarsnap](http://www.tarsnap.com/scrypt.html) in 2012 that allow us to protect passwords stored on databases against brute force attacks.
This .NET implementation of scrypt is a port of [original implementation in C](http://www.tarsnap.com/scrypt.html), which generates the same hash as the original implementation does. This implementation is fast but not as fast as original one because the original one is written in C and it uses SIMD instructions.
If you would like to know further about hashing algorithms and how to protect passwords I really recommend you to read that article [Password Hashing](https://crackstation.net/hashing-security.htm).
## Requirements
.NET 2.0 or .NET Core
## Examples
Generating a new hash for a password:
```csharp
ScryptEncoder encoder = new ScryptEncoder();
string hashsedPassword = encoder.Encode("mypassword");
```Comparing a password against a hashed password:
```csharp
ScryptEncoder encoder = new ScryptEncoder();bool areEquals = encoder.Compare("mypassword", hashedPassword);
```The recommended parameters for interactive logins as of 2009 are iterationCount=16384, blockSize=8, threadCount=1, those are the default values.
They should be increased as memory latency and CPU parallelism increases.It is compatible with .NET Core and it works perfectly in Linux and OSX using [mono](http://www.mono-project.com) or the .NET Core, I'm not sure about mobile phones but I believe that it should work as well.
## Install
Install via NuGet: `Install-Package Scrypt.NET`
## Feedback
Please use the [Issues](https://github.com/viniciuschiele/scrypt/issues) for feature requests and troubleshooting usage.