{"id":19041358,"url":"https://github.com/andreyrusyaev/acryptohashnet","last_synced_at":"2025-07-04T21:41:04.046Z","repository":{"id":46867257,"uuid":"400407603","full_name":"AndreyRusyaev/acryptohashnet","owner":"AndreyRusyaev","description":"A pure managed C# implementation of well-known cryptographic hash functions such as SHA-family (SHA0, SHA1, SHA2, SHA3), MD-family (MD2, MD4, MD5), Keccak family, RIPEMD, Tiger, Haval, Snefru.","archived":false,"fork":false,"pushed_at":"2025-02-24T12:47:40.000Z","size":14173,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T21:33:33.727Z","etag":null,"topics":["cryptography","cryptohash","digest","hash","haval","keccak","md4","md5","ripemd","sha0","sha1","sha2","sha256","sha3","sha3-256","sha3-512","sha512","snefru","tiger"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndreyRusyaev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-27T06:12:54.000Z","updated_at":"2025-03-30T10:41:17.000Z","dependencies_parsed_at":"2025-04-23T21:41:11.072Z","dependency_job_id":null,"html_url":"https://github.com/AndreyRusyaev/acryptohashnet","commit_stats":{"total_commits":45,"total_committers":3,"mean_commits":15.0,"dds":0.0444444444444444,"last_synced_commit":"51b871e00d8422c1c085f78bf3f0e8d456d14561"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/AndreyRusyaev/acryptohashnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Facryptohashnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Facryptohashnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Facryptohashnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Facryptohashnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreyRusyaev","download_url":"https://codeload.github.com/AndreyRusyaev/acryptohashnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreyRusyaev%2Facryptohashnet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263625615,"owners_count":23490588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","cryptohash","digest","hash","haval","keccak","md4","md5","ripemd","sha0","sha1","sha2","sha256","sha3","sha3-256","sha3-512","sha512","snefru","tiger"],"created_at":"2024-11-08T22:28:46.781Z","updated_at":"2025-07-04T21:41:04.024Z","avatar_url":"https://github.com/AndreyRusyaev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# acryptohashnet\nA pure managed C# implementation of cryptographic hash functions for .Net Standard 2.0 compatible platforms (.Net Framework, .Net Core, Mono, Xamarin, UWP, Unity).\n\n[![NuGet Downloads](https://img.shields.io/nuget/dt/acryptohashnet)](https://www.nuget.org/packages/acryptohashnet)\n[![NuGet Version](https://img.shields.io/nuget/v/acryptohashnet)](https://www.nuget.org/packages/acryptohashnet)\n\n# Features  \n\n* Pure managed C# implementation,\n* Compatible with System.Security.Cryptography.HashAlgorithm and can be used everywhere as a simple drop replacement for the target hash algorithm,\n* Extremely fast, highly optimized with low memory footprint (less GC time).\n\n# Supported hash functions\n\n* MD family: MD2, MD4, MD5,\n* SHA family: SHA0, SHA1,\n* SHA2 family: SHA224, SHA256, SHA384, SHA512,\n* SHA3 family: SHA3-224, SHA3-256, SHA3-384, SHA3-512,\n* Keccak family: Keccak224, Keccak256, Keccak384, Keccak512,\n* RIPEMD family: RIPEMD128, RIPEMD160,\n* Haval family: Haval128, Haval160, Haval192, Haval224, Haval256,\n* Snefru, Snefru256,\n* Tiger and Tiger2 (192 bits output)\n\n# Usage examples\n\n## MD5\n\n``` csharp\nusing System;\nusing System.Linq;\nusing System.Text;\n\nstatic class Program\n{\n    static void Main(string[] args)\n    {\n        var message = \"Test Message\";\n\n        var hashAlgorithm = new acryptohashnet.MD5();\n        Console.WriteLine(\"MD5: {0}\", hashAlgorithm.ComputeHash(message.ToUtf8Bytes()).ToHexString());\n    }\n\n    static byte[] ToUtf8Bytes(this string input) =\u003e Encoding.UTF8.GetBytes(input);\n    static string ToHexString(this byte[] input) =\u003e string.Join(\"\", input.Select(x =\u003e x.ToString(\"x2\")));\n}\n```\n\n## SHA256 (SHA2-256 bits)\n\n``` csharp\nusing System;\nusing System.Linq;\nusing System.Text;\n\nstatic class Program\n{\n    static void Main(string[] args)\n    {\n        var message = \"Test Message\";\n\n        var hashAlgorithm = new acryptohashnet.Sha2_256();\n        Console.WriteLine(\"SHA256: {0}\", hashAlgorithm.ComputeHash(message.ToUtf8Bytes()).ToHexString());\n    }\n\n    static byte[] ToUtf8Bytes(this string input) =\u003e Encoding.UTF8.GetBytes(input);\n    static string ToHexString(this byte[] input) =\u003e string.Join(\"\", input.Select(x =\u003e x.ToString(\"x2\")));\n}\n```\n\n## SHA3_256 (SHA3-256 bits)\n\n``` csharp\nusing System;\nusing System.Linq;\nusing System.Text;\n\nstatic class Program\n{\n    static void Main(string[] args)\n    {\n        var message = \"Test Message\";\n\n        var hashAlgorithm = new acryptohashnet.Sha3_256();\n        Console.WriteLine(\"SHA3_256: {0}\", hashAlgorithm.ComputeHash(message.ToUtf8Bytes()).ToHexString());\n    }\n\n    static byte[] ToUtf8Bytes(this string input) =\u003e Encoding.UTF8.GetBytes(input);\n    static string ToHexString(this byte[] input) =\u003e string.Join(\"\", input.Select(x =\u003e x.ToString(\"x2\")));\n}\n```\n\n## Keccak256 (Keccak 256 bits)\n\n``` csharp\nusing System;\nusing System.Linq;\nusing System.Text;\n\nstatic class Program\n{\n    static void Main(string[] args)\n    {\n        var message = \"Test Message\";\n\n        var hashAlgorithm = new acryptohashnet.Keccak256();\n        Console.WriteLine(\"Keccak256: {0}\", hashAlgorithm.ComputeHash(message.ToUtf8Bytes()).ToHexString());\n    }\n\n    static byte[] ToUtf8Bytes(this string input) =\u003e Encoding.UTF8.GetBytes(input);\n    static string ToHexString(this byte[] input) =\u003e string.Join(\"\", input.Select(x =\u003e x.ToString(\"x2\")));\n}\n```\n\n## Compute string message hash via HashAlgorithm interface (MD5, SHA1, SHA256, SHA3-512)\n\n``` csharp\nstatic class Program\n{\n    static void Main(string[] args)\n    {\n        var md5 = new acryptohashnet.MD5();\n        var sha1 = new acryptohashnet.SHA1();\n        var sha2_256 = new acryptohashnet.Sha2_256();\n        var sha3_512 = new acryptohashnet.Sha3_512();\n\n        var message = \"Lorem ipsum is placeholder text commonly used in the graphic, \" +\n                  \"print, and publishing industries for previewing layouts and visual mockups.\";\n\n        Console.WriteLine(\"MD5: {0}\", md5.ComputeHash(message.ToUtf8Bytes()).ToHexString());\n        Console.WriteLine(\"SHA1: {0}\", sha1.ComputeHash(message.ToUtf8Bytes()).ToHexString());\n        Console.WriteLine(\"SHA256: {0}\", sha2_256.ComputeHash(message.ToUtf8Bytes()).ToHexString());\n        Console.WriteLine(\"SHA3-512: {0}\", sha3_512.ComputeHash(message.ToUtf8Bytes()).ToHexString());\n    }\n\n    static byte[] ToUtf8Bytes(this string input) =\u003e System.Text.Encoding.UTF8.GetBytes(input);\n    static string ToHexString(this byte[] input) =\u003e string.Join(\"\", input.Select(x =\u003e x.ToString(\"x2\")));\n}\n```\n\n## Compute hash of file via HashAlgorithm interface (MD5, SHA1, SHA256, SHA3-512)\n\n``` csharp\nstatic class Program\n{\n    static void Main(string[] args)\n    {\n        var md5 = new acryptohashnet.MD5();\n        var sha1 = new acryptohashnet.SHA1();\n        var sha2_256 = new acryptohashnet.Sha2_256();\n        var sha3_512 = new acryptohashnet.Sha3_512();\n\n        using (var file = File.OpenRead(@\"C:\\Windows\\explorer.exe\"))\n        {\n            Console.WriteLine(\"MD5: {0}\", md5.ComputeHash(file).ToHexString());\n\n            file.Position = 0; // Rewind stream to beginning\n            Console.WriteLine(\"SHA1: {0}\", sha1.ComputeHash(file).ToHexString());\n\n            file.Position = 0; // Rewind stream to beginning\n            Console.WriteLine(\"SHA256: {0}\", sha2_256.ComputeHash(file).ToHexString());\n\n            file.Position = 0; // Rewind stream to beginning\n            Console.WriteLine(\"SHA3-512: {0}\", sha3_512.ComputeHash(file).ToHexString());\n        }\n    }\n\n    static string ToHexString(this byte[] input) =\u003e string.Join(\"\", input.Select(x =\u003e x.ToString(\"x2\")));\n}\n```\n\n# Implemented hash algorithms\n\n## MD Family\nAll functions designed and specified by [Ron Rivest](https://en.wikipedia.org/wiki/Ron_Rivest).\n  * MD2, specification: [RFC 1319](docs/rfc1319.txt).\n  * MD4, specification: [RFC 1320](docs/rfc1320.txt).\n  * MD5, specification: [RFC 1321](docs/rfc1320.txt).\n\n## SHA0 \u0026 SHA1\nSecure Hash Standard [[pdf]](docs/NIST.FIPS.180-4.pdf)\n\n## SHA2 Family\nSecure Hash Standard [[pdf]](docs/NIST.FIPS.180-4.pdf)\n\nPublished as standard by \"National Institute of Standards and Technology\".\n\n* SHA-0, \n* SHA-1,\n* SHA2-224 (also known as SHA224),\n* SHA2-256 (also known as SHA256),\n* SHA2-384 (also known as SHA384),\n* SHA2-512 (also known as SHA512)\n\n## SHA3 Family\nSHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions [[pdf]](docs/NIST.FIPS.202.pdf)\n\nPublished as standard by \"National Institute of Standards and Technology\".\n\n* SHA3-224,\n* SHA3-256,\n* SHA3-384,\n* SHA3-512\n\n## Keccak family\nKeccak implementation overview [[pdf]](docs/Keccak-implementation-3.2.pdf)\n\nDesigned by Guido Bertoni, Joan Daeme, Michaël Peeters, Gilles Van Assche and Ronny Van Keer.\n\n* Keccak224,\n* Keccak256,\n* Keccak384,\n* Keccak512\n\n## RIPEMD\nRIPEMD-160: A Strengthened Version of RIPEMD [[pdf]](docs/AB-9601.pdf)\n\nDesigned by Hans Dobbertin, Antoon Bosselaers, [Bart Preneel](https://en.wikipedia.org/wiki/Bart_Preneel)\n\n## Haval\nHAVAL — A One-Way Hashing Algorithm with Variable Length of Output [[pdf]](docs/haval-paper.pdf)\n\nDesigned by Yuliang Zheng, Josef Pieprzyk and Jennifer Seberry.\n\n## Snefru\nA Fast Software One-Way Hash Function [[pdf]](docs/Merkle1990_Article_AFastSoftwareOne-wayHashFuncti.pdf)\n\nDesigned and specified by [Ralph C. Merkle](https://en.wikipedia.org/wiki/Ralph_Merkle).\n\n## Tiger and Tiger2\n[Tiger: A Fast New Hash Function](https://www.cs.technion.ac.il/~biham/Reports/Tiger/) [[ps]](docs/tiger.ps) [[pdf]](docs/tiger.pdf)\n\nDesigned and specified by [Ross Anderson](https://en.wikipedia.org/wiki/Ross_J._Anderson) and [Eli Biham](https://en.wikipedia.org/wiki/Eli_Biham).\n\n# History\nOriginally project was developed between 2006-2009 as an open source project and was hosted on SourceForge: https://sourceforge.net/projects/acryptohashnet/.\nIn 2020 was migrated to Github and modernized for support .Net Core platform.\n\n# Used by commercial and open source software\n\n* Motorola RM Software\n* Quest Software [Metalogix Archive Manager for Exchange](https://support.quest.com/technical-documents/metalogix-archive-manager-for-exchange/8.5/release-notes/5)\n* Soft EtherConfig Password Node Generator https://github.com/SecretNest/SoftEtherConfigPasswordNodeGenerate\n* Microsoft .NET wrapper for connecting to EMC Atmos Storage Service https://github.com/EMCECS/atmos-dotnet\n* iTextSharp unofficial .Net Core port https://github.com/VahidN/iTextSharp.LGPLv2.Core\n* UnityClassNameHasher https://github.com/OptoCloud/UnityClassNameHasher\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreyrusyaev%2Facryptohashnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreyrusyaev%2Facryptohashnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreyrusyaev%2Facryptohashnet/lists"}