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.

Saturday, 21 July 2012

My first impressions about Google Drive

As a prelude to the impending reformat I have been putting off, I decided yesterday to organise, to an extent, my files. I started categorising them and put them into the right places of the directory tree that I created inside Dropbox, so that my all my files would stay synchronised all the time. Now, this is not the first time I have attempted this. I remember doing something similar in 2008 on my old 333MHz computer, even downloading a Total Commander-like multi-panel replacement for Windows Explorer. I tried it again with my external hard disk some months ago, after I switched from Windows 7. I think there may have been other instances, but I can't recall them immediately. Anyway, this time, I hope to stick to the structure so that I don't have to go through this sorting and re-sorting process all over again. At least not in the near future.

While I was organising my files, I recalled my files that I had stored in Google Docs. Some of those files belonged in the organised folder structure that I had created. So I downloaded Google Drive, and after some testing, nested its folder inside my Dropbox folder. My rationale was that I would keep my most frequently accessed or edited documents in the Google Drive folder so that I may view and edit them from the university, and move the more infrequently accessed ones outside it, to wherever it belongs in Dropbox. While I was doing this, I noticed that most of the files inside the folder were associated with Google Chrome, rather than a local word processor; further investigation revealed that the files in question had a .gdoc extension.

"How convenient", I thought. Now I would be able to open the documents straight in Google Docs, and if I needed to, I could probably open them up in another office program. I started moving some of the .gdoc files to other locations in my Dropbox folder, outside Google Drive. Out of curiosity, I thought I would check if these files really would open in other office suites. If not, I could just open them in Google Docs and export them to the format I needed them in. I dragged the file into OpenOffice.org Writer, revealing the file to be merely a link to the document that is actually stored on Google's servers. That's right. The file contains a line of text which identifies that file, and Google Docs opens this file from Google's servers. Your actual file never gets stored on your computer. Note that this is only for files in Google Docs' format. Files in formats, like PDF, do get downloaded and can be opened in your local PDF viewer (which, ironically, is Google Chrome, in my case). Anyway, when the link files are moved outside the Drive folder, the Doc gets moved to the Bin in Google Docs. I found this rather disappointing. I had hoped for a system where I could save a file into Drive and edit it in Docs and local office suites without having to convert between formats. I have exported the files I needed to take out, to standard formats now. Docs integration was probably the biggest thing about Google Drive for me, but it has turned out to be little more than clever shortcuts.

Tuesday, 1 May 2012

Second year exams

It's that time of the year, again. Exams. Exams everywhere.

My first exam, on the pure mathematics module, is tomorrow. I have done little revision, though I am trying to make the best use of what little time I have left...by writing a blog post, of course.

I am fairly confident about part B, involving complex numbers. Now, that's either because I know the material reasonable well, or it is because I have no idea what it is about, and I'm deluding myself. Part A is slightly (and by slightly, I mean, significantly) harder, and deals with real variable theory. A bunch of stuff about limits, continuity, Rolle's Theorem, and other stuff I haven't even got to, yet. I will really need to put a lot of effort into this, if I am to achieve a respectable mark for this module. That may mean I have to make a few cups of tea, tonight.