From: Meino Christian Cramer Date: 2004-08-18T03:57:12+09:00 Subject: Re: POT (partly offtopic) Re: Q: Shifting a hash anf and array From: "Ara.T.Howard" Subject: Re: POT (partly offtopic) Re: Q: Shifting a hash anf and array Date: Wed, 18 Aug 2004 02:40:59 +0900 Hi Codebreakers! > very. something like this perhaps? "YesNo" or in coding style answer = Trulse Or in boolean notation: 0.5 Enough junk from my brain output terminal...I had to stop myself here and now from flooding mails with random white noise. ;) The principle is ok, Ara -- but the resulting cypher is the so called "Caesar's code", which means, a) Caesar has used it b) it is very weak. (By the milky way: The Enigma cyphering mechanism is by no means safe!!! In todays computer environments it is broken in times you need to login (or nearly...I exegrate a little too much). And never,never,never it should be used in serious cyphering tasks!!! But what makes the Enigma machines so interesting to me (and may be others...;): You can really watch how letter by letter is moved through this wheel drum unit until finally one letter came out. And from a mechanical craftsman point of view: It is a beautiful machine! (BY NO MEANS I AM FORGETTING HERE FOR WHAT THIS BEAST WAS USED! But it was fascinating to watch the TV film to see how the "egg heads" (only meant positively!) in Bletchley Park were trying to temper and finally breaking the code -- with the help of MECHANICAL CODE BREAKING COMPUTERS and a lot of brain power! Lots of big boards with rotating wheels, which try to find the settings of the wheels of Enigma currently used for sending the encyphered text via shortwave. But I am loosing my path... What .... I want to say......was....hrmmmm.....AH! NOW! Caesar's code is a so called "replacement alphabet code": in (clear text) : ABCDEFGHIJKLMNOPQRSTUVWXYZ out (encyphered text): UVWXYZABCDEFGHIJKLMNOPQRST which means, that the "structure" of text remains untouched. For example the count of the different letters used in a certain language remains the same .... only for a different letter. This is one weak point of this cypher. When putting more cyphering stages on a line like this: in (clear text) : ABCDEFGHIJKLMNOPQRSTUVWXYZ out (encyphered text): UVWXYZABCDEFGHIJKLMNOPQRST in (clear text) : UVWXYZABCDEFGHIJKLMNOPQRST out (encyphered text): MNOPQRSTUVWXYZABCDEFGHIJKL in (clear text) : MNOPQRSTUVWXYZABCDEFGHIJKL out (encyphered text): EFGHIJKLMNOPQRSTUVWXYZABCD in (clear text) : EFGHIJKLMNOPQRSTUVWXYZABCD out (encyphered text): YZABCDEFGHIJKLMNOPQRSTUVWX you gain nothing but more mechanical stuff in your "Caesar-Enigma", since this can be simplyfied to: in (clear text) : ABCDEFGHIJKLMNOPQRSTUVWXYZ out (encyphered text): YZABCDEFGHIJKLMNOPQRSTUVWX The first "enhancement" the Enigma introduced were the "wild" wireing" of the wheels like this: in (clear text) : ABCDEFGHIJKLMNOPQRSTUVWXYZ out (encyphered text): CDKLMPEYZAFBGHIJQRVXWNSOUT Next were using three (or four for the Naval version of the Enigma) wheels with different "wild wireings" like this (I think I should write a short lisp code for my emacs to generate all this "random wild wireings (is this "wirerings" or is "wireings" correct...damn, before trying to build a cyphering Enigma I should learn to decypher my own English...;): in (clear text) : ABCDEFGHIJKLMNOPQRSTUVWXYZ out (encyphered text): CDKLMPEYZAFBGHIJQRVXWNSOUT in (clear text) : CDKLMPEYZAFBGHIJQRVXWNSOUT out (encyphered text): MCDLKPZYAEFIGBSOUTJHQVRXNW in (clear text) : MCDLKPZYAEFIGBSOUTJHQVRXNW out (encyphered text): SOUCDKLMPIJFBGHVQREYZAXWNT ("wild wireing" by "hand random"....urks...) But the real trick was to turn each wheel after each input letter. There was a certain algorithm in which way and when what wheel was turned...I have no source of information until now for that. Any hint is welcome... After three or for stages of "wheeling the letters" there was a so called "Deflector", which injects (TADA!) the encyphered letter back into the drum of wheels and this letter was again encyphered three times by the truning wheels the way back. The the letter reaches the "Steckerboard" and was "steckered" (whatever that means ...I dont know...source of information currently missing...) and at last the voltage (did I say, that this wireing was for makeing _electrical_ connections?...Oh, I think I forgot that...sorry) reaches a little lamp (NO LED!;) behind a letter of the alphabet showing the final encyphered letter. You need three persons for using the Enigma!!! The resulting code was symmetrical. That means, feeding the encyphered text again through the machine with the same starting settings results in the clear text. The enourmous huge amount of possible settings of the wheels for the start positions of the wheels, the additional possibilities of the deflector settings and the "steckering" of the "Steckerboard" blinded the inventors of the weakness of the codeing algorithm. So luckily the code was finally broken by the people at Bletchley Park and Polish mathematicans. ---------- Homework for all ongoing codebreakers til Friday: Encyphere this email to reasonable readable English. Hint: It is no Caesar's cypher. The used code has something to do with random typos and lack of correct vocabulary. ;) X-) :O) ----------- As soon as I know somthing more about the inside of the Enigmas (there were 17 different models ....) I will post more -- if it is wanted, since it is ... offtopic. Ruby.use! Meino > jib:~ > cat b.rb > require 'arrayfields' > module Enigma > class Wheel < Array > FORWARD = 0 > BACKWARD = 1 > attr :terminals > def initialize terminals > self.fields = *terminals > self.replace terminals > end > def rotate! direction = FORWARD > if direction == FORWARD > push shift > else > unshift pop > end > end > def inspect > fields.inject(''){|s,f| s << "#{ f } - #{ self[f] }\n"} > end > end > end > > w = Enigma::Wheel.new %w(A B C D E F) > p w > w.rotate! > p w > > > jib:~ > ruby b.rb > A - A > B - B > C - C > D - D > E - E > F - F > > A - B > B - C > C - D > D - E > E - F > F - A > > > keep us tuned! > > -a > -- > =============================================================================== > | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov > | PHONE :: 303.497.6469 > | A flower falls, even though we love it; > | and a weed grows, even though we do not love it. > | --Dogen > =============================================================================== >