Coder Social home page Coder Social logo

hmac_sha256 incorrect about sha.jl HOT 2 CLOSED

juliacrypto avatar juliacrypto commented on July 17, 2024
hmac_sha256 incorrect

from sha.jl.

Comments (2)

staticfloat avatar staticfloat commented on July 17, 2024 1

The correct answer to this particular example is ce0006ef9b02c5c710b8bfcb47e6f5177b44323992e2918dfbdb087a03ec6f4f. The issue here is that you are not feeding tmp_key to the other tools you're checking against, you're feeding bytes2hex(tmp_key), they're not the same thing. The online tool that you posted is not interpreting the key as hex, it's reading the UTF-8 input bytes and using those binary representations.

If you want to do that, use hmac_sha256(collect(codeunits(tmp_key)), str) instead of hmac_sha256(tmp_key, str).

To double-check, use an online tool such as https://www.liavaag.org/English/SHA-Generator/HMAC/ and use Key type: HEX with the key e85726cc1b12609bbaebe535f0926f59.

from sha.jl.

pankgeorg avatar pankgeorg commented on July 17, 2024

Nonetheless, this issue is the closest thing to hmac_sha256 documentation I've found. Thanks for the reply!

from sha.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.