Home > other > MCU on the CCM hardware AES encryption, whether to adopt the hardware to prevent replay attack?
MCU on the CCM hardware AES encryption, whether to adopt the hardware to prevent replay attack?
Time:09-20
Zigbee USES AES encryption, I've got a frame air control command, again sent to the destination, the destination MAC layer ACK, shows that the target device received the package, but without the corresponding action, shows that the target device has the function of prevent replay attack
But the principle of AES to prevent replay attack is what? I only see the inside of the SDK encryption/decryption of AES CCM interface is like this: AESCCM_Encrypt (uint8_t * key, uint8_t * input, uint16_t inputLen, uint8_t * outPut, uint8_t * nonce, uint8_t nonceLen, uint8_t * MIC, uint8_t MIC_len);
To emulate the protocol stack, I saw every time protocol stack to encrypt all fill in the 13 byte nonce, nonce by Zigbee 8 bytes IEEE address, 4 byte counter, 1 byte of constant composition, in addition to the encrypted cryptograph, also can produce 4 bytes of MIC, the encrypted wireless data frame, air packets in addition to the ciphertext, also can bring the nonce and MIC,
Could you tell me the MIC can be used to prevent replay attacks? Every frame of the counter Nonce is will accumulate, and Zigbee devices each time useing the counter must be smaller than the next time the electric counter, every time that is Zigbee equipment on electricity, the value of the counter to initialize a larger than last time useing value, can appear otherwise sent a message to the other party does not recognize, but also reset once,
But if Zigbee devices are recorded counter replay to judge, so a Zigbee equipment to open up much space to store the counter have failed, and each counter also correspond to an IEEE address,
CodePudding user response:
The insides of the MIC is AES encryption by AES - 32,64,128 corresponding to different length of the MIC, you don't need to study it. Replay attack protection is judged by the Counter, after open NV_restore and encryption, each electricity on the basis of the last increase a little on the Counter; Storage space should be in neighborTable equipment, including the length of the peripheral device address and linkInfo, linkInfo contains key serial number and the last time Counter; Each device, in fact, you just need to confirm to your data is in the network legal data is enough, do not need to save all the nodes in the network information,