How to program an enigma cipher?
- From: "DarkProtoman" <Protoman2050@xxxxxxxxx>
- Date: 29 Dec 2006 00:35:07 -0800
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!!!
.
- Follow-Ups:
- Re: How to program an enigma cipher?
- From: mensanator@xxxxxxx
- Re: How to program an enigma cipher?
- Prev by Date: Re: division by zero mystery
- Next by Date: .indd .cpt .psd .ps .eps .ai file formats help need
- Previous by thread: division by zero mystery
- Next by thread: Re: How to program an enigma cipher?
- Index(es):
Relevant Pages
|