| Algorithm 1: Source code for the AES algorithm on Arduino Mega |
| #include <AESLib.h> 1: void setup(){ |
| 2: Serial.begin(57600); |
| 3: uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; |
| 4: char data[] = "0123456789012345"; //16 chars == 16 bytes |
| 5: aes128_enc_single(key, data); |
| 6: Serial.print("encrypted:"); |
| 7: Serial.println(data); |
| 8: aes128_dec_single(key, data); |
| 9: Serial.print("decrypted:"); |
| 10: Serial.println(data); |
| 11: } |
| 12: void loop() {} |