The protocol: ( note the “||” indicates concatenation of blocks)
A message is composed of four 16 byte blocks followed by a 16 byte MAC,
The blocks are denoted as:
Text1=RNG(keyrng) but Text1[0] contains crypto command, other bytes can be payload
Text2=RNG(keyrng), or CMAC(keyIdPw,ID || Password), can be payload if not IDPW
RND=RNG(keyrng),
AUTH=CMAC(keyauth,RND in previous message),
and
MAC = CMAC(keymac,Text1 || Text2 || RND || AUTH )
Bit and byte permutations can be applied as well as sending the message using a stream cipher.
I am currently working on porting the allan-stewart/node-aes-cmac onto the Pico in preparation of a rewrite of the protocol implementation.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
For better understanding:
Cryptographic Protocol vs Cryptographic Primatives
https://en.wikipedia.org/wiki/Cryptographic_protocol
https://en.wikipedia.org/wiki/Cryptographic_primitive
Primitives used:
Block Cipher: Notation is CIPHkey(M), where CIPH = AES128, using key, on block M
https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
CMAC: Notation CMAC(key,M)
https://en.wikipedia.org/wiki/CBC-MAC
https://en.wikipedia.org/wiki/One-key_MAC
http://csrc.nist.gov/publications/nistpubs/800-38B/SP_800-38B.pdf
https://github.com/allan-stewart/node-aes-cmac
Permutations: Notation Perm(P,M) for bit level, Permbyte(P,M)
http://courses.cs.vt.edu/~cs1044/fall02/mcquain/Projects/4/PermuCrypt.pdf
http://www.mathplanet.com/education/algebra-2/discrete-mathematics-and-probability/permutations-and-combinations
Random Number Generator: Notation RNG(key)
The protocol: ( note the “||” indicates concatenation of blocks)
A message is composed of four 16 byte blocks followed by a 16 byte MAC,
The blocks are denoted as:
Text1=RNG(keyrng) but Text1[0] contains crypto command, other bytes can be payload
Text2=RNG(keyrng), or CMAC(keyIdPw,ID || Password), can be payload if not IDPW
RND=RNG(keyrng),
AUTH=CMAC(keyauth,RND in previous message),
and
MAC = CMAC(keymac,Text1 || Text2 || RND || AUTH )
Bit and byte permutations can be applied as well as sending the message using a stream cipher.
I am currently working on porting the allan-stewart/node-aes-cmac onto the Pico in preparation of a rewrite of the protocol implementation.