I am now trying the next step which is to authenticate.
The authentication process uses HMAC-MD5.
Unfortunately I spent several days already trying to use openssl to generate md5 hash for login with no success.
I am using openssl like this:
$PrivateKey=`echo -n "$Challenge" | openssl dgst -md5 -hmac "$PublicKey" -binary | xxd -ps -u`
$Login=`echo -n "$Challenge" | openssl dgst -md5 -hmac "$PrivateKey" -binary | xxd -ps -u`
Where:
$Challenge is the return string from first step and also hex encoded with "xxd -ps -u"
$PublicKey is the return string from first step concatenated with the password and also hex encoded with "xxd -ps -u"
I did a tcpdump from node app.js from bikerp/github and with:
$Challenge="tzd1skQFcoArsdTU7D4I" #not hex encoded
$PublicKey="u2eNyVyvK22JlCTtvA2e" #also not hex encoded
$password="777260" #password for the DSP-W215
echo "$Login" should have given me: 2942D0DF1E77B62BB2DBD4A511C63169
but instead it gives me: 30FD3BDA28A864484AD9AEA3FBDE6811
I can't figure out what is the problem. I tried a lot of different ways and none of them worked.
If anyone has an idea, please let me know
EDIT: Disregard what I wrote

$PublicKey and $Challenge should not be hax encoded and all is working

EDIT 2: I can't believe I figured it out! I'm gonna make bash script for the DSP-W215 API and I'm gonna post it on GitHub

EDIT 3: Here is the GitHub link: https://github.com/nhsqr/hnap-dsp-w215