1

I am trying to crete digest for ONVIF authentification. For nonce, date and password, I am using example values from Generating an ONVIF authentication digest using Crypto++?.

I am using Ubuntu 18.04.

Formula for digest is:

Digest = B64ENCODE( SHA1( B64DECODE( Nonce ) + Date + Password ) )

This are initial values:

nonce = LKqI6G/AikKCQrN0zqZFlg==
date = 2010-09-16T07:50:45Z
password = userpassword

Decoding nonce is done with his command:

echo -n "LKqI6G/AikKCQrN0zqZFlg==" | base64 -d
Result is: ,���o��B�B�tΦE�

Concatenating decoded nonce, date and password I got:

,���o��B�B�tΦE�2010-09-16T07:50:45Zuserpassword

Hash is calculated with this command:

echo -n ",���o��B�B�tΦE�2010-09-16T07:50:45Zuserpassword" | sha1sum
Result: c6c63f09a5f074e8a4d21ec8a264013425476041

Finaly, encoding is done with this command:

echo - n "c6c63f09a5f074e8a4d21ec8a264013425476041" | base64
Result is: LSBuIGM2YzYzZjA5YTVmMDc0ZThhNGQyMWVjOGEyNjQwMTM0MjU0NzYwNDEK

But, it is expected:

tuOSpGlFlIXsozq4HFNeeGeFLEI=

Can you tell me what am I doing wrong?

flek
  • 11
  • 2

0 Answers0