AES 256 support

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AES 256 support

980 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kiryat8 on Tue May 28 05:46:05 MST 2013
I am trying to communicate with a custom protocol encrypted in AES 256 on the LPC1768 and the other end using a C# DotNet server. I am using the NXP AN11241_1 example code. On the PC side I use the C# code in the attachment.
When I encrypt a buffer with a single 16 byte block, both sides encrypt/decrypt the same way and all works. When I fill a 48 byte buffer with data 0 through 47 and encrypt the buffer on both ends, only the first 16 encrypted bytes are the same. So when I send more than one 16 byte block, the decrypting always fails.
I also did a test where I encrypted the 48bytes and then decrypted them on the same side (PC and LPC) and verified that the results which also worked.
I conclude that PC and the LPC are using different AES modes.
Any help would be appreciated.
Thanks
0 Kudos
Reply
1 Reply

821 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kiryat8 on Wed Jun 19 04:42:32 MST 2013
I was pointed to the different AES modes. I had used CipherMode.CBC in the C# code where the application note just implements CipherMode.ECB.
I then XORed things on the LPC C code and got CipherMode.CBC to work.
I was referred to the Wikepedia "Block cipher mode of operation" page.
0 Kudos
Reply