The Arduino employs an 8-bit ATmega series microcontroller whereas the Raspberry Pi is based around a 32-bit ARM processor, and the Arduino is typically clocked at between 8-16MHz and with 2-8kB of RAM available, and in contrast the Raspberry Pi can be clocked at up to 1GHz and may have up to 512MB of RAM.

This clearly states that AES Algorithm will work way too faster on RPi than on Arduino, yet, out of curiosity, what would be the maximum time Arduino would take to perform AES-256 Encryption with the encryption key provided. ?

Is there anyway to calculate these timings for both Raspberry Pi and Arduino ?


In principle, it is theoretically possible to calculate the time it takes a machine to run some known algorithm. It used to be fairly commonplace, but there are apparently very few people who have ever done it -- the sorts of things that used to require isochronous code are now-a-days generally done in other ways.

In practice, it's generally simpler and takes less human effort to write the code and run it on the target machine and measure the time. According to people on the Internet, some implementations of AES-256 that run directly on the 16 MHz Arduino can encrypt approximately 1 block per millisecond, roughly 32 000 bytes/sec. (a) (b) (c) (d) (e) (f)

I hear that AES implementations are available on many other 8-bit processors. AN953 "Data Encryption Routines for the PIC18" describes two AES implementations for a 10 MHz PIC. The "C" implementation decodes 3 400 bytes/sec; the assembly implementation decodes about 14 000 bytes/sec. (g) (h) (j)

I also hear that many people connect Arduinos to some other devices that does the AES encryption for them, such as some ZigBee and XBee radios with the "Enable AES 128 encryption" command.

Have you heard that Carl is doing AES+CTR+HMAC Encryption and Authentication on an Arduino ?


It’s tested against many of the test-vectors (key varying, plaintext varying, Monte Carlo), which is the only contract it needs to fulfil... I've got some speed/timing information now:

128 bit, key setup 0.37ms
128 bit, ECB, encryption  0.58ms / block (27.5kB/s)
128 bit, ECB, decryption  0.77ms / block (20.5kB/s)

192 bit, key setup 0.41ms
192 bit, ECB, encryption  0.71ms / block (22.5kB/s)
192 bit, ECB, decryption  0.92ms / block (17.5kB/s)

256 bit, key setup 0.52ms
256 bit, ECB, encryption  0.82ms / block (19.5kB/s)
256 bit, ECB, decryption  1.09ms / block (14.5kB/s)

(All ATmega328p, 16MHz)

CBC modes are a little slower than ECB.

from: http://forum.arduino.cc/index.php?topic=88890.0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.