The Implementation of Vigenere Cipher on PIC16F84
Today, i was reading the “CRYPTOLOGIA History” book. I found nice classical cipher named “vigenere”. This cipher was invented by Blaise de Vigenère. Although this cipher is insecure, lets just code it for the sake of curiosity.
This post is dedicated to provide an example to anyone who is looking for the implementation of Vigenère cipher in hardware, especially on PIC16F84 the PICmicro Microcontroller from microchip. Hopefully this piece will benefit to anyone, at least to satisfy myself
.
This cipher mechanism is based on substitution table. The substitution table consisted of columns and rows labelled “A” to “Z”. To get cipher test, first you select the column of plain text and then you select the row of key. The intersection of row of column is called cipher text then. To decode cipher text, you select the row of key and you find the intersection which is equal to cipher text, the label of column is called plain text then. Simple right
.

Above is the substitution table of vigenere cipher. I also took the screenshot of testing the algoritm on MPLAB 8. The picture is below:
Enciphering / Encoding Screenshot

Deciphering / Decoding Screenshot

Cheers
BENCHMARK
Test Vector
Encryption:
Plain Text : I AM TRYING TO HIDE THIS MESSAGE FOR YOU
Key: HOPEFULLY NOBODY COULD READ THIS TEXT
Cipher Text: POBXWSTYEGCIWGCVVCDPVWSDZLNGKCLN
Decryption:
Cipher Text: POBXWSTYEGCIWGCVVCDPVWSDZLNGKCLN
Key: HOPEFULLY NOBODY COULD READ THIS TEXT
Plain Text: I AM TRYING TO HIDE THIS MESSAGE FOR YOU
Speed Test:
Encryption : 870 cycles / 32 characters
Decryption : 902 cycles / 32 characters
RELATED STUFF
Download
Source Code v1.0
Source Code v1.1
PIC16F84 Datasheet
Mid-Range Reference Manual
References:
Vigenère Cipher
Official Website:
- Microchip
Simulator
Vigenere Cipher Simulator



