Crypto

Cryptography is a funny business; shady from the beginning, the whole business of codes and ciphers has been specifically designed to hide your intentions and move in the shadows, unnoticed. However, the art of cryptography has been changed almost beyond recognition in the last hundred years thanks to the invention of the computer, and what was once an art limited by the imagination of the nerd responsible has now turned into a question of sheer computing might. But, as always, the best way to start with this story is at the beginning…

There are two different methods of applying cryptography to a message; with a code or with a cipher. A code is a system involving replacing words with other words (‘Unleash a fox’ might mean ‘Send more ammunition’, for example), whilst a cipher involves changing individual letters and their ordering. Use of codes can generally only be limited to a few words that can be easily memorised, and/or requires endless cross-referencing with a book of known ‘translations’, as well as being relatively insecure when it comes to highly secretive information. Therefore, most modern encoding (yes, that word is still used; ‘enciphering’ sounds stupid) takes the form of employing ciphers, and has done for hundreds of years; they rely solely on the application of a simple rule, require far smaller reference manuals, and are more secure.

Early attempts at ciphers were charmingly simple; the ‘Caesar cipher’ is a classic example, famously invented and used by Julius Caesar, where each letter is replaced by the one three along from it in the alphabet (so A becomes D, B becomes E and so on). Augustus Caesar, who succeeded Julius, didn’t set much store by cryptography and used a similar system, although with only a one-place transposition (so A to B and such)- despite the fact that knowledge of the Caesar cipher was widespread, and his messages were hopelessly insecure. These ‘substitution ciphers’ suffered from a common problem; the relative frequency with which certain letters appear in the English language (E being the most common, followed by T) is well-known, so by analysing the frequency of occurring letters in a substitution-enciphered message one can work out fairly accurately what letter corresponds to which, and work out the rest from there. This problem can be partly overcome by careful phrasing of messages and using only short ones, but it’s nonetheless a problem.

Another classic method is to use a transposition cipher, which changes the order of letters- the trick lies in having a suitable ‘key’ with which to do the reordering. A classic example is to write the message in a rectangle of a size known to both encoder and recipient, writing in columns but ‘reading it off’ in rows. The recipient can then reverse the process to read the original message. This is a nice method, and it’s very hard to decipher a single message encoded this way, but if the ‘key’ (e.g. the size of the rectangle) is not changed regularly then one’s adversaries can figure it out after a while. The army of ancient Sparta used a kind of transposition cipher based on a tapered wooden rod called a skytale (pronounced skih-tah-ly), around which a strip of paper was wrapped and the message written down it, one on each turn of paper. The recipient then wrapped the paper around a skytale of identical girth and taper (the tapering prevented letters being evenly spaced, making it harder to decipher), and read the message off- again, a nice idea, but the need to make a new set of skytale’s for everyone every time the key needed changing rendered it impractical. Nonetheless, transposition ciphers are a nice idea, and the Union used them to great effect during the American Civil War.

In the last century, cryptography has developed into even more of an advanced science, and most modern ciphers are based on the concept of transposition ciphers- however, to avoid the problem of using letter frequencies to work out the key, modern ciphers use intricate and elaborate systems to change by how much the ‘value’ of the letter changes each time. The German Lorenz cipher machine used during the Second World War (and whose solving I have discussed in a previous post) involved putting the message through three wheels and electronic pickups to produce another letter; but the wheels moved on one click after each letter was typed, totally changing the internal mechanical arrangement. The only way the British cryptographers working against it could find to solve it was through brute force, designing a computer specifically to test every single possible starting position for the wheels against likely messages. This generally took them several hours to work out- but if they had had a computer as powerful as the one I am typing on, then provided it was set up in the correct manner it would have the raw power to ‘solve’ the day’s starting positions within a few minutes. Such is the power of modern computers, and against such opponents must modern cryptographers pit themselves.

One technique used nowadays presents a computer with a number that is simply too big for it to deal with; they are called ‘trapdoor ciphers’. The principle is relatively simple; it is far easier to find that 17 x 19 = 323 than it is to find the prime factors of 323, even with a computer, so if we upscale this business to start dealing with huge numbers a computer will whimper and hide in the corner just looking at them. If we take two prime numbers, each more than 100 digits long (this is, by the way, the source of the oft-quoted story that the CIA will pay $10,000 to anyone who finds a prime number of over 100 digits due to its intelligence value) and multiply them together, we get a vast number with only two prime factors which we shall, for now, call M. Then, we convert our message into number form (so A=01, B=02, I LIKE TRAINS=0912091105201801091419) and the resulting number is then raised to the power of a third (smaller, three digits will do) prime number. This will yield a number somewhat bigger than M, and successive lots of M are then subtracted from it until it reaches a number less than M (this is known as modulo arithmetic, and can be best visualised by example: so 19+16=35, but 19+16 (mod 24)=11, since 35-24=11). This number is then passed to the intended recipient, who can decode it relatively easily (well, so long as they have a correctly programmed computer) if they know the two prime factors of M (this business is actually known as the RSA problem, and for reasons I cannot hope to understand current mathematical thinking suggests that finding the prime factors of M is the easiest way of solving this; however, this has not yet been proven, and the matter is still open for debate). However, even if someone trying to decode the message knows M and has the most powerful computer on earth, it would take him thousands of years to find out what its prime factors are. To many, trapdoor ciphers have made cryptoanalysis (the art of breaking someone else’s codes), a dead art.

Man, there’s a ton of cool crypto stuff I haven’t even mentioned yet… screw it, this is going to be a two-parter. See you with it on Wednesday…

Advertisement

In a hole in the ground there lived a hobbit…

I read a lot; I have done since I was a kid. Brian Jacques, JK Rowling, Caroline Lawrence and dozens of other authors’ work sped through my young mind, throwing off ideas, philosophies, and any other random stuff I found interesting in all directions. However, as any committed reader will tell you, after a while flicking through any genre all the ‘low hanging fruit’, the good books everyone’s heard of, will soon be absorbed, and it is often quite a task to find reliable sources of good reading material. It was for partly this reason that I, some years ago, turned to the fantasy genre because, like it or loathe it, it is impossible to deny the sheer volume of stuff, and good stuff too, that is there. Mountains of books have been written for it, many of which are truly huge (I refer to volumes 11 and 12 of Robert Jordan’s ‘Wheel of Time’, which I have yet to pluck up the courage to actually read, if anyone doubts this fact), and the presence of so many different subgenres (who can compare George RR Martin, creator of A Game of Thrones, with Terry Pratchett, of Discworld fame) and different ideas gives it a nice level of innovation within a relatively safe, predictable sphere of existence.

This sheer volume of work does create one or two issues, most notably the fact that it can be often hard to consult with other fans about ‘epic sagas’ you picked up in the library that they may never have even heard of (hands up how many of you have heard of Raymond E Feist, who really got me started in this genre)- there’s just so much stuff, and not much of it can be said to be standard reading material for fantasy fans. However, there is one point of consistency, one author everyone’s read, and who can always be used as a reliable, if high, benchmark. I speak, of course, of the work of JRR Tolkein.

As has been well documented, John Ronald Reuel Tolkein was not an author by trade or any especial inclination; he was an academic, a professor of first Anglo-Saxon and later English Language & Literature at Pembroke College, Oxford, for 34 years no less. He first rose to real academic prominence in 1936, when he gave (and later published) a seminal lecture entitled Beowulf: The Monsters and the Critics. Beowulf is one of the oldest surviving works of English literature, an Anglo-Saxon epic poem from around the 8th century AD detailing the adventures of a warrior/king named Beowulf, and Tolkein’s lecture defined many contemporary thoughts about it as a work of literature.

However, there was something about Beowulf that was desperately sad to Tolkein; it was just about the only surviving piece of Old English mythology, and certainly the only one with any degree of public knowledge. Tolkein was a keen student of Germanic mythology and that of other nations, and it always pained him that his home nation had no such traditional mythology to be called upon, all the Saxon stories having been effectively wiped out with the coming of the Normans in 1066. Even our most famous ‘myths’, those of King Arthur, came from a couple of mentions in 8th century texts, and were only formalised by Normans- Sir Thomas Malory didn’t write Le Morte d’Arthur, the first full set of the Arthurian legends, until 1485, and there is plenty of evidence that he made most of it up. It never struck Tolkein as being how a myth should be; ancient, passed down father to son over innumerable generations until it became so ingrained as to be considered true. Tolkein’s response to what he saw as a lamentable gap in our heritage was decidedly pragmatic- he began building his own mythological world.

Since he was a linguistic scholar, Tolkein began by working with what he new; languages. His primary efforts were concerned with elvish, which he invented his own alphabet and grammar for and eventually developed into as deep and fully-fleshed a tongue as you could imagine. He then began experimenting with writing mythology based around the language- building a world of the Dark Ages and before that was as special, fantastical and magical as a story should be to become a fully-fledged myth (you will notice that at the start of The Lord Of The Rings, Tolkein refers to how we don’t see much of hobbits any more, implying that his world was set in the past rather than the alternate universe).

His first work in this field was the Quenta Silmarillion, a title that translates (from elvish) as “the Tale of the Silmarils”. It is a collection of stories and legends supposedly originating from the First Age of his world, although compiled by an Englishman during the Dark Ages from tales edited during the Fourth Age, after the passing of the elves. Tolkein started this work multiple times without ever finishing, and it wasn’t until long after his death that his son published The Silmarillion as a finished article.

However, Tolkein also had a family with young children, and took delight in writing stories for them. Every Christmas (he was, incidentally, a devout Catholic) he wrote letters to them from Father Christmas that took the form of short stories (again, not published until after his death), and wrote numerous other tales for them. A few of these, such as The Adventures of Tom Bombadil, either drew inspiration from or became part of his world (or ‘legendarium’, as it is also known), but he never expected any of them to become popular. And they weren’t- until he, bored out of his mind marking exam papers one day in around 1930, found a blank back page and began writing another, longer story for them, beginning with the immortal lines: “In a hole in the ground there lived a hobbit.”

This work, what would later become The Hobbit (or There and Back Again), was set in the Third Age of his legendarium and is soon to be made into a  series of three films (don’t ask me how that works, given that it’s shorter than each one of the books making up The Lord Of The Rings that each got a film to themselves, but whatever). Like his other stories, he never intended it to be much more than a diverting adventure for his children, and for 4 years after its completion in 1932 it was just that. However, Tolkein was a generous soul who would frequently lend his stories to friends, and one of those, a student named Elaine Griffiths, showed it to another friend called Susan Dagnall. Dagnall worked at the publishing company Allen & Unwin, and she was so impressed upon reading it that she showed it to Stanley Unwin. Unwin lent the book to his son Rayner to review (this was his way of earning pocket money), who described it as ‘suitable for children between the ages of 6 and 12’ (kids were clearly a lot more formal and eloquent where he grew up). Unwin published the book, and everyone loved it. It recieved many glowing reviews in an almost universally positive critical reception, and one of the first reviews came from Tolkein’s friend CS Lewis in The Times, who wrote:

The truth is that in this book a number of good things, never before united, have come together: a fund of humour, an understanding of children, and a happy fusion of the scholar’s with the poet’s grasp of mythology… The professor has the air of inventing nothing. He has studied trolls and dragons at first hand and describes them with that fidelity that is worth oceans of glib “originality.”

In many ways, that quote describes all that was great about Tolkein’s writing; an almost childish, gleeful imagination combined with the brute seriousness of his academic work, that made it feel like a very, very real fantasy world. However, this was most definitely not the end of JRR Tolkein, and since I am rapidly going over length, the rest of the story will have to wait until next time…

The End of The World

As everyone who understands the concept of buying a new calendar when the old one runs out should be aware, the world is emphatically due to not end on December 21st this year thanks to a Mayan ‘prophecy’ that basically amounts to one guy’s arm getting really tired and deciding ‘sod carving the next year in, it’s ages off anyway’. Most of you should also be aware of the kind of cosmology theories that talk about the end of the world/the sun’s expansion/the universe committing suicide that are always hastily suffixed with an ‘in 200 billion years or so’, making the point that there’s really no need to worry and that the world is probably going to be fine for the foreseeable future; or at least, that by the time anything serious does happen we’re probably not going to be in a position to complain.

However, when thinking about this, we come across a rather interesting, if slightly macabre, gap; an area nobody really wants to talk about thanks to a mixture of lack of certainty and simple fear. At some point in the future, we as a race and a culture will surely not be here. Currently, we are. Therefore, between those two points, the human race is going to die.

Now, from a purely biological perspective there is nothing especially surprising or worrying about this; species die out all the time (in fact we humans are getting so good at inadvertent mass slaughter that between 2 and 20 species are going extinct every day), and others evolve and adapt to slowly change the face of the earth. We humans and our few thousand years of existence, and especially our mere two or three thousand of organised mass society, are the merest blip in the earth’s long and varied history. But we are also unique in more ways than one; the first race to, to a very great extent, remove ourselves from the endless fight for survival and start taking control of events once so far beyond our imagination as to be put down to the work of gods. If the human race is to die, as it surely will one day, we are simply getting too smart and too good at thinking about these things for it to be the kind of gradual decline & changing of a delicate ecosystem that characterises most ‘natural’ extinctions. If we are to go down, it’s going to be big and it’s going to be VERY messy.

In short, with the world staying as it is and as it has for the past few millennia we’re not going to be dying out very soon. However, this is also not very biologically unusual, for when a species go extinct it is usually the result of either another species with which they are engaging in direct competition out-competing them and causing them to starve, or a change in environmental conditions meaning they are no longer well-adapted for the environment they find themselves in. But once again, human beings appear to be showing a semblance of being rather above this; having carved out what isn’t so much an ecological niche as a categorical redefining of the way the world works there is no other creature that could be considered our biological competitor, and the thing that has always set humans apart ecologically is our ability to adapt. From the ice ages where we hunted mammoth, to the African deserts where the San people still live in isolation, there are very few things the earth can throw at us that are beyond the wit of humanity to live through. Especially a human race that is beginning to look upon terraforming and cultured food as a pretty neat idea.

So, if our environment is going to change sufficiently for us to begin dying out, things are going to have to change not only in the extreme, but very quickly as well (well, quickly in geographical terms at least). This required pace of change limits the number of potential extinction options to a very small, select list. Most of these you could make a disaster film out of (and in most cases one has), but one that is slightly less dramatic (although they still did end up making a film about it) is global warming.

Some people are adamant that global warming is either a) a myth, b) not anything to do with human activity or c) both (which kind of seems a contradiction in terms, but hey). These people can be safely categorized under ‘don’t know what they’re *%^&ing talking about’, as any scientific explanation that covers all the available facts cannot fail to reach the conclusion that global warming not only exists, but that it’s our fault. Not only that, but it could very well genuinely screw up the world- we are used to the idea that, in the long run, somebody will sort it out, we’ll come up with a solution and it’ll all be OK, but one day we might have to come to terms with a state of affairs where the combined efforts of our entire race are simply not enough. It’s like the way cancer always happens to someone else, until one morning you find a lump. One day, we might fail to save ourselves.

The extent to which global warming looks set to screw around with our climate is currently unclear, but some potential scenarios are extreme to say the least. Nothing is ever quite going to match up to the picture portrayed in The Day After Tomorrow (for the record, the Gulf Stream will take around a decade to shut down if/when it does so), but some scenarios are pretty horrific. Some predict the flooding of vast swathes of the earth’s surface, including most of our biggest cities, whilst others predict mass desertification, a collapse of many of the ecosystems we rely on, or the polar regions swarming across Northern Europe. The prospect of the human population being decimated is a very real one.

But destroyed? Totally? After thousands of years of human society slowly getting the better of and dominating all that surrounds it? I don’t know about you, but I find that quite unlikely- at the very least, it at least seems to me like it’s going to take more than just one wave of climate change to finish us off completely. So, if climate change is unlikely to kill us, then what else is left?

Well, in rather a nice, circular fashion, cosmology may have the answer, even if we don’t some how manage to pull off a miracle and hang around long enough to let the sun’s expansion get us. We may one day be able to blast asteroids out of existence. We might be able to stop the super-volcano that is Yellowstone National Park blowing itself to smithereens when it erupts as it is due to in the not-too-distant future (we also might fail at both of those things, and let either wipe us out, but ho hum). But could we ever prevent the sun emitting a gamma ray burst at us, of a power sufficient to cause the third largest extinction in earth’s history last time it happened? Well, we’ll just have to wait and see…