5
2
I came across the following command for unix on binance which I was trying to unpack. See here: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md
(Section: SIGNED Endpoint Examples for POST /api/v1/order)
openssl dgst -sha256 -hmac
What I understand is it is a call to the openssl command to produce a digest, the digest will be of the sha256 variety as agreed on by standard specs. What I don't understand is the -hmac
flag. What is it and what does it do down to a mathematical level?
My Attempt at Solving the Problem:
I did a google search with openssl -hmac
and openssl dgst -hmac
but the top 10 results were of not avail to me. So I imagine more experienced users would be better to ask.
Updates:
The flag isnt mentioned in these docs: https://www.mkssoftware.com/docs/man1/openssl_dgst.1.asp and so I'm starting to believe it may have no cryptographic purpose. Although i'm right now not sure.
I found what looks similar to the flag mentioned in This Question: https://stackoverflow.com/questions/7285059/hmac-sha1-in-bash
MKS appears to be way out of date, but the website of the OpenSSL project shows this option and the OpenSSL-released man pages have done so for many years.
– dave_thompson_085 – 2018-04-07T06:47:01.263@dave_thompson_085 I've found an interesting post by jww on StackOverflow and updated my answer with it. The answer is surprising to say the least. – Maarten Bodewes – 2018-04-07T10:37:36.680