pynacl crypto_core_hsalsa20 for nuki smartlock 2.0

80 views Asked by At

I need the crypto_core_hsalsa20 function to greate an secret key for my NUKI.

Both sides calculate DH Key k using function dh1 a. Key 0DE40B998E0E330376F2D2FC4892A6931E25055FD09F054F99E93FECD9BA611E 8. Both sides derive a long term shared secret key s from k using function kdf1 a. Shared key 217FCB0F18CAF284E9BDEA0B94B83B8D10867ED706BFDEDBD2381F4CB3B8F730

4.2 The key derivation function kdf1

static const unsigned char _0[16];
static const unsigned char sigma[16] = "expand 32-byte k";
crypto_core_hsalsa20(k,_0,s,sigma)

Used to derive a long term secret key out of the shared key calculated by dh1

I alredy calculated the DH Key k with the nacl.publik.Box (=dh1) function.

Can someone tell me how to use the kdf1 function with pynacl? Thanks!

0

There are 0 answers