Can time-travellers use TOTP codes?


A chunky wristwatch showing the time and a selection of 6 digit codes and their corresponding entities.

Imagine, just for a moment, you and your friends decide to travel in time. In order to make sure you can authenticate your communications with each other, you set up a shared Time-based One Time Password (TOTP). The TOTP algorithm uses a Hash-based Message Authentication Code (HMAC). The hash is calculated from a shared key and a time-based component. The key is a short string of characters. The time-based component is calculated as the number of seconds between now and the Unix Epoch. When…

Continue reading →

There should only ever be one way to express yourself


Logo of the Python programming language.

I've been thinking about programming languages and their design. In her book about the divergence of the English and American languages, Lynne Murphy asks this question: wouldn’t it be great if language were logical and maximally efficient? If sentences had only as many syllables as strictly needed? If each word had a single, unique meaning? If there were no homophones, so we’d not be able to mix up dear and deer or two and too? That got me thinking about the creativity which can be exp…

Continue reading →

The Seven Levels of Open Source


Unix is user-friendly — it's just choosy about who its friends are.

This isn't an original idea, but I needed to get it out of my brain. There are many different definitions of what "Open Source". We can have a lovely argument over a pint as to whether GPLv3 is too open or if a licence which hasn't been validated by the OSI counts. But, more fundamentally, I think Open Source roughly falls into seven levels. These aren't in any particular order of importance. And feel free to argue in the comments if you think I've radically misunderstood something. 1. Look…

Continue reading →

Compressing Text into Images


Random grey noise.

(This is, I think, a silly idea. But sometimes the silliest things lead to unexpected results.) The text of Shakespeare's Romeo and Juliet is about 146,000 characters long. Thanks to the English language, each character can be represented by a single byte. So a plain Unicode text file of the play is about 142KB. In Adventures With Compression, JamesG discusses a competition to compress text and poses an interesting thought: Encoding the text as an image and compressing the image. I would …

Continue reading →

Selectively Compressed Images - A Hybrid Format


Screenshot of a camera app on a phone. The middle is a photo, the sides show the user interface.

I have a screenshot of my phone's screen. It shows an app's user interface and a photo in the middle. Something like this: If I set the compression to be lossy - the photo looks good but the UI looks bad. If I set the compression to be lossless - the UI looks good but the filesize is huge. Is there a way to selectively compress different parts of an image? I know WebP and AVIF are pretty magical but, as I understand it, the whole image is compressed with the same algorithm and the same…

Continue reading →

Some thoughts on "Hacking the Cis-tem"


Black and white photo of the Queen Mother pressing a button on a 1960's era computer.

I recently read a wonderful paper by Mar Hicks called "Hacking the Cis-tem" which is about database design in the 1960s and the nascent digital state's approach to transgender individuals. It's a short and readable paper with some jaw-dropping anecdotes. Like the man who immediately got a pay rise after his transition, despite working in exactly the same job as before; women were on a lower pay scale... At a basic level you can see why, when computer memory was measured in tens of kilobytes,…

Continue reading →

Book Review: "You Are Not Expected to Understand This" How 26 Lines of Code Changed the World - Torie Bosch


Book cover. Lines of code hover on a blue background.

A superb book! It traces the origins of 26 facets of modern life so that you can understand the code which underpins them. There's only a smattering of actual code you need to read - most of it is constrained to gorgeous hand-drawn illustrations. Although I got a bit of a shock in the 2nd essay when I was confronted by ξ3 < exp(ΔE/τ)! Thankfully the rest of the chapter does a good job of explaining it and why it is important. There are some amazing confessionals from people who, arguably, ma…

Continue reading →

Touring TNMOC with a living legend


Photo of Bruce Perens and me waving at the camera. In the background is a banner for OpenUK and lots of old computer science books.

This is a retropost. It was written in 2022, but published later. Well, that was the most bizarre day. A few days ago, Amanda Brock - the CEO of OpenUK - asked if I'd be on a podcast. I agreed, and offered up my office's media studio for the recording. Then she asked if it was OK if Bruce Perens came to record an episode. Errr... OMG, yes! So I got to spend 10 minutes showing Bruce around the GDS office, gushing about how much open source stuff we did - then got to watch him record a…

Continue reading →

Get Chartered!


Photo of Michael Caine holding a shotgun from the movie Get Carter. The text says "Get Chartered".

Computing is a comparatively young industry. We don't have hundreds of years of history, or secret societies jealously guarding our knowledge, or much love for hierarchy. This makes it difficult to progress in a world which values strict demarcations between people. There's an obvious and well documented path from Army Private to Sergeant. If you're an architect (the kind that designs buildings) there are various qualifications and bodies to assess your knowledge and seniority. But…

Continue reading →

Regular Expressions make me feel like a powerful wizard - and that's not a good thing


A confused little cardboard robot is lost amongst the daisies

(This is a rant because I'm exhausted after debugging something. If you've made RegEx your whole personality, I'm sorry.) The other day I had to fix a multi-line Regular Expression (RegEx). After a few hours of peering at it with a variety of tools, I finally understood the problem. Getting that deep into the esoteric mysteries made me feel like a powerful wizard with complete mastery of my domain. And I think that's dangerous. I'm sure we've all read a story about a witch or wizard who…

Continue reading →

The absurdity of technocracy


Screenshot of a scan of newsprint.

Punch was a satirical magazine first published in Victorian London. It had a long and noble history of poking fun at... well, just about every fashionable idea of the day. Anyone who pricked the public's conscious probably found themselves lampooned within its pages. Charles Babbage - inventor of the first mechanical computer - found himself starring in a few articles. Here's a scan of one from 1844 (extracted text follows) Returning to the new Houses of Parliament, we must again…

Continue reading →

Fitting 1 dimensional data into 2 dimensional space


Hilbert curves.

A few notes to myself. Let's consider a set of 1 dimensional data. For example, the alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ What do we mean by "1 dimensional"? Consider the element "B". From there you can go left to "A" or right to "C". Left and right are the only directions you can move. You cannot go up or down from "B". There's no way to go in or out. You're trapped in a single dimension. What if we want to write the data onto a 2 dimensional space - like a bit of paper or a website. …

Continue reading →