ATAES132a Help with Decryption - MAC Error

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been working with an ATAES132a, learning how to read/write memory over i2c with my SAMD21 xplained pro. To help me learn, I dropped $20 on a AT88CK590 Kit, which allows me to use ACES to test and learn.

 

I am able to set my keyconfig, generate a NONCE and Encrypt some plain text on the same device. However, I am unable to decrypt the data. I keep getting a MAC error (0x40 MacError).

 

KeyConfig[00] is set to 0x 01 00 D4 E1  

 

I have previously created a key in Key[00]

 

 

I create a NONCE

 

 

Encrypt the text

 

 

Decrypt and get MAC error

 

 

At this point, its unclear to me how the MAC are calculated. Any help is appreciated. 

"When all else fails, read the directions"

Last Edited: Sat. Jun 23, 2018 - 12:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The normal vs client decrypt mode discussion looks relevant, did you consider this?

The Decrypt command has two operating modes:
• Normal Decryption Mode
• Client Decryption Mode

The Client Decryption mode decrypts packets encrypted by an ATAES132A device. The Normal Decryption mode decrypts packets generated by a cryptographic Host. It cannot decrypt packets encrypted by an ATAES132A device. 

/Lars 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lajon wrote:
The Client Decryption mode decrypts packets encrypted by an ATAES132A device

 

Yes - what I missed was getting the MacCount from the Info Register and passing to Upper Byte of Param1 when sending the Decrypt Command:

 

If I Encrypt the data and decrypt the data in the same instance, meaning the NONCE is the same, I am able to decrypt. By if I start a new instance and try to decrypt, I cant. I am assuming because the MacCount is 0.

 

I guess I am confused on how the NONCE works. Any ideas? I might have to look at the "Nonce Synchronization" section.

 

Thx for the help.

"When all else fails, read the directions"

Last Edited: Sat. Jun 23, 2018 - 12:04 PM