Tuesday, 25 September 2012

What I did last summer

Not having been able to secure an internship in the first year, I was very happy to have been offered a position at Sublime Software as a developer for the Briar project in the summer of 2012.

The Briar project is an open source, invitation-based, secure news and discussion platform to help people in countries where communication over the Internet is monitored. It is meant to help democracy and civil rights activists, as well as journalists. It can make use of Bluetooth connections and similar networks, aside from the Internet. You can read more about it by clicking the link above.

Dr Michael Rogers of the Briar project assigned to me the creation of a cryptographically secure pseudorandom number generator. Java already includes a secure pseudorandom number generator, SecureRandom, but it depends on the implementation. Briar needed a reliable, deterministic random number generator, so I was assigned the job of implementing Fortuna, a CSPRNG created by cryptographers Bruce Schneier and Niels Ferguson. Fortuna is named after the Roman goddess of luck, who is also commonly referred to as lady luck. The book that I used for help is called Cryptography Engineering: Design Principles and Practical Applications.

I created three Java classes to implement most of Fortuna's functions. First was the deterministic generator, which used SHA-256 and AES. The second was the accumulator, which accumulated entropy and used it to seed the generator. It also contained methods to read and write seed files. The third was a class which actually collected entropy from various sources and sent it to the accumulator. This part would run as multiple threads, each thread collecting data from different sources (such as the keyboard, or /dev/random on Linux), and when it had enough data, it would send it to the accumulator. One of the sources was the RDRAND instruction on Intel's Ivy Bridge processors; I used inline assembly in a C class to make use of Intel's random number generator, and linked to it from Java.

Working on the Briar project was a great experience; I was already interested in cryptography, having taken part in the National Cipher Challenge twice, so this experience made me even more interested in the field. I am currently taking an online course on cryptography on Coursera, taught by Professor Dan Boneh of Stanford University.

Other than that, I started learning to drive, which I might  post about in the future. From December onwards, car insurance providers will no longer be able to discriminate against men, so driving might become feasible. I doubt it, though. I can't think where I would want to drive to, that I cannot get to by train or bus conveniently.