The Hardware Side of Cryptography

18 May 2008

The Implementation of Keyword Cipher on PIC16F84

Keyword Cipher simply works based on monoalphabetic substitution. The substitution table is generated dynamically from the key, by filling up substitution table with key and padding the rest with unused alphabetic character.

Substitution Table Example:

  • Key : SHIFTRY
  • input : ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • output : SHIFTRYABCDEGJKLMNOPQUVWXZ

Vector Test Example:

  • Plain Text = ALAKAZAM CHARMANDER NIDORINO
  • Key = SHIFTRY
  • Cipher Text = SESDSZSG IASNGSJFTN JBFKNBJK

I wrote a code of keyword cipher for PIC16F84 using MPLAB v8.0. It was successfully simulated and works the same as specification. You may freely use the code under the term of GPL v3.0. Hopefully this post can help you to grab understanding on how keyword cipher was done in a microcontroller such PIC16F84. The both screenshots of Plain Text and Cipher Text are shown below

Plain Text

Cipher Text

RELATED STUFF

Download:
Source Code | v1.0 | v1.1
PIC16F84 Datasheet
Mid-Range Reference Manual
MPLAB v8.0

Reference:
Keyword Cipher

Official Website:
Microchip

1 Comment »

  1. Lots of of guys blog about this matter but you said really true words.

    Comment by trerceten — 25 November 2009 @ 7:25 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 WordPress.com.

%d bloggers like this: