Showing posts with label The Code Book. Show all posts
Showing posts with label The Code Book. Show all posts

June 5, 2013

Secret Services & Bombe 2.0

"The Poles had proved that Enigma was not a perfect cipher, and they had also demonstrated to the Allies the value of employing mathematicians as codebreakers." 

The room 40, which was shortely substituted by the GC&CS settled in Bletchley Park, 80 kilometers (50 miles) north of London, started to recrute new operator especially between mathematicians and scientists, and one of them, who deserves to be singled
out, it is the mathematician Alan Turing, who identified Enigma’s greatest weakness and ruthlessly exploited it. Thanks to Turing, it became possible to crack the Enigma cipher under even the most difficult circumstances.

The basic idea was that many messages sent would consist of some short piece of predictable text such as "The weather today will be...."  for the morning weather report, or "Heil Hitler" as closure of each text. Using those cribs the cryptoanalyst were able to create a menu  like the one in the photo below


The menu, in the form of an electric circuit, was ‘plugged up’ on the panel of sockets located on the back of the Bombe by means of 26-way cables. It must be underlined that, for the correct functioning of the British Bomb,  it was essential that the structure of the menu included multiple ‘closures’ or loops.
In the given menu the sequence of letters: S → A → X → V form one such loop, and the diagram below gives the details of the Enigma enciphering processes that correspond to the four links in this loop. In this diagram the four unknown stecker partners of the letters S, A, X and V are respectively represented by the Greek letters: α, β, γ and δ. (The Enigma rotor systems and their equivalents on the Bombe will subsequently be referred to as the ‘scramblers’. The scrambler connections were made with 26-way cables.)


The American Bombe was in its structure similar to its british correspondent, although it was way faster because it was designed to find the key of a 4 (instead of only 3) rotors Enigma, which was the one employed by the Kriegsmarine, the German Naval Army, the safest one.

The capability of the Allies to read the Axis messages allowed them to win importants battles of the Second World War, like for the Battle of the Atlantic, and the war itself.

The Entire argument of Cracking the Enigma Machine started in the last post Secret Services & Cracking Enigma: The Bombe,

Sources:
The Code BookSimon Singh
http://www.rutherfordjournal.org/article030108.html
http://www.bletchleypark.org.uk/content/machines.rhtm
http://www.vectorsite.net/ttcode_08.html#m1
http://en.wikipedia.org/wiki/Bombe
http://ciphermachines.com/enigma.html#break

June 4, 2013

Secret Services & Cracking Enigma: The Bombe

"In the years that followed the First World War, the British cryptanalysts in Room 40 continued to monitor German communications. In 1926 they began to intercept messages that baffled them completely. Enigma had arrived, and as the number of Enigma machines increased, Room 40’s ability to gather intelligence diminished rapidly.[...]The speed with which the Allied cryptanalysts abandoned hope of breaking Enigma was in sharp contrast to their perseverance just a decade earlier in the First World War.[...]One nation, however, could not afford to relax. After the First World War, Poland reestablished itself as an independent state, but it was concerned about threats to its newfound sovereignty. To the east lay Russia,[...] and to the west lay Germany[...]Sandwiched between these two enemies, the Poles were desperate for intelligence information, and they formed a new cipher bureau, the Biuro Szyfrów. If necessity is the mother of invention, then perhaps adversity is the mother of cryptanalysis."

[The Code Book, Simon Singh]

The whole process started indeed in Polland in the Biuro Szyfrówwhere the disappointed German Hans-Thilo Schmidt, a public dependent of the Chiffrierstelle, brought the papers in which was represented the general structure of the Enigma machine and thanks to a machine intercepted in the Polish mail (They then bought a commercial Enigma machine and used the gathered information to convert it into a military one)
This was actually a great step since, before these info, they only had mathematical analysis data, which, let's be honest here, were more or less useless without the machine. But even in this case "The strength of the cipher depends not on keeping the machine secret, but on keeping the initial setting of the machine (the key) secret"...an expedient that by itself was capable to lay approximately 1.58 x 10^20 possible keys between the Allies and the solution...a result which was more or less impossible to reach in useful time...
This was true untill the matematician Marian Rejewski found a leak in the comunication system: the repetition. The German infact used to comunicate with the daily key the message one (3 letters, one for each rotor) twice (for a total of 6)...Rejewski tabulated the relationships between the first and fourth characters as follows:

   ABCDEFGHIJKLMNOPQRSTUVWXYZ
      O                                   L                K
Given enough messages intercepted in one day, he could complete this table, giving him something like:

   ABCDEFGHIJKLMNOPQRSTUVWXYZ
   FOXPVBUNWYACRIZELDTQGJMKHS

I know that it seems to be leading nowhere, but Rejewski kept playing at it and discovered a property which was going to overturn their work.
He noticed that "A" in the top row was related to "F" in the bottom. He went to "F" in the top row and saw that it was related to "B" in the bottom. He went to "B" in the top row and saw that it was related to "O" in the bottom. He continued this search until he ended up with the "A" in the top row again, and then repeated this game through the rest of the table until there were no more characters left. The example above gives:

   A -> F -> B -> O -> Z -> S -> T -> Q -> L -> C -> X -> K -> A
   D -> P -> E -> V -> J -> Y -> H -> N -> I -> W -> M -> R -> D
   G -> U -> G

Rejewski did the same operationd with different sets of messages sent on different days, and noticed that the pattern of the number of chains and the number of links in the chains varied widely from day to day and he cleverly realized that this pattern provided a fingerprint characteristic of the initial rotor setup. The important thing about it is that it dependeds only on the number of chains and on the number of links in the chains; the exact characters in the chains were irrelevant.


Example of fingerprints structure
  1 chain with 10 characters
  2 chains with 5 characters
  1 chain with 6 characters      rotor order ACB rotor                                 position XHJ

  1 chain with 13 characters
  1 chain with 5 characters
  2 chains with 4 characters     rotor order BAC rotor                                 position FCD

Once the catalog containing all fingerprints was finished, the Poles could then identify the right key and decode all intercepted messages sent during the day, and start over again the day after knowing that most of the work was already done...at least until the Germans altered their usual way of transmitting messages, but Rejewski fought back. Even if his old fingerprints catalog was useles,but instead of rewriting it, he devised a mechanized version of it, which could automatically search for the correct scrambler settings. Rejewski’s invention was an adaptation of the Enigma machine, able to rapidly check each of the 17,576 settings until it spotted a match. Because of the six possible scrambler arrangements, it was necessary to have six of Rejewski’s machines working in parallel, each one representing one of the possible arrangements. Together, they formed a unit that was about three feet high, capable of finding the day key in roughly two hours. The units were called bombes, a name that might reflect the ticking noise they made while checking scrambler settings.

Bomba kryptologiczna  drawing 
from M.Rejewski’s papers

"The bombes effectively mechanized the process of decipherment. It was a natural response to Enigma, which was a mechanization of encipherment"

If you feel like you've missed something go on and check the previous posts related to this one, which are Secret Services & Patents: The Enigma Machine and Technology & The Enigma Machine
If you wanna dig deeper,you can satisfy your thirst for knowledge, you can click on the word links  or on the links of my sources.


Continues...

Sources:
The Code Book, Simon Singh
http://www.bletchleypark.org.uk/content/machines.rhtm
http://www.vectorsite.net/ttcode_08.html#m1
http://en.wikipedia.org/wiki/Bombe
http://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma




May 31, 2013

Technology & The Enigma Machine

The Enigma machine is actually one of the best thing I ever seen in my life... I know now is just an antique, but at the time it was one of the most incredible devices ever builted for its complexity, the extreme safeness of its encrypted messages and its handiness.
Exploded structure of a rotor
Let's dig a little bit deeper into this machine: the principal compontents of the first machine presented by Arthur Scherbious consisted of  a keyboard, a plugboard, 3/4 rotors, a reflector and a lamp display pannel.
The machine workedpretty much in the following way: the operator press a character in the typewriter starting an electric impulse that is going to follow a certain pattern which is swapped when it passes into the plugbloard, then it goes trough the rotors, come back thanks to the reflector and it light a lamp wich corresponds to a certain letter (result). Explained in that way it may looks that it is an easy code to break, but there is a lot more going on in that machine... in fact the rotors are not fixed in that position, but they change at each pression like the odometer does, meaning that the first rotors moves each   time, meanwhile the second one makes a step only after the first one has done an entire cycle, and the third one does the same with respect to the second one, moreover the plugboard disposition could have been changed and the first position of the rotors choosed freely. To sum up with all those basilar elements the machine already disposed of a number of possible combinations way big to be discovered in useful time.

Schematic representation of the classic enigma operation

And that it was just the classical machine, if we also consider the additional complexity given by the appendix devoloped later in time (which you can find in the previous post Secret Services & Patents: The Enigma Machine)  the number of possible combinations increases exponentially..

Here you can find other information about what was new in each evolution of the machine:
And in this one a programme that simulates the operation


And now a little bit of humor...



The argument of this post is related to the one contained in Secret Services & Patents: The Enigma Machine

Sources:
[The Code BookSimon Sing];
http://ciphermachines.com/enigma;
http://en.wikipedia.org/wiki/Enigma_machine;
http://www.bletchleypark.org.uk/content/machines.rhtm;
http://www.codesandciphers.org.uk/enigma/;






May 9, 2013

SIS, aka MI6...A little bit of History


As I've already said in the post Secrecy...Pro & Con cryptography departements have a story that dates back in ancient times...but if it's of proprer organizations, meaning agency, that we're talking about, the're first appereance is way more tardive....In particular, in the case of the SIS, the foundation year, as reported by the agency itself, is the 1909 with the Name of Secret Services Bureau, as a response to the continuous and threatening expansion of the German military and naval army, but its exhistance hadn't been revealed until the 1994 even if rumors were already spread by the publication of the literary succes of the James Bond Series by Ian Flemming.

Actually there were already multiples sign of activity since the late 15th century, at the time of  Tudors: there were infact powerful names like Cromwelles, which was intercecting messages in the country and abroad for Henry VIII, and Sir Francis Walsingham, Private Secretary for Elizabeth I, which discovered the conspiracy against the Queen directed by Mary the queen of Scots...
(further description about this episode can be found in the first chapter of The Code bookby Simon Singh)


The SIS is a the military inteligence section 6 (MI6), and it is divided its self in braches in which  the S.O.E. (Special Operations Executive) was included and that still includes the G.C.H.Q, the unit responsible for Signal Inteligence (SIGINT) and information insurance, and the G.C.&C.S., the code-breacking division creating during the WWII.

If you want to discover all the incredible men who took the lead of this incredible department:
https://www.sis.gov.uk/our-history/previous-chiefs.html

It is possible to find more information about the Historical Events affected by the work of the SIS checking the two links below:
https://www.sis.gov.uk/our-history.html
http://www.redicecreations.com/article.php?id=3683
http://en.wikipedia.org/wiki/Secret_Intelligence_Service

Or in alternative in the book
MI6: The history of the Secret Inteligence Service from 1909-1949by Prof. Keith JEFFERY,  [click on the title for a preview]



April 17, 2013

Coded Messages

It always have been clear to any king, emperor or government that keeping important messages and information from falling into hostile hands, is essential for the nation,empire or reign sake in both peace and war periods. That's why each one of them has created cryptography departement since ancient times.

Following I present two tecniques for coding messages mentioned in Pynchon's book. Actually these two example refer more to Steganography rather then Criptography, which is a less efficient way to keeping a message secret, because the message is just hidden...once it's discovered it can be easily read by anyone. A solution to this problem could be combining the two techniques, creating multiple issue to deal with in forcing the message as in the Kryptosam example (last quote).

Code messages in a dozen Slavic tongues were being tattooed on bare upper lips over which the
operatives then grew mustaches, to be shaved off only by authorized crypto officers and
skin then grafted over the messages by the Firm's plastic surgeons .. . their lips were
palimpsests of secret flesh, scarred and unnaturally white, by which they all knew each
other.

Teddy Bloat's [...] packing inside his stylish kangaroohide musette bag and threaded

around the odd necessities— midget spy-camera, jar of mustache wax



"Kryptosam" is a proprietary form of stabilized tyrosine, developed by IG Farben as
part of a research contract with OKW. An activating agent is included which, in the
presence of some component of the seminal fluid to date [1934] unidentified, promotes
conversion of the tyrosine into melanin, or skin pigment. In the absence of seminal fluid,
the "Kryptosam" remains invisible. No other known reagent, among those available to
operatives in the field, will alter "Kryp-tosam" to visible melanin. It is suggested, in
cryptographic applications, that a proper stimulus be included with the message which
will reliably produce tumescence and ejaculation. A thorough knowledge of the
addressee's psychosexual profile would seem of invaluable aid.
—prof. dr. laszlo jamf, "Kryptosam" (advertising brochure), Agfa, Berlin, 1934


Enough sperm saved, though, to rub over the blank scrap  enclosed with the picture. Slowly then, a revelation through the nacreous film of his seed,  in Negro-brown, comes his message: put in a simple Nihilist transposition whose keywords he can almost guess.

[Gravity's Rainbow, Thomas Pynchon]


The Nihilist Transposition is a real cripthography sample, where letters are turned into other using a row column transposition, following the pattern dictated by a Polybius square built on the base of a wordkey. Initially created by Russian spies it has been adopted also by the heads of the KGB



If you want to get into the Nihilist Transposition to know more or even learn how to use it for sending your secret messages go on and check these link below:
http://en.wikipedia.org/wiki/Nihilist_cipher
http://www.cryptogram.org/cdb/aca.info/aca.and.you/chap08.html#NIHITR

Further explanations about the difference between Cryptography and Steganography are given in the book  The Code Book, by Simon Singh, a book that I've already mentioned in the post Secrecy...Pro & Con

March 24, 2013

Secrecy...Pros & Cons

I know I should have already finished, but there is one last thing that I wanted to add and then I'm done with preambles... the major hindrance in tackling the world of secret services is the secrecy itself... and to better explain it I added a quote taken from the Introduction of The Code Book by Simon Singh, that it's actually referring to cryptography but I think that can also be extended to the secret services in general:

" The science of secrecy is largely a secret science. Many of the heroes in this book never gained recognition for their work during their lifetimes because their contribution could not be publicly acknowledged while their invention was still of diplomatic or military value. This culture of secrecy continues today, and organizations such as the U.S. National Security Agency still conduct classified research into cryptography. It is clear that there is a great deal more going on of which neither I nor any other science writer is aware"
[The Code Book, Simon Singh]



With these words I don't mean to absolve my self from my duty...I'm just trying to explain why many information, that I'm going to publish, will not cover the most advanced tools now disposable or why they will not be completely exhaustive.

P.S. I  read the entire book two years ago and I found it so interesting that I based my final high school exam thesis on some of its chapters... so I highly recommend it to anyone, also because it deals with a topic that is growing strongly in importance nowadays.