Decryption problem of 802.15.4 MAC SecLib_Aes

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Decryption problem of 802.15.4 MAC SecLib_Aes

2,130 次查看
stchui
Contributor I

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.

 

标签 (1)
0 项奖励
回复
2 回复数

1,161 次查看
stchui
Contributor I

the keys of the following functions should be the same.(type mistakes!!)

void securityTest()

{   

   SecLib_Aes(plaintext,key,ciphertext);

   SecLib_Aes(ciphertext,key,decryptedData);

}

0 项奖励
回复

1,161 次查看
PrivateProfile
Contributor I
I'm not able to decrypt the string either.
 
When I run SecLib_Aes(ciphertext,key,decryptedData) I get a second encryption of ciphertext in decryptedData, not a decryption of ciphertext.
 
Would it be possible to get a copy of the SecurityLib.c source to see what I'm doing wrong?
0 项奖励
回复