How to pass binary key to openssl
Asked Answered
S

1

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)

Szabo answered 12/12, 2017 at 6:6 Comment(1)
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 in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask.Rigmarole
C
11

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

$ openssl dgst -mac hmac -macopt hexkey:0102030405 myfile
Cohla answered 12/12, 2017 at 9:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.