Softwire Speed Coding Challenge – Question 3


6 May 2012, by

previous article in series

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

Inside the linked zip file (Secret.zip) is a file (secret.dat) I have encrypted using the “truly unbreakable” security offered here.

  • 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!

next article in series

Tags: , , , ,

Categories: Social, Softwire, Technical

«
»

3 Responses to “Softwire Speed Coding Challenge – Question 3”

  1. configurator says:

    I have to say this sample is extremely biased towards a C# solution…

  2. Chris Williams says:

    Richard Bradley did create some equivalent libraries for System.Random for other languages, if you ask him nicely he might be able to put them somewhere online for you! Which language(s) were you thinking of using here?

  3. configurator says:

    I was just commenting on the fact that it sounded unfair. I’m not actually going to do it :)

    BTW, these libraries should be on bitbucket/github, they sound useful.


Leave a Reply

* Mandatory fields


5 − four =

Submit Comment