LoginRadius / csharp-password-hash

.NET standard library to secure the passwords using multiple hashing algorithms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HMAC_SHA1 and HMAC_SHA256 is not supporting all encoding types

anilswm opened this issue · comments

https://github.com/LoginRadius/csharp-password-hash/blob/master/csharp-password-hash/csharp-password-hash/Hashing.cs

Method ToHMAC_SHA1 and ToHMAC_SHA256 are not supporting all encoding like others.

commented

You can assign this to me. I would generally refactor all the repeations into a base function that uses https://docs.microsoft.com/en-US/dotnet/api/system.security.cryptography.hashalgorithm.computehash?view=netcore-3.1 which all these hash classes implement. and return the encoded result from there.

That would also solve the issue that new encodings must be added everywhere with the exact same code in 10 different places.

Hey @Fyers
Thanks for contributing to LoginRadius Open Source. As part of hacktoberfest, LoginRadius is also giving free swags and goodies to its contributors. Please check out our Hacktoberfest Page and fill the form mentioned there to become eligible for free swags. :)