On 16/10/2015 12:10, Tekin Suleyman wrote:
How'd everyone else get on?

Here’s my version using frequency analysis on the cipher text (and the key 
length) rather than decrypting the key. I didn’t quite get it working on the 
night (I was shifting characters the same way again rather than unshifting 
them, the same error I made later with the more usual approach), but was nearly 
there.

<https://gist.github.com/mattwildig/dc8030d79af3810f2a2a>

I’ve only slightly tidied (and fixed, of course) the code, but have added 
comments to attempt to describe what’s going on a bit. This only covers the 
first part of the challenge, but you could probably use the same methods to 
decrypt the next part. You would have to determine key length somehow, although 
one possibility could be to just try all possible key lengths in a range (say 2 
- 12) and just pick out the English word.

If you enjoyed this challenge and want to learn more about cryptology, you should have a 
look at the Matasano Crypto Challenges <http://cryptopals.com/> which has much more 
of the same sort of thing. Last nights task is basically the same as challenge 6 
<http://cryptopals.com/sets/1/challenges/6/> which is in the first “warm up” set (and 
which I’ve done and is why I knew about the frequency analysis approach). They go on to 
cover a large range of crypto subjects – I’ve learned a lot doing them (and still haven’t 
finished). Some of them are quite tricky, but are worth it.


Matt

--
You received this message because you are subscribed to the Google Groups "North 
West Ruby User Group (NWRUG)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at http://groups.google.com/group/nwrug-members.
For more options, visit https://groups.google.com/d/optout.

Reply via email to