Re: Mathematics of the Enigma cipher?
- From: "DarkProtoman" <Protoman2050@xxxxxxxxx>
- Date: 31 Dec 2006 00:09:12 -0800
mensanator@xxxxxxx wrote:
DarkProtoman wrote:
mensanator@xxxxxxx wrote:
DarkProtoman wrote:
Arthur J. O'Dwyer wrote:
On Sat, 30 Dec 2006, DarkProtoman wrote:
DarkProtoman wrote:
... snip ...
if(Char='A')
return 0;
else if(Char='B')
return 1;
else if(Char='9')
return 36;
}
[...]
No one has given me any ideas of how to implement the reflector yet!
Um, yeah. That may be because it's totally obvious. Or it might be
because nobody thinks you should tackle such a "difficult" concept until
you've figured out how to write "Hello world", first.[1] Remember, you're
the guy who wrote the code I've left partly unsnipped above.
You're whining that nobody will teach you how to cut down trees,
when it looks like our job at this point is to take away your chainsaw
while you still have any appendages left.
-Arthur
[1] - Or maybe both.
OK, never mind. But, I keep forgetting, when the current goes back
through the rotors after passing through the reflector, do the rotors
rotate, or are they fixed?
Current can't pass through a moving rotor because the connections
are interrupted until it stops.
I know, but when the reflector sends the current back the other way, do
the rotors step AT ALL, or do they remain in the same position as they
were?
Electricity moves at the speed of light. There wouldn't be time
for the rotors to shift between reaching the reflector and going
back through the rotors. If I recall the Wikipedia article correctly,
the rotors shift when the key is pressed and this happens before
the output lamp lights. I assume the previous output lamp
extinguishes as soon as the rotors move and the previous circuit
is broken and when they stop, the new lamp lights when a
complete circuit is re-established (which means through all the
rotors, through the reflector and back through the rotors again).
With a software algorithm, you don't have any such real world
restrictions so you could choose to program it so that the rotors
move between the forward and reverse passes of the signal
through the rotors.
That brings up the question raised in the other thread:
What is it you're actually trying to do? Make an encryption
program that is simply Enigma-like or are you trying to
emulate the actual historical machine?
If you are trying to emulate an actual machine, you software
has to take into account the real world restrictions. If you don't
care whether your program matches what an actual Enigma
machine does, then you're free to change it any way you want,
such as eliminating the plug-board, using 36 character wheels,
infinitely fast rotor shifts, etc.
As far as making a software reflector, the decode algorithm
I used sends the output of R4 back through the rotors. But it
sends it back along the same path, which is why it decodes.
I would think all you need to implement a reflector is add some
kind of formula that offsets the character produced by R4
to some other character on R4 and then "decode" that to
get your reflected conversion. Under such a scheme the
decoding should still work as long as the offset formula takes
you back to the original character after being sent through
the rotors and reflected back.
Yeah, I really just want to make my own software rotor cipher. the
decrypt function would simply be the encrypt one "backwards", right?
.
- References:
- Re: Mathematics of the Enigma cipher?
- From: CBFalconer
- Re: Mathematics of the Enigma cipher?
- From: DarkProtoman
- Re: Mathematics of the Enigma cipher?
- From: Arthur J. O'Dwyer
- Re: Mathematics of the Enigma cipher?
- From: DarkProtoman
- Re: Mathematics of the Enigma cipher?
- From: mensanator@xxxxxxx
- Re: Mathematics of the Enigma cipher?
- From: DarkProtoman
- Re: Mathematics of the Enigma cipher?
- From: mensanator@xxxxxxx
- Re: Mathematics of the Enigma cipher?
- Prev by Date: Re: Hash
- Next by Date: Re: Mathematics of the Enigma cipher?
- Previous by thread: Re: Mathematics of the Enigma cipher?
- Next by thread: Re: Mathematics of the Enigma cipher?
- Index(es):
Relevant Pages
|