Giter Club home page Giter Club logo

sharphash's Introduction

SharpHash License Build Status Nuget Nuget

SharpHash is a C# hashing library that provides a fluent interface for computing hashes and checksums of strings, files, streams, bytearrays and untyped data to mention but a few.

It also supports Incremental Hashing, Cloning, NullDigest and HashName Builder.

Available Algorithms

Hashes


Cyclic Redundancy Checks
  • All CRC Variants from CRC3 to CRC64 ✔️
Checksums
  • Adler32 ✔️
Non-Cryptographic Hash Functions

32 bit hashes
  • AP BKDR Bernstein Bernstein1 DEK DJB ELF FNV ✔️

  • FNV1a JS Jenkins3 Murmur2 MurmurHash3_x86_32 OneAtTime ✔️

  • PJW RS Rotating SDBM ShiftAndXor SuperFast XXHash32 ✔️

64 bit hashes
  • FNV64 FNV1a64 Murmur2_64 SipHash64_2_4 XXHash64 ✔️
128 bit hashes
  • MurmurHash3_x86_128 MurmurHash3_x64_128 SipHash128_2_4 ✔️
Cryptographic Hash Functions

  • MD2 ✔️

  • MD4 ✔️

  • MD5 ✔️

  • SHA-0 ✔️

  • SHA-1 ✔️

  • SHA-2 (224, 256, 384, 512, 512-224, 512-256) ✔️

  • GOST 34.11-94 ✔️

  • GOST R 34.11-2012 (AKA Streebog) (256, 512) ✔️

  • Grindahl (256, 512) ✔️

  • HAS160 ✔️

  • RIPEMD (128, 256, 256, 320) ✔️

  • Tiger (128, 160, 192 (Rounds 3, 4, 5)) ✔️

  • Tiger2 (128, 160, 192 (Rounds 3, 4, 5)) ✔️

  • Snefru (128, 256) ✔️

  • Haval (128, 160, 192, 224, 256 (Rounds 3, 4, 5)) ✔️

  • Panama ✔️

  • RadioGatun (RadioGatun32, RadioGatun64) ✔️

  • WhirlPool ✔️

  • Blake2B (160, 256, 384, 512) ✔️

  • Blake2S (128, 160, 224, 256) ✔️

  • SHA-3 (224, 256, 384, 512) ✔️

  • Keccak (224, 256, 288, 384, 512) ✔️

  • Blake2BP ✔️

  • Blake2SP ✔️

  • Blake3 ✔️

Key Derivation Functions


Password Hashing Schemes (Password Based Key Derivation Functions)

  • PBKDF2 ✔️

  • Argon2 (2i, 2d and 2id variants) ✔️

  • Scrypt ✔️

MAC


  • HMAC (all supported hashes) ✔️

  • KMAC (KMAC128, KMAC256) ✔️

  • Blake2MAC (Blake2BMAC, Blake2SMAC) ✔️

XOF (Extendable Output Function)


  • Shake (Shake-128, Shake-256) ✔️

  • CShake (CShake-128, CShake-256) ✔️

  • Blake2X (Blake2XS, Blake2XB) ✔️

  • KMACXOF (KMAC128XOF, KMAC256XOF) ✔️

  • Blake3XOF ✔️

Usage Examples


using SharpHash.Base;
using SharpHash.Interfaces;
using System;
using System.Text;

namespace Program
{
    public class Hello 
    {
	public static void Main() 
	{
	    // Chaining mode
	    string result = HashFactory.Crypto.CreateMD5()
	    			.ComputeString("Hello C#", Encoding.UTF8).ToString();

	    // Incremental mode
	    IHash hash = HashFactory.Crypto.CreateMD5();
	    hash.Initialize();
	    hash.TransformString("Hello", Encoding.UTF8);
	    hash.TransformString(" C#", Encoding.UTF8);
	    string result_2 = hash.TransformFinal().ToString();

	    bool check = result == result_2;
	
	    // Using the HashName Builder variation
	    IHash hash_builder = HashFactory.CreateHash("md5");
	    string result_3 = hash_builder.ComputeString("Hello C#", 
				Encoding.UTF8).ToString();
	    bool check_2 = result == result_3;
	}
    }
}

Other Implementations


If you want implementations in other languages, you can check out these

Tip Jar


  • 💵 Bitcoin: 1Mcci95WffSJnV6PsYG7KD1af1gDfUvLe6

sharphash's People

Contributors

izarchtech avatar ron4fun avatar xor-el avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sharphash's Issues

Not Production Ready?

Hi, I would really like to use SharpHash in a project, but the README states that it is not production ready. I am just wondering if that is still true, or what the timeline is for getting it to that state.

Nuget package?

I am curious if there was a nuget package or if there were plans for one? I would be happy to create one, but I am sure you would rather.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.