The Hardware Side of Cryptography

16 February 2008

faster GOST cipher implementation on PIC16F877

Filed under: encryption — Tags: , , , — edipermadi @ 6:47 am

Previously, i’ve coded GOST cipher on PIC16F84. You knew that each of ciphering and deciphering proces takes 5800 cycles. In order to enhance process throughput. I ported the code into PIC16F877. Here i concatenated SBOX1 to SBOX2, and so on. However, this posting is dedicated to anyone who is searching for implementation of cipher function especially GOST cipher in microcontroller such PIC16F877.

So here we need to allocate 4 x 256 bytes of program just for SBOX lookup table. After concatenating the SBOX, the throughput of ciphering and deciphering process was increasing. Each of them just takes approximately 4200 cycles. Which is a little bit faster than previous faster. To gain more speed, you can modify the algorithm or just replace with higher microcontroller that has better instruction on addition.

Later on, you also can try to port this code into another platform such AVR or ever 8051🙂 . If you find better result, please let me know.


Source Code v1.0
PIC16F877 Datasheet
Mid Range Reference Manual
Original GOST cipher translation
GOST Specification
An Analysis of GOST cipher

Wikipedia GOST

Official Website
– Microchip

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: