Dear All,
I have tried to use the SecLib_Aes function (in 802.15.4 MAC/PHY version 1.063) for data encryption and decryption (According to the procedures stated in section 3.11.2.1 of 802.15.4 MAC/PHY Software Reference Menu, Rev. 1.3). However, I found the function can only encrypt my data correctly. Would anyone provide any suggestion on my implementation?
My implementation:
byte key[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f };
byte plaintext[16] ={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f };
byte ciphertext[16];
byte decryptedData[16];
Encryption & Decryption procedures:
void securityTest()
{
SecLib_Aes(plaintext,key,ciphertext);
SecLib_Aes(ciphertext,Key,decryptedData);
}
Encryption & Decryption Result
Ciphertext -> 0a940bb5416ef045f1c39458c653ea5a
decryptedData -> aee71ea541d7ae4beb60becc593fb663
According to the AES Test Vectors:
(reference: http://www-cse.ucsd.edu/~fritz/rijndael_test.html)
Key:000102030405060708090a0b0c0d0e0f
Plaintext:000102030405060708090a0b0c0d0e0f
Ciphertext:0a940bb5416ef045f1c39458c653ea5a
Thank a lot.
the keys of the following functions should be the same.(type mistakes!!)
void securityTest()
{
SecLib_Aes(plaintext,key,ciphertext);
SecLib_Aes(ciphertext,key,decryptedData);
}