4

I'm stumped trying to pass the key parameter to openssl dgst. I'm trying to interface to the GDAX trading platform and each request must be signed by HMAC. They clearly say to

"first base64-decode the alphanumeric secret string (resulting in 64 bytes) before using it as the key for HMAC."

This results in a 64-byte binary string. But the openssl command line program simply says -hmac key meaning that you supply the key as a parameter on the command line, which is fine if it is simple ASCII. But I see no way to supply a binary string of bytes as the key. Is there a way to do this?

(also any general advice about directing GDAX with curl is welcome too)

jtgd
  • 183
  • 1
  • 7
  • 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 Dec 13 '17 at 15:59

1 Answers1

10

You can specify a binary key in hex format like this:

$ openssl dgst -mac hmac -macopt hexkey:0102030405 myfile
Matt Caswell
  • 8,167
  • 25
  • 28