The Hardware Side of Cryptography

15 July 2008

Implementing Enigma M3 Cipher Machine on PIC16F84

Filed under: encryption — Tags: , , , , , , — edipermadi @ 10:01 am

Enigma was a machine used to encrypt and decrypt messages during World War II. Enigma M3 or Funkschlüssel M is one of Engima Machine derivation used by Germany Army.
Enigma M3 has 5 type of rotors and 2 type of reflectors. Each of those rotors and reflectors characteristics are shown below.

Enigma M3 Rotors

Enigma M3 Reflectors

Enigma Machine

In addition, i wrote code for emulating enigma M3 using PIC16F84 microcontroller. The code was written and simulated on MPLAB v8.0. Not only that, I’ve tested this implementation against test vectors and compared the results to Enigma Simulator written by Geoff Sullivan. Guess What, i got exactly the same results. That was nice :) .

Example:
- Rotor offset : AAA
- Rotor config : UKW-B/I/II/III
- Rotor Setting : AAA
- Plain Text : AAAAAAAAAAAAAAAA
- Cipher Text : BDZGOWCXLTKSBTMC

Enigma M3 Simulator Screenshot

Enigma M3 Simulator Inner Settings

Enigma M3 Plain Text

Enigma M3 Cipher Text

The Implementation of Enigma M3 here was divided into two versions. Version 1.x denotes Basic Enigma M3 (3 slots, 5 rotors) and version 2.x denotes enhanced Enigma M3(3 slots, 8 Rotors)

RELATED STUFF

Download:
Source Code Enigma M3 (Basic) | v1.0 | v1.1 | v1.2
PIC16F84 Datasheet
Mid-Range Reference Manual
MPLAB v8.0
Enigma M3 Simulator

Reference:
Enigma Machine
Enigma Rotor Details
Crypt Analysis of Enigma

2 Comments »

  1. I notice you have the ‘ringstellung’ but that is for the start points of the rotors.
    It is not for the Letter Entry Ring positions.
    Do you not even incorporate that feature?

    Comment by Marcus — 29 October 2009 @ 5:54 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.