<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Duncan Jauncey&#039;s Blog</title>
	<atom:link href="http://www.duncanjauncey.com/blog/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://www.duncanjauncey.com/blog</link>
	<description>Pushing electrons</description>
	<lastBuildDate>Sat, 09 Jul 2011 09:41:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>Comment on Zephyr #1 by john</title>
		<link>http://www.duncanjauncey.com/blog/archives/119/comment-page-1#comment-55046</link>
		<dc:creator>john</dc:creator>
		<pubDate>Sat, 09 Jul 2011 09:41:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=119#comment-55046</guid>
		<description>Except that the cypher is commutative, so basically you&#039;re just making a very long key.  It&#039;s much the same as if you just applied the vigenere cypher on top of itself, but in this case it&#039;s shifted along. 

So for example to decrypt the first two parts you could use this key:

&lt;code&gt;NEILARMSTRONGNEILAGMJBJDNXVWXLRZE&lt;/code&gt;

Which is attained by inverse decrypting &lt;code&gt;RMSTRONGNEILARM&lt;/code&gt; using the 2nd key &lt;code&gt;PARIS&lt;/code&gt; (adding rather than subtracting modulo 26).  This give you:

&lt;code&gt;THECAPITALOFFRANCETHELONGESTRIVERXRPTFEZHWYSHFAJDNZLBBFRWC&lt;/code&gt;

The same process could be applied to create a key that would decrypt the entire message in one go.

So assuming the various keys line up right and don&#039;t overlap you could end up with a single key that&#039;s the length of the encrypted text (with no repetition).  I believe if you were using a one time pad etc then it&#039;d be impossible to decrypt a vigener cypher with a key as long as the message (that was suitably random), as there&#039;d be no repetition.  Not 100% sure about that though (never do cryptology alone).

Though of course as the message itself contains clues to it&#039;s own decryption it&#039;s definitely more of a puzzle than a cypher...</description>
		<content:encoded><![CDATA[<p>Except that the cypher is commutative, so basically you&#8217;re just making a very long key.  It&#8217;s much the same as if you just applied the vigenere cypher on top of itself, but in this case it&#8217;s shifted along. </p>
<p>So for example to decrypt the first two parts you could use this key:</p>
<p><code>NEILARMSTRONGNEILAGMJBJDNXVWXLRZE</code></p>
<p>Which is attained by inverse decrypting <code>RMSTRONGNEILARM</code> using the 2nd key <code>PARIS</code> (adding rather than subtracting modulo 26).  This give you:</p>
<p><code>THECAPITALOFFRANCETHELONGESTRIVERXRPTFEZHWYSHFAJDNZLBBFRWC</code></p>
<p>The same process could be applied to create a key that would decrypt the entire message in one go.</p>
<p>So assuming the various keys line up right and don&#8217;t overlap you could end up with a single key that&#8217;s the length of the encrypted text (with no repetition).  I believe if you were using a one time pad etc then it&#8217;d be impossible to decrypt a vigener cypher with a key as long as the message (that was suitably random), as there&#8217;d be no repetition.  Not 100% sure about that though (never do cryptology alone).</p>
<p>Though of course as the message itself contains clues to it&#8217;s own decryption it&#8217;s definitely more of a puzzle than a cypher&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zephyr #1 by duncanj</title>
		<link>http://www.duncanjauncey.com/blog/archives/119/comment-page-1#comment-55045</link>
		<dc:creator>duncanj</dc:creator>
		<pubDate>Mon, 04 Jul 2011 21:02:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=119#comment-55045</guid>
		<description>It seems to be that the key doesn&#039;t repeat very often over the plaintext question before it starts to repeat over the next block of ciphertext, hence frequency analysis doesn&#039;t have much to go on.  It would be even stronger if the keys were generally longer.  The brute force approach might produce good results though - unless the questions or keys were not normal english words, which they need not be.

There must already be a name for this kind of cipher/puzzle - I can&#039;t have invented it first. :-)</description>
		<content:encoded><![CDATA[<p>It seems to be that the key doesn&#8217;t repeat very often over the plaintext question before it starts to repeat over the next block of ciphertext, hence frequency analysis doesn&#8217;t have much to go on.  It would be even stronger if the keys were generally longer.  The brute force approach might produce good results though &#8211; unless the questions or keys were not normal english words, which they need not be.</p>
<p>There must already be a name for this kind of cipher/puzzle &#8211; I can&#8217;t have invented it first. <img src='http://www.duncanjauncey.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zephyr #1 by john</title>
		<link>http://www.duncanjauncey.com/blog/archives/119/comment-page-1#comment-55044</link>
		<dc:creator>john</dc:creator>
		<pubDate>Mon, 04 Jul 2011 09:28:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=119#comment-55044</guid>
		<description>Without knowing the answers it&#039;d be fairly tricky I guess, though the fact the answers tend to be words or names would make brute-forcing things a possibility.  Plus it looks like the vignere cipher has weaknesses that are well know:

http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher#Cryptanalysis

Basically the repeating key is the weakness.</description>
		<content:encoded><![CDATA[<p>Without knowing the answers it&#8217;d be fairly tricky I guess, though the fact the answers tend to be words or names would make brute-forcing things a possibility.  Plus it looks like the vignere cipher has weaknesses that are well know:</p>
<p><a href="http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher#Cryptanalysis" rel="nofollow">http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher#Cryptanalysis</a></p>
<p>Basically the repeating key is the weakness.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zephyr #1 by duncanj</title>
		<link>http://www.duncanjauncey.com/blog/archives/119/comment-page-1#comment-55043</link>
		<dc:creator>duncanj</dc:creator>
		<pubDate>Sun, 03 Jul 2011 16:40:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=119#comment-55043</guid>
		<description>Well done. :-)  I&#039;ll have to think up another one.  How hard do you think these would be to crack without knowing the answers?</description>
		<content:encoded><![CDATA[<p>Well done. <img src='http://www.duncanjauncey.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   I&#8217;ll have to think up another one.  How hard do you think these would be to crack without knowing the answers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zephyr #1 by john</title>
		<link>http://www.duncanjauncey.com/blog/archives/119/comment-page-1#comment-55042</link>
		<dc:creator>john</dc:creator>
		<pubDate>Sat, 02 Jul 2011 10:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=119#comment-55042</guid>
		<description>Ah, of course.  So in that case:

&lt;code&gt;
crypt=&#039;GLMNAGULTCCSLEEVNEZTNMXQTBNPOTMDVKVXEFVLZPPGULNNLYZRNKGAZP&#039;

from itertools import cycle

def vigenere(crypt, key):
    return &#039;&#039;.join([ chr(ord(&#039;A&#039;) + (ord(l) - ord(k)) % 26) for (l,k) in zip(crypt, cycle(key)) ])
    
res1 = vigenere(crypt, &#039;NEILARMSTRONG&#039;) # THECAPITALOFFRANCEIHVTGCGVALGIMMJSCGQSPYVHEGDZVUUKMLAGYPZY

res2 = vigenere(res1.replace(&#039;THECAPITALOFFRANCE&#039;, &#039;&#039;), &#039;PARIS&#039;) # THELONGESTRIVERDCPIAAYEZMRDINCFKVDIRYYRG

res3 = vigenere(res2.replace(&#039;THELONGESTRIVER&#039;, &#039;&#039;), &#039;NILE&#039;) # QUEENSNAMEGZVFRBXNSEEQNNT

res4 = vigenere(res3.replace(&#039;QUEENSNAME&#039;, &#039;&#039;), &#039;ELIZABETH&#039;) # CONGRATULATIONS
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Ah, of course.  So in that case:</p>
<p><code><br />
crypt='GLMNAGULTCCSLEEVNEZTNMXQTBNPOTMDVKVXEFVLZPPGULNNLYZRNKGAZP'</p>
<p>from itertools import cycle</p>
<p>def vigenere(crypt, key):<br />
    return ''.join([ chr(ord('A') + (ord(l) - ord(k)) % 26) for (l,k) in zip(crypt, cycle(key)) ])</p>
<p>res1 = vigenere(crypt, 'NEILARMSTRONG') # THECAPITALOFFRANCEIHVTGCGVALGIMMJSCGQSPYVHEGDZVUUKMLAGYPZY</p>
<p>res2 = vigenere(res1.replace('THECAPITALOFFRANCE', ''), 'PARIS') # THELONGESTRIVERDCPIAAYEZMRDINCFKVDIRYYRG</p>
<p>res3 = vigenere(res2.replace('THELONGESTRIVER', ''), 'NILE') # QUEENSNAMEGZVFRBXNSEEQNNT</p>
<p>res4 = vigenere(res3.replace('QUEENSNAME', ''), 'ELIZABETH') # CONGRATULATIONS<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zephyr #1 by duncanj</title>
		<link>http://www.duncanjauncey.com/blog/archives/119/comment-page-1#comment-55041</link>
		<dc:creator>duncanj</dc:creator>
		<pubDate>Fri, 01 Jul 2011 19:21:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=119#comment-55041</guid>
		<description>Very good, but you should chop off the question part before decrypting the remaining code.</description>
		<content:encoded><![CDATA[<p>Very good, but you should chop off the question part before decrypting the remaining code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zephyr #1 by john</title>
		<link>http://www.duncanjauncey.com/blog/archives/119/comment-page-1#comment-55040</link>
		<dc:creator>john</dc:creator>
		<pubDate>Fri, 01 Jul 2011 12:18:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=119#comment-55040</guid>
		<description>Using a &quot;Vigenère cipher&quot;:

&lt;code&gt;
crypt=&#039;GLMNAGULTCCSLEEVNEZTNMXQTBNPOTMDVKVXEFVLZPPGULNNLYZRNKGAZP&#039;
from itertools import cycle
&#039;&#039;.join([ chr(ord(&#039;a&#039;) + (ord(l) - ord(k)) % 26) for (l,k) in zip(crypt, cycle(&#039;NEILARMSTRONG&#039;)) ])
&lt;/code&gt;

Gives me:

&lt;code&gt;
&#039;thecapitaloffranceihvtgcgvalgimmjscgqspyvhegdzvuukmlagypzy&#039;
&lt;/code&gt;

But then trying to feed PARIS in as another key, or adding it to existing key doesn&#039;t seem to yield much.</description>
		<content:encoded><![CDATA[<p>Using a &#8220;Vigenère cipher&#8221;:</p>
<p><code><br />
crypt='GLMNAGULTCCSLEEVNEZTNMXQTBNPOTMDVKVXEFVLZPPGULNNLYZRNKGAZP'<br />
from itertools import cycle<br />
''.join([ chr(ord('a') + (ord(l) - ord(k)) % 26) for (l,k) in zip(crypt, cycle('NEILARMSTRONG')) ])<br />
</code></p>
<p>Gives me:</p>
<p><code><br />
'thecapitaloffranceihvtgcgvalgimmjscgqspyvhegdzvuukmlagypzy'<br />
</code></p>
<p>But then trying to feed PARIS in as another key, or adding it to existing key doesn&#8217;t seem to yield much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Zephyr #1 by duncanj</title>
		<link>http://www.duncanjauncey.com/blog/archives/119/comment-page-1#comment-55039</link>
		<dc:creator>duncanj</dc:creator>
		<pubDate>Wed, 29 Jun 2011 09:30:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=119#comment-55039</guid>
		<description>Any takers?</description>
		<content:encoded><![CDATA[<p>Any takers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Blog migration &amp; a new &#8216;retro&#8217; theme by john</title>
		<link>http://www.duncanjauncey.com/blog/archives/75/comment-page-1#comment-54908</link>
		<dc:creator>john</dc:creator>
		<pubDate>Thu, 31 Jul 2008 08:30:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.duncanjauncey.com/blog/?p=75#comment-54908</guid>
		<description>Good to see you&#039;ve upgraded and we can leave comments again!</description>
		<content:encoded><![CDATA[<p>Good to see you&#8217;ve upgraded and we can leave comments again!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
