Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HMAC #4

Open
mackwil opened this issue Mar 5, 2014 · 3 comments
Open

Add support for HMAC #4

mackwil opened this issue Mar 5, 2014 · 3 comments

Comments

@mackwil
Copy link

mackwil commented Mar 5, 2014

Can this library receive hex or base64 as input into the hash?

Can this library perform HMAC using the SHA3 algorithm? I would like to do HMAC(key, message) with perhaps either or both parameters as hex.

These would be a few good features. Please consider adding them if it doesn't work already.

Thank you!

@strawbrary
Copy link
Owner

If you pass in a hex string or base64 encoded string it should work.

HMAC is not yet supported, but it's something I may add in the future.

@strawbrary strawbrary changed the title Allow hexadecimal and/or Base64 input into the hash Add support for HMAC May 4, 2015
@pculka
Copy link

pculka commented Aug 11, 2015

+1

@2072
Copy link

2072 commented Jan 2, 2016

Note that since sha3 is not vulnerable to extension attacks one can just prepend the secret key to the message to be authenticated in order to build a secure MAC.

Unlike SHA-1 and SHA-2, Keccak does not have the length-extension weakness, hence does not need the HMAC nested construction. Instead, MAC computation can be performed by simply prepending the message with the key.

source: http://keccak.noekeon.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants