Security dongle is an example of implementation of cryptography. There are many ways to connect dongle to your PC, whether you use USB, paralel port, serial port or even PCI or ISA port. Here, i just extend my previous code about Enigma Railway into projects called “Enigma Railway RS232 Security Dongle”.
The concept is actually easy. First, a PIC16F84 that works at 4MHz polls data form RS232 serial prot at 9600 bps. When data received, it will automatically determine wheter the data is gonna be encoded normally using Enigma Railway Algorithm or just interpreted as an ordinary command. Commands here are a set of instruction to view or modify inner setting of Enigma Railway Security Dongle. There are basically 13 commands exist, listed below:
Enigma Railway Security Dongle Commands
[`] View Inner Setting
[1] Change Left Rotor Type
[2] Change Middle Rotor Type
[3] Change Right Rotor Type
[4] Increase Reflector Setting
[5] Increase Left Rotor Setting
[6] Increase Middle Rotor Setting
[7] Increase Right Rotor Setting
[8] Increase Reflector Offset
[9] Increase Left Rotor Setting
[0] Increase Middle Rotor Setting
[-] Increase Right Rotor Setting
[=] Reset Enigma
The uppercase alphabetical characters (A to Z) will be treated as ordinary data and it will be encoded as an enigma Railway Message. Other undefined characters are ignored.
The code here was written using MPLAB v8.0, simulated and tested using PIC simulator IDE and compared to Enigma Railway Simulator with satisfying result. Both three methods were showing the same results. Have a look those three screenshots below:
Simulated using Oshon Soft PIC Simulator IDE

Captured RS232 result using Oshon Soft PIC Simulator IDE

Simulated using Enigma Railway Simulator

I’ve tested this code using PIC16F84 development board from Innovative Electronics at 4MHz clock and 9600bps transmission speed. Where TX bit was RA0 and RX bit was RA1. The schematic is basicaly easy, so i dont need to mention it here
.
Last, this code is released freely under GNU Public License v3.0 without any warranty. So take your own risk and leave some comments, so i can hear your voice
RELATED STUFF
Download:
Enigma Railway RS232 Security Dongle Source Code | v1.0 | v1.1
PIC16F84 Datasheet
Mid-Range Reference Manual
MPLAB v8.0
Enigma Railway Simulator
Reference:
Enigma Machine
Enigma Rotor Details
Crypt Analysis of Enigma
Official Website
- Microchip
- Oshon Soft
- Innovative Electronics



