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

HMAC not working as expected #14

Open
benoj opened this issue Mar 25, 2018 · 1 comment
Open

HMAC not working as expected #14

benoj opened this issue Mar 25, 2018 · 1 comment

Comments

@benoj
Copy link

benoj commented Mar 25, 2018

hmac:compute("The quick brown fox jumps over the lazy dog", "key" ,"SHA256")

produces: 97yD9DBThCSxMpjmqm+xQ+9NWaFJRhdZl0edvC0aPNg= which when base64 decoded returns garbage rather than the expected f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8

Am I using this module correctly?

@fs-aikito
Copy link

It is just different encoding of the same underlying bits:

$ echo "97yD9DBThCSxMpjmqm+xQ+9NWaFJRhdZl0edvC0aPNg=" | base64 -d | xxd -p -c 32
f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8

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

No branches or pull requests

2 participants