Saturday, April 22, 2017

Cryptopals Set 1

I have started working through the Cryptopals Challenges after hearing about it on a Podcast.__init__ episode. It seems like a good and practical refresher to Dan Boneh's Crytopgraphy I class on Coursera (incidentally, I've been waiting for Crytography II for many years but the course seems to be constantly pushed back). It should also be a good exercise to work through in F# -- as a means to learn more of the language -- after completing a first pass in Python.

Set 1 is fairly straightforward, though it took me a while to workout how to operate consistently on bytearrays (per the Cryptopals rules) and convert between different encodings (hex, base64, bytes represented as ints vs chars...). It seems that Python 3 makes the experience of working with bytes a little easier.


  • Challenge 3 Single-Byte XOR Cipher: most frequency distribution of characters in the English language that I found did not include non-alphabet characters, such as space. My solution did not work until space was included in the scoring of plaintext (using chi-squared).