4

I have been trying to figure out why the command in bash is generating a different signature than online converters as well as my java code.

Online and in Java it a value="value" and a key="key" generates the following sha256 signature in hex: 90fbfcf15e74a36b89dbdb2a721d9aecffdfdddc5c83e27f7592594f71932481

enter image description here

OR

enter image description here This is across the board from online tools to my java code.

Yet in bash it produces the following output:

enter image description here

Does anyone know what would cause this difference? And which one is incorrect or is it printing in a different format?

Online Converter 1 OR Online Converter 2

Adam Liss
  • 47,594
  • 12
  • 108
  • 150
BBish937
  • 85
  • 2
  • 9
  • Add your bash and openssl version. I cannot reproduce the problem with openssl version 1.0.2g. – Cyrus Jan 10 '18 at 07:07
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Jan 10 '18 at 15:49
  • I have same issue with Node.JS, C++/Qt which are producing same hash and different in command line: https://stackoverflow.com/q/50884630/630169 Have You solved Your issue? – Aleksey Kontsevich Jun 16 '18 at 21:09
  • 1
    I'm getting: builtin echo -n "value" | openssl dgst -sha256 -hmac "key" (stdin)= 90fbfcf15e74a36b89dbdb2a721d9aecffdfdddc5c83e27f7592594f71932481 with OpenSSL 1.1.0g, bash 4.4.19(1)-release. –  Dec 27 '18 at 22:30
  • This other question may help https://stackoverflow.com/questions/47766278/how-to-pass-binary-key-to-openssl – ndvo Nov 13 '19 at 23:01

0 Answers0