The Nuki Smart Lock uses the NaCl Cryptography Toolbox (http://nacl.cr.yp.to/)
to encrypt the transferred data.
The following functions are needed to communicate with the Nuki Smart Lock:
The Diffie-Hellman key function dh1
Necessary for the initial key exchange between the Nuki Smart Lock and the client
The key derivation function kdf1
static const unsigned char _0;
static const unsigned char sigma = “expand 32-byte k”;
Used to derive a long term secret key out of the shared key calculated by dh1
The authentication function h1
Used to calculate the authenticator during the authorization process between the
Nuki Smart Lock and the client device.
The encryption function e1
Used to encrypt any data once the authorization process has been completed