Enigma-type Machine - Old School C
N.B. This is only an approximation to the actual Enigma algorithm.
e.g. the odometer assumption mentioned here (in "Incrementing The Rotors"):
http://practicalcryptography.com/ciphers/enigma-cipher/
For a full implementation this work looks good (enigma.c in "C Code for Breaking Enigma"):
http://practicalcryptography.com/cryptanalysis/breaking-machine-ciphers/cryptanalysis-enigma/