ltc_dpa

Overview

This project is a demonstration program that uses the KSDK software for encryption/decryption sample data using AES-CBC, AES-CCM, and XCBC-MAC algorithm.

Prepare the Demo

Connect a serial cable from the debug UART port of the board to the PC. Start Tera Term (http://ttssh2.osdn.jp) and make a connection to the virtual serial port.

  1. Start Tera Term

  2. New connection -> Serial

  3. Set apropriate COMx port (x is port number) in Port context menu. Number is provided by operation system and could be different from computer to computer. Select COM number related to virtual serial port. Confirm selected port by OK button.

  4. Set following connection parameters in menu Setup->Serial port… Baud rate: 115200 Data: 8 Parity: none Stop: 1 Flow control: one

  5. Confirm selected parameters by OK button.

Running the demo

When the demo runs successfully, from the terminal you can see:

……………………….. LTC DPA (AES) DRIVER EXAMPLE ………………………..

Testing input string: Once upon a midnight dreary, while I pondered weak and weary, Over many a quaint and curious volume of forgotten lore, While I nodded, nearly napping, suddenly there came a tapping, As of some one gently rapping, rapping at my chamber doorIts some visitor, I muttered, tapping at my chamber doorOnly this, and nothing more.

———————————– AES-CBC method ————————————– AES CBC Encryption of 320 bytes. AES CBC encryption finished.

AES CBC Decryption of 320 bytes. AES CBC decryption finished. Decrypted string : Once upon a midnight dreary, while I pondered weak and weary, Over many a quaint and curious volume of forgotten lore, While I nodded, nearly napping, suddenly there came a tapping, As of some one gently rapping, rapping at my chamber doorIts some visitor, I muttered, tapping at my chamber doorOnly this, and nothing more.

———————————– AES-CCM method ————————————– AES CCM Encryption of 320 bytes. using iv length : 12 bytes using aad length : 20 bytes using key length : 16 bytes using tag length : 8 bytes AES CCM encryption finished.

AES CCM decryption of 320 bytes. AES CCM decryption finished. Decrypted string: Once upon a midnight dreary, while I pondered weak and weary, Over many a quaint and curious volume of forgotten lore, While I nodded, nearly napping, suddenly there came a tapping, As of some one gently rapping, rapping at my chamber doorIts some visitor, I muttered, tapping at my chamber doorOnly this, and nothing more.

———————————– AES-XCBC-MAC ————————————– AES XCBC-MAC Computing hash of 320 bytes Computed hash: 9e c 5a 5a 10 bb 96 67 9f 98 3 29 94 f8 6f 9f

………….. THE END OF THE LTC (AES) DRIVER EXAMPLE …………………………..