Tagcloud
clone converter image mac unison virtual virtualbox vm vmware win2k windows 2000 xplane xpdisplay java codeArchives
- February 2013
- November 2012
- October 2012
- May 2012
- April 2012
- June 2011
- February 2010
- September 2009
- May 2009
- April 2009
- February 2009
- December 2008
- November 2008
- July 2008
- June 2008
- May 2008
- February 2008
- January 2008
- September 2007
- May 2007
- March 2007
- February 2007
- January 2007
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- May 2006
- January 2006
- August 2005
- July 2005
- June 2005
Meta

Any takers?
Using a “Vigenère cipher”:
crypt='GLMNAGULTCCSLEEVNEZTNMXQTBNPOTMDVKVXEFVLZPPGULNNLYZRNKGAZP'
from itertools import cycle
''.join([ chr(ord('a') + (ord(l) - ord(k)) % 26) for (l,k) in zip(crypt, cycle('NEILARMSTRONG')) ])
Gives me:
'thecapitaloffranceihvtgcgvalgimmjscgqspyvhegdzvuukmlagypzy'
But then trying to feed PARIS in as another key, or adding it to existing key doesn’t seem to yield much.
Very good, but you should chop off the question part before decrypting the remaining code.
Ah, of course. So in that case:
crypt='GLMNAGULTCCSLEEVNEZTNMXQTBNPOTMDVKVXEFVLZPPGULNNLYZRNKGAZP'
from itertools import cycle
def vigenere(crypt, key):
return ''.join([ chr(ord('A') + (ord(l) - ord(k)) % 26) for (l,k) in zip(crypt, cycle(key)) ])
res1 = vigenere(crypt, 'NEILARMSTRONG') # THECAPITALOFFRANCEIHVTGCGVALGIMMJSCGQSPYVHEGDZVUUKMLAGYPZY
res2 = vigenere(res1.replace('THECAPITALOFFRANCE', ''), 'PARIS') # THELONGESTRIVERDCPIAAYEZMRDINCFKVDIRYYRG
res3 = vigenere(res2.replace('THELONGESTRIVER', ''), 'NILE') # QUEENSNAMEGZVFRBXNSEEQNNT
res4 = vigenere(res3.replace('QUEENSNAME', ''), 'ELIZABETH') # CONGRATULATIONS
Well done.
I’ll have to think up another one. How hard do you think these would be to crack without knowing the answers?
Without knowing the answers it’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.
It seems to be that the key doesn’t repeat very often over the plaintext question before it starts to repeat over the next block of ciphertext, hence frequency analysis doesn’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’t have invented it first.
Except that the cypher is commutative, so basically you’re just making a very long key. It’s much the same as if you just applied the vigenere cypher on top of itself, but in this case it’s shifted along.
So for example to decrypt the first two parts you could use this key:
NEILARMSTRONGNEILAGMJBJDNXVWXLRZEWhich is attained by inverse decrypting
RMSTRONGNEILARMusing the 2nd keyPARIS(adding rather than subtracting modulo 26). This give you:THECAPITALOFFRANCETHELONGESTRIVERXRPTFEZHWYSHFAJDNZLBBFRWCThe 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’t overlap you could end up with a single key that’s the length of the encrypted text (with no repetition). I believe if you were using a one time pad etc then it’d be impossible to decrypt a vigener cypher with a key as long as the message (that was suitably random), as there’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’s own decryption it’s definitely more of a puzzle than a cypher…