Cracking the code

And later devising one!

Having mentioned my ancient and long lost collection of comics recently, and noting the annuals I now have amongst other things, I’ve started browsing this type of stuff on eBay. I have made a small number of purchases, which I may or may not talk about another time, but for the moment I’m focusing on something else.

Looking specifically at annuals, a number of old titles jumped out at me and triggered an old memory, and that in turn another from a few years later.

Firstly, those titles – there are plenty of annuals on eBay relating to other comics I bought long after the early ones I mentioned (Beano, The Dandy, etc), but long before the Star Wars Weekly comics that I subsequently bought. These are titles like Warlord, Victor, and Battle.

I couldn’t say now at what point I was buying those titles, and possibly similar ones – not with any certainty, anyway, although I want to say it was while we lived at the second house; the one we moved to and discovered that my earlier comic collection had been torn up and used as wrapping/packing material.

I don’t think I ever kept these comics, so there was no issue of them subsequently disappearing. I’d say it’s entirely possible that (if I’m right about when I was buying them) at the back of my mind I was thinking there was no point keeping them, because look what happened before!

What I remembered is a membership club available to readers of one of the comics. They probably all had these, and back then I imagine they probably cost a quid or two for an (annual?) membership, which would have got a little pack consisting of… well, I don’t know what. A badge? A card? Things like that, probably.

I don’t know which one it was – and it might even not have been one of those mentioned above – but in one particular case, as well as whatever the pack consisted of, there was a members’ page in the comic, and the content of the page (other than the form for joining) was in a special secret code. Sometimes there were strings of letters, sometimes strings of numbers – there was more than one code.

Woo!

I never joined. We were a very hard up family back then, cutting costs wherever possible. I was lucky my parents could spare me enough money to buy comics – maybe five or ten pence here and there – but there was no way they could afford to give me enough to become a member of something like that.

But those secret codes annoyed me.

So I sat down and cracked them. 🙂

They were only very simple codes, with the one I remember most being a basic offset-by-n affair, where for each letter of the alphabet you use the letter n further along, rotating back to ‘a’ when you pass ‘z’. For example, if n is one, ‘a’ would become ‘b’, ‘b’ would become ‘c’, and so on, until ‘z’ becomes ‘a’. If n is two, ‘a’ becomes ‘c’, ‘b’ becomes ‘d’, and so on until ‘y’ becomes ‘a’ and ‘z’ becomes ‘b’. It wasn’t offset by one, but it wasn’t a high number – three or four, maybe.

A more well known example of that sort of code is ROT13. This was often used online in years gone by as a simple way to encode things so that they couldn’t be quickly read by humans without decoding. This would commonly be done on usenet (along with or in place of spoiler space) so that people didn’t accidentally read spoilers for films and TV shows until they’d seen them, at which point they could actively decode the text to join in the discussion. Decoding is incredibly simple; the same code that encodes also decodes, because the offset (13) is exactly half the number of letters in the alphabet – while ‘a’ becomes ‘n’, ‘n’ becomes ‘a’, and so on.

In fact, a very long time ago I wrote a simple ROT13 encoder (and by extension decoder) in JavaScript just to prove how easy it is to do – and to make a point about library sizes when I saw the size of a download for a program specific to the job. And, yes, it’s still online and working today. There are much better ways to do the same job, even in JavaScript, probably – but if memory serves the underlying JavaScript used there is the same now as it was when I wrote it all those years ago. All that’s changed is the way the page looks on which it is used, and at some point I fixed a bug that was inserting an extra space each time the button was clicked!

The point, though, is that sort of code is incredibly simple. Speaking as an adult, spotting and working out a code like that should be child’s play – but don’t forget that at the time I was maybe eight or so years old. I was a child!

I think the others were similar – possibly one with certain letters swapped with certain others, and the numeric one was a combination of a swap (or an offset) and a numerical equivalent (so instead of ‘a=1, b=2’ etc, it might have been ‘a=8, b=9’ and so on.)

I remember being incredibly proud of myself – all of a sudden I could decode and read everything that was published in the secret codes, in every issue from that point on.

But that wasn’t where I left it. Oh no. 🙂

I wrote a letter to the address published for joining the club – probably in one of their no-longer-quite-so-secret (to me) codes, but that’s another small point that I can’t be certain of – demanding that they give me a free membership or I’d spill the beans!

My recollection is that I never got that free membership. That could have either been because they just ignored the idiotic and very cheeky kid, or simply because the letter never got sent. Although I distinctly remember writing it, I don’t actually remember ever sending it off…

So I probably didn’t.

Now fast forward a few years, until I was maybe thirteen or so. This was when I devised a code of my own. Not that I can remember why – I know that we discussed codes of this sort at one point (I want to say in computer studies, leading up to a programming exercise – but I’m sure that was later).

I knew a simple offset-by-n code would be too easy to defeat – probably because I remembered how easily I worked out that one only a few years earlier.

What I came up with was a combination of substitution/swapping and offset-by-one, but conditionally. The basic condition was simple – vowels remained vowels, and consonants remained consonants. I came up with that rule before coming up with the code itself in the – as it happens mistaken – belief that it meant encoded words would be pronounceable.

With that in mind, the offset-by-one part of the code was applied to vowels; the offset-by-one wasn’t ‘by one letter’ but ‘by one vowel’ – so ‘a’ became ‘e’, ‘e’ became ‘i’, and so on up to ‘u’, which became ‘a’.

For the consonants there was a substitution that worked mostly in pairs – ‘b’ was substituted with ‘c’ and vice versa, ‘d’ and ‘f’, and so on. i.e. adjacent pairs of consonants were swapped. However, there was a snag, because with 26 letters of the alphabet, five of which are vowels to which an offset-by-one system was adopted, that left an odd number of consonants. Perhaps in hindsight I should have treated ‘y’ as a vowel, but I didn’t – so for one group of three consonants, the offset-by-one approach was used. Those were ‘j’ to ‘l’, but just to mix it up a little, they were off by one in the other direction! i.e. ‘l’ became ‘k’, ‘k’ became ‘j’, and ‘j’ became ‘l’ (alternatively, you could look at it as offset-by-two).

Let’s take a simple example – but also a very useful one because it’s one I used at the time, and it made me prouder of what I came up with than I ever should have been. That example is the words ‘a blue coat’ – encoded, that becomes ‘e ckai buev’.

Bear in mind that this was around the time I was either still taking French at school, or certainly not long after I’d stopped (it was mandatory for the first two or three years at secondary school, so I took it from when I was eleven until I was either thirteen or fourteen). Whereas in English we tend to put an adjective before a noun – i.e. the word ‘blue’ in that example – in French, it would be the other way around. According to an online translator, ‘a blue coat’ becomes ‘un manteau bleu’ – quite literally, ‘a coat blue’. These days, I know ‘bleu’ already but not ‘manteau’ – I may have known that one at the time, though.

So once I’d hit upon that example, I immediately thought that if someone saw something written in my secret code, and if they were told ‘e ckai buev’ meant ‘a blue coat’, they’d probably think they were looking at a language they didn’t understand, rather than something written in code.

My thinking was that with ‘buev’ looking so much like ‘blue’ (see also ‘bleu’ in French), it looked as though the ‘language’ had a noun-adjective form – and that this would have been reinforced by the alliteration between ‘ckai’ and ‘coat’.

The ‘buev’ and ‘blue’ similarity was a bonus, but the alliteration would hold true wherever the adjective and noun began with the right pair of letters – not something I thought of beforehand, but something I realised after. So ‘a good horse’, for example, would become ‘a huuf gusri’ – and if I’d thought of it at the time, that’s probably another one I might have used as an example back then, because of the word ‘huuf’ and how close it looks to ‘hoof’. The benefits of hindsight! 😉

Even without that new bonus example, though, it was a combination of the alliteration, and the useful similarity of the word ‘buev’ to ‘blue’ that ticked the box for me.

That’s what made me so proud of what I’d come up with at the time.

Ah, the naivety of youth!

Related posts