Colossus-al!

Every now and then, one of my customers comes back with something they've been working on.
In this case, it's Ben North showing some work he did modeling the Colossus code-breaking machine built at Bletchley Park.

First, Ben had to understand how Colossus actually broke codes.
He did this by creating a Jupyter notebook that replicated the process of encrypting some plain-text (in his case, Dicken's Pickwick Papers) with a Lorenz cipher and then analyzing it as Colossus did.
Doing this, he was able to debug his understanding of each step in the algorithm.
He shows how a small feature of the Lorenz cipher (that the encryption wheels do not always advance after each letter) leads to an observable distortion of the letter frequency in the encrypted text which can be used to guess likely settings for the wheels.

To test his design, Ben wrote unit tests in Python that drove a simulation of his VHDL code.
When it came time to test the real thing running in the FPGA, he just changed his unit tests so they interfaced with the Raspberry Pi GPIO pins connected to the XuLA2 board.

The results from the actual hardware test matched with the simulation on the first attempt.
According to Ben, he found this a "satisfying outcome".
I guess he picked up a penchant for English understatement while working on this project.

For those looking for a project, it would be great to recode Ben's VHDL into MyHDL.
Then it could be included in the same Jupyter notebook with the Lorenz encryption/decryption theory,
and the tests could be run using only Python with no need for the VHDL simulator.
You could probably also get dynamic animations of the Colossus pipelines that Ben had to
hard-code in his documentation.