<?xml version="1.0" encoding="UTF-8" ?>
  <resource>
  <id>7943</id>
  <path>/www/nrich/html/content/id/7943/</path>
  <resourceTypeID>1</resourceTypeID>
  <last_published>2011-12-21T10:40:26</last_published>
  <indexXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p&gt;This problem follows on from &lt;a href=&quot;/4957&quot;&gt;Substitution Cipher&lt;/a&gt; and &lt;a href=&quot;/7940&quot;&gt;Transposition Cipher&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/br&gt;
Below is a secret message. It&amp;#39;s been double encrypted, first using a substitution cipher and then using a transposition cipher. &lt;strong&gt;Can you decipher it?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;
whhujnjwuzlwvvdhgdlkqwdhvdkelqhldwurlhhwklwwuhdwdgqjkhzqqbrhowkgbqkq
ywhuovwfzebzlhhzfwrlkwrhddhhhkdqsqhkkuohkrfqqdujdbjdvulhgoidpwggvhlg
vwqdhollduwzudhwqqhhrwqmguqzrzlljykrzyaprgxuidlqdwfrhhwlhfdppvhduwwv
kerukuwuhvldwqwbkgfkhgbrdkwsnpgrdkufrdrogpxllkwhhduqhhrrowohrvogrdoc
pggugouodvdghzrxvbrhlwderdhqiohddqjdqrwqkquxwggurujbwkphoxdhgluldfhi
qhfvwhdrvubpfhokrqzfqkxddqjvbornghdofkrwlseqgldvlwijgogklqvosrvffxxy
kuosozzwyvgrxrrdgehhrddddlhhduvwirovxguqvvewqsqb
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If you want to work on a computer, you can download the ciphertext as a text file &lt;a href=&quot;/content/id/7943/subtrans.txt&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can then use our &lt;a href=&quot;http://nrich.maths.org/7983&quot;&gt;Cipher Challenge Toolkit&lt;/a&gt; to help you decrypt it.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If you are interested in code breaking you might enjoy the &lt;a href=&quot;/7934&quot;&gt;Secondary Cipher Challenge&lt;/a&gt;.&lt;/p&gt;&lt;/mdoxml&gt;</indexXML>
  <solutionXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p&gt;&lt;span class=&quot;editorial&quot;&gt;Well done to Holly from Hymers School who cracked this problem. She described her method as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The way I solved this problem was looking at the frequency graph on the Cipher Toolkit. I realised that it would line up with the normal English letter frequency if every letter was moved three to the right (e.g. h-e, d-a), so I moved them all three to the right and came up with a code, which I then transposed. I discovered the factors of 456 are 1, 2, 3, 4, 6, 8, 12,
19, 24, 38, 57, 76, 114, 152, 228 and 456. The first and last two wouldn&amp;#39;t be likely, so I kept trying the different factors until I came up with 19 being the correct number of columns.&lt;/p&gt;
&lt;p&gt;Writing the message in a 24 by 19 grid and decoding the Caesar shift of +3 gives:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;
t e e r g k g t r w i t s s a e d a i
&lt;/pre&gt;
&lt;pre&gt;
h n t a e s a h b i n e i a t r o i e
e t h i t t r e a t a d n g h e w n n
y o e l t h d y n h n v t e r l s t c
w b y w i e e w c t o i h t o e a a e
e e h a n p n e h h r l e h o c n n a
r g a y g a s r i e d l f a m t d d s
e i d s t n a e l i i a r t w r a e t
n n e e o t n j d r n w o w i i g v h
o w v x m o d u r f a i n a t c o e e
t i e c a m m s e a r t t s h b o r h
r t r e s i a t n t y h d c h e d y o
a h t p k m d o a h r c o a o l d m u
i i h t e e a r n e e o o l t l e o s
l d o a l z m d d r d l r l a s a d e
w o u s y o e i t a b o a e n f l e a
a n g a n o t n h n r u t d d r o r g
y t h m e l u a e d i r i a c e f n e
c s t e a o s r y m c e l h o n w c n
h u a a n g s y l o k d e a l c h o t
i p b n d i a s i t f g d l d h i n s
l p o s c c u u v h r l p l w w t v s
d o u o o a d b e e o a a a a i e e a
r s t f o l s u d r n s s b t n p n y
&lt;/pre&gt;
&lt;pre&gt;

&lt;/pre&gt;
&lt;p&gt;Reading down the columns gives the plaintext:&lt;br&gt;&lt;/br&gt;
 &lt;/p&gt;
&lt;pre&gt;
theywerenotrailwaychildrentobeginwithidontsupposetheyhadeverthoughta
boutrailwaysexceptasameansofgettingtomaskelyneandcooksthepantomimezo
ologicalgardensandmadametussaudstheywerejustordinarysuburbanchildren
andtheylivedwiththeirfatherandmotherinanordinaryredbrickfrontedvilla
withcolouredglassinthefrontdooratiledpassagethatwascalledahallabathr
oomwithhotandcoldwaterelectricbellsfrenchwindowsandagooddealofwhitep
aintandeverymodernconvenienceasthehouseagentssay
&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/br&gt;
Here is the text that Holly managed to decipher:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;They were not railway children to begin with. I don&amp;#39;t suppose they had ever thought about railways except as a means of getting to Maskelyne and Cook&amp;#39;s, the Pantomime, Zoological Gardens, and Madame Tussaud&amp;#39;s. They were just ordinary suburban children, and they lived with their Father and Mother in an ordinary red-brick-fronted villa, with coloured glass in the front door, a tiled passage
that was called a hall, a bath-room with hot and cold water, electric bells, French windows, and a good deal of white paint, and &amp;#39;every modern convenience&amp;#39;, as the house-agents say.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s the first paragraph from &quot;The Railway Children&quot; by E. Nesbit&lt;/p&gt;&lt;/mdoxml&gt;</solutionXML>
  <noteXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;h3&gt;Why do this problem?&lt;/h3&gt;
&lt;p&gt;Together with the &lt;a href=&quot;/7934&quot;&gt;Secondary Cipher Challenge&lt;/a&gt;, this problem provides a challenging follow-up for students who have worked on &lt;a href=&quot;/4957&quot;&gt;Substitution Cipher&lt;/a&gt; and &lt;a href=&quot;/7940&quot;&gt;Transposition Cipher&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt; &lt;/h3&gt;
&lt;h3&gt;Possible approach&lt;/h3&gt;
&lt;p&gt;As this problem is quite challenging, it could be offered as an extension for those students who have sailed through the easier codebreaking problems.&lt;/p&gt;
&lt;p&gt;If a whole class is going to work on the problem, they could work in small groups and share out responsibility for checking different transposition arrangements for each likely substitution.&lt;/p&gt;
&lt;p&gt;If a computer room is available, introduce students to the &lt;a href=&quot;/7983&quot;&gt;Cipher Challenge Toolkit&lt;/a&gt; and give them plenty of time to explore it and learn how to use the tools.&lt;/p&gt;
&lt;h3&gt; &lt;/h3&gt;
&lt;h3&gt;Possible extension&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;/7081&quot;&gt;Stage 5 Cipher Challenge&lt;/a&gt; offers a set of seven very difficult linked ciphers to crack.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;Possible support&lt;/h3&gt;
&lt;p&gt;Spend plenty of time working on and discussing the separate Substitution and Transposition problems before trying this one.&lt;/p&gt;&lt;/mdoxml&gt;</noteXML>
  <clueXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p&gt; &lt;/p&gt;
&lt;p&gt;456 has 14 factors.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/br&gt;
The two methods used to encrypt the message are commutable, so it doesn&amp;#39;t matter which method you decipher first.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;/mdoxml&gt;</clueXML>
  <canonXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p&gt;It&amp;#39;s the first paragraph from &amp;quot;The Railway Children&amp;quot; by E. Nesbit encrypted with a matrix transposition of size 19 by 24 and a Caesar shift of +3. Writing the message in a 24 by 19 grid and decoding the Caesar shift gives:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;
t e e r g k g t r w i t s s a e d a i
&lt;/pre&gt;
&lt;pre&gt;
h n t a e s a h b i n e i a t r o i e
e t h i t t r e a t a d n g h e w n n
y o e l t h d y n h n v t e r l s t c
w b y w i e e w c t o i h t o e a a e
e e h a n p n e h h r l e h o c n n a
r g a y g a s r i e d l f a m t d d s
e i d s t n a e l i i a r t w r a e t
n n e e o t n j d r n w o w i i g v h
o w v x m o d u r f a i n a t c o e e
t i e c a m m s e a r t t s h b o r h
r t r e s i a t n t y h d c h e d y o
a h t p k m d o a h r c o a o l d m u
i i h t e e a r n e e o o l t l e o s
l d o a l z m d d r d l r l a s a d e
w o u s y o e i t a b o a e n f l e a
a n g a n o t n h n r u t d d r o r g
y t h m e l u a e d i r i a c e f n e
c s t e a o s r y m c e l h o n w c n
h u a a n g s y l o k d e a l c h o t
i p b n d i a s i t f g d l d h i n s
l p o s c c u u v h r l p l w w t v s
d o u o o a d b e e o a a a a i e e a
r s t f o l s u d r n s s b t n p n y
&lt;/pre&gt;
&lt;pre&gt;

&lt;/pre&gt;
&lt;p&gt;Reading down the columns gives the plaintext:&lt;br&gt;&lt;/br&gt;
 &lt;/p&gt;
&lt;pre&gt;
theywerenotrailwaychildrentobeginwithidontsupposetheyhadeverthoughta
boutrailwaysexceptasameansofgettingtomaskelyneandcooksthepantomimezo
ologicalgardensandmadametussaudstheywerejustordinarysuburbanchildren
andtheylivedwiththeirfatherandmotherinanordinaryredbrickfrontedvilla
withcolouredglassinthefrontdooratiledpassagethatwascalledahallabathr
oomwithhotandcoldwaterelectricbellsfrenchwindowsandagooddealofwhitep
aintandeverymodernconvenienceasthehouseagentssay

&lt;/pre&gt;
&lt;pre&gt;


&lt;/pre&gt;
&lt;pre&gt;


&lt;/pre&gt;
&lt;pre&gt;


&lt;/pre&gt;
&lt;pre&gt;

&lt;/pre&gt;&lt;/mdoxml&gt;</canonXML>
  <end_user_role>2</end_user_role>
  <difficulty>5</difficulty>
  <keystage1>0</keystage1>
  <keystage2>0</keystage2>
  <keystage3>1</keystage3>
  <keystage4>1</keystage4>
  <keystage4plus>0</keystage4plus>
  <title>Substitution Transposed</title>
  <description>Substitution and Transposition all in one! How fiendish can these codes get?</description>
  <spec_group>Applications
    <specifier>Codes and cryptography</specifier>
  </spec_group>
  <spec_group>Numbers and the Number System
    <specifier>Factors and multiples</specifier>
  </spec_group>
  <spec_group>Handling, Processing and Representing Data
    <specifier>Comparing data</specifier>
  </spec_group>
  <spec_group>Handling, Processing and Representing Data
    <specifier>Frequency tables and diagrams</specifier>
  </spec_group>
</resource>