Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/picrap/hashmac
An HMAC with any HashAlgorithm
https://github.com/picrap/hashmac
hash hmac mac
Last synced: 24 days ago
JSON representation
An HMAC with any HashAlgorithm
- Host: GitHub
- URL: https://github.com/picrap/hashmac
- Owner: picrap
- License: mit
- Created: 2022-11-26T20:22:58.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-26T20:03:25.000Z (3 months ago)
- Last Synced: 2024-09-30T23:48:44.612Z (about 1 month ago)
- Topics: hash, hmac, mac
- Language: C#
- Homepage:
- Size: 90.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# HashMAC
A flexible [HMAC implementation](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.hmac), allowing to specify any `HashAlgorithm` as input.
Available as a [![NuGet](https://img.shields.io/nuget/v/HashMAC.svg?style=flat-square)](https://www.nuget.org/packages/HashMAC) package.# How to use it
## `HashMAC` itself
Short answer: as a [standard HMAC](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.hmac) 😉
The `HMAC` base class derives itself from `HashAlgorithm`, so except the constructor which takes a secret key, the usage is the same.## Using it with other hashes
### SHA3
NuGet packages:
- [SHA3](https://www.nuget.org/packages/SHA3): not not maintained anymore
- [SHA3.net](https://www.nuget.org/packages/SHA3.Net): embeds code from Bouncy CastleHashes block sizes (required by `HashMAC.Create()`):
| SHA3 size (bits) | Block size (bits) | Block size (bytes) |
|-|-|-|
| 224 | 1152 | 144 |
| 256 | 1088 | 136 |
| 384 | 832 | 104 |
| 512 | 576 | 72 |# References
- [RFC 2104](https://www.rfc-editor.org/rfc/rfc2104): the reference
- [Wikipedia](https://fr.wikipedia.org/wiki/HMAC): a human-readable description# Thank you
- [Web Vectors by Vecteezy](https://www.vecteezy.com/free-vector/web)