Softwire Speed Coding Challenge – Question 3
6 May 2012, by Chris Williams
Welcome to the next in our series on Softwire’s coding challenge! Last time, we discussed the winning answer to the second question. This time round we’ve got a cryptography question for you (although you won’t need to know anything special) – I’ll post the winning answer and some further discussion in a week or so.
Truly Unbreakable Security
- Short summary of the encryption: XOR each byte of the plaintext file with the next byte produced by a new instance of System.Random in C#
- I have linked the source code of the encrypting app as Vernam.zip (NOTE: you do not need to read this)
I would like you to decrypt secret.dat (feel free to unzip it manually first).
To aid you in this, here are the 7 most common “magic numbers” from Wikipedia. These are byte sequences which appear at the start of a file to mark the file format:
CAFEBABE class 47494638 gif FFD8FFE0 jpeg 89504E47 png 4D546864 midi 25504446 pdf 504B0304 zip
As if that weren’t enough, you also get these two enormous hints:
- There are two constructors for System.Random – the default no-args constructor uses Environment.TickCount as a seed
- I rebooted my system less than an hour before encrypting this file
Best of luck with this one, we’ll post the winning solution and the answer in a couple of weeks!