The Hardware Side of Cryptography

2 June 2008

Implementing Enigma Railway Cipher Machine on PIC16F84

Enigma Railway is one of simple type of Enigma variants. It has 3 types of rotor and one type of reflector and it has no steckerboard at all. You may only alter those three rotor positions, rotor offsets, and ring setting. You will find that Enigma Railway is a good place to start learning How enigma machine works. Yeah, because it was quite simple and straightforward :p .

I also wrote a program to emulate Enigma Railway Cipher based on PIC16F84. It was written and simulated using MPLAB 8.0 and it works the same as specification. The screenshots are shown below.

Enigma Railway Plain Text

Enigma Railway Cipher Text

I splitted the source code into two versions. Version 1.0 comes without “Germany Keyboard Permutation” and  version 2.x comes with Germany Keyboard Permutation (A mapped to Q, B mapped to W and so on). I verified and tested this source code against several test vector. I simulated my code and compared the result with Enigma Railway Simulator and guess what! Both of them were showing the same results🙂 .

I hope this post will inspire you guys to write better code for Enigma Railway emulator based on PIC16F84. Next time i’ll try to code another Enigma which is more complicated. Have a nice day and happy coding😀 .


Basic Enigma Railway (without Keyboard Permutation) | v1.0 | v1.1 | v1.2
Advanced Enigma Railway (with Keyboard Permutation) | v2.0
PIC16F84 Datasheet
Mid-Range Reference Manual
MPLAB v8.0
Enigma Railway Simulator

Enigma Machine
Enigma Rotor Details
Crypt Analysis of Enigma


  1. It’s great that you are getting thoughts from this piece of writing as
    well as from our discussion made at this place.

    Comment by Download SEO Enigma — 30 June 2014 @ 7:29 pm

  2. Witam! Mógłbym przysiąc, ja odwiedził ta strona wcześniej, ale po przeglądania niektóre posty Zdałem sobie sprawę, że
    to dla mnie nowe. Niezależnie Jestem z pewnością zadowolony natknąłem się
    to i ja będę Zakładki to i zaglądać często!

    Comment by feminizowane automaty — 17 August 2014 @ 6:31 am

  3. Piece of writing writing is aldo a excitement, if you
    be acquainted with after that you can write otherwise it is complex to write.

    Comment by — 20 August 2014 @ 7:36 am

  4. Today, I went to the beach with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed.
    There was a hermit crab inside and it pinched her ear.
    She never wants to go back! LoL I know this is entirely off topic but I
    had to tell someone!

    Comment by racing rivals Hack android — 29 August 2014 @ 2:41 pm

  5. If some one wishes to be updated with newest technologies then he must
    be go to see this web site and be up to date daily.

    Comment by animas Online hack android — 29 August 2014 @ 9:08 pm

  6. Thanks for another fantastic post. The place else may anybody
    get that type of info in such an ideal manner off writing?

    I’ve a presentation subsequent week, and I am at the
    search ffor such info.

    Comment by war thunder review — 6 September 2014 @ 7:11 am

  7. In every company, there will always be some downsides.
    Food being part of the physiologic needs of people should be taken with some
    sort of discipline. Right after reading this Vi – Salus evaluation you are
    most likely thinking that Vi – Salus is an excellent opportunity as well as are ready to
    get started.

    Comment by Chastity — 27 September 2014 @ 3:49 pm

  8. When you’re ready to go over your dumpster rental wants with our professionals from Prime
    Dog Dumpster Leases, call 888-596-8183 now.

    Comment by Rent A Dumpster Rocheport MO — 7 October 2014 @ 5:44 am

  9. They do not consume what we consume, even when they can be starving.
    The Venture is being jointly promoted by Vascon, Pristine and Jasper Developers.
    This is great for relieving pressure and also helps create good circulation in the body.

    Comment by Holiday inn San Antonio — 7 October 2014 @ 11:19 pm

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: