The Hardware Side of Cryptography

9 February 2008

An AES implementation on PIC16F877

Filed under: encryption — Tags: , , , — edipermadi @ 2:16 am

Yup, previously i’ve implemented AES (Rijndael) 128 bit using PIC16F84. But you knew that the performance was not so good. Since program size and speed are trade off and limitation of PIC16F84 memory space, i decided to decrease the the performance to fit PIC16F84 memory limit.

Here, i ported the code into PIC16F877 which has larger memory 8) . Of course to speed up the application. By using PIC16F877, i felt much more flexible to rock the microcontroller. As a benchmark, porting the code from PIC16F84 into PIC16F877 will speed up the encryption process by 56% as well as speeding up decryption by 37%.

Speed Benchmark:

  • Encryption
    PIC16F877 : 3834 cycles
    PIC16F84 : 7157 cycles
  • Decryption
    PIC16F877 : 5250 cycles
    PIC16F84 : 28504 cycles

Today, i woke up till 3 AM just to make a significant progress of this cipher implementation. The new version which is v1.7 has a giant step distance from its predecessor. The latest version (v1.7) requires less memory program and it’s able to do inverse mix column twice faster than the previous version (v1.6). Nice progress huh! :D .

I will keep modify both of codes to rock the microcontroller and speed up the whole process. If necessary, i will also port the code into higher microcontroller platform such PIC18x. However, the implementation of AES (Rijndael) cipher in this post is intended for performance oriented application. Now, I’m currently developing another version of AES (Rijndael) cipher on PIC16F877 which are AES-192 and AES-256. Keep visiting this blog to get the latest release. Have a nice day :D !

Hot News! : Fast AES cipher on PIC18F4550

RELATED STUFF

Downloads:
Source Code AES 128-bit | v1.0 | v1.1 | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7
PIC16F877 Datasheet
Mid Range Reference Manual
AES Publication (fips-197)
Practical Implementation of Rijndael S-Box Using Combinational Logic

References:
Advanced Encryption Standard
Vincent Rijmen
Joan Daemen

Simulator:
AES (Rijndael) Simulator

Official Website
Microchip
Advanced Encryption Standard

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Blog at WordPress.com.