How to program an enigma cipher?



How would I program an enigma cipher that can encipher A-Z and 0-9?

I'm thinking this: since the enigma cipher is basically a vigenere
cipher w/ a shifting table, and a vigenere encryption can be written as
(P+K)%36 ('cause there's 36 characters to work w/), and let's say
there's 4 rotors (let's remove the reflector and plugboard to keep it
simple), we could do it like this, encrypting F for an example:

R1=Q, R2=W,R3=E,R4=R

R1 alphabet: QRSTUVWXYZ0123456789ABCDEFGHIJKLMNOP

F becomes V, R1 moves to R.

R2 alphabet: WXYZ0123456789ABCDEFGHIJKLMNOPQRSTUV

V becomes H

R2 doesn't move (it'll only move after R1 has moved 36 characters)

R3 alphabet: EFGHIJKLMNOPQRSTUVWXYZ0123456789

H becomes L

R3 doesn't move (it'll only move after R2 has moved 36 characters)

R4 alphabet: RSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQ

L becomes 2.

Thus, F->2.

I know this is imperfect, so any comments or suggestions on how to do
this are most welcome!

Thanks!!!

.



Relevant Pages

  • Re: How Secure would Triple Vigenere be?
    ... >> the substitution tableau are permutations of the ... >> normal alphabet but have no relations to one another, ... > What you end up with is a mixed alphabet Vigenere. ...
    (sci.crypt)
  • Q: Vigenere, tabula recta, starting point?
    ... about this work of art, "KRYPTOS," I'm sure you know what I'm talking ... and I was wondering if anybody had an idea which alphabet to use ... ...should I encrypt/decrypt using the topmost "abc..." ... a Vigenère, so an answer would be helpful. ...
    (sci.crypt)