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…

Advertisements

The Interesting Instrument

Music has been called the greatest thing that humans do; some are of the opinion that it, even if only in the form of songs sung around the campfire, it is the oldest example of human art. However, whilst a huge amount of music’s effect and impact can be put down to the way it is interpreted by our ears and brain (I once listened to a song comprised entirely of various elements of urban sound, each individually recorded by separate microphones and each made louder or softer in order to create a tune), to create new music and allow ourselves true creative freedom over the sounds we make requires us to make and play instruments of various kinds. And, of all the myriad of different musical instruments humankind has developed, honed and used to make prettyful noises down the years, perhaps none is as interesting to consider as the oldest and most conceptually abstract of the lot; the human voice.

To those of us not part of the musical fraternity, the idea of the voice being considered an instrument at all is a very odd one; it is used most of the time simply to communicate, and is thus perhaps unique among instruments in that its primary function is not musical. However, to consider a voice as merely an addition to a piece of music rather than being an instrumental part of it is to dismiss its importance to the sound of the piece, and as such it must be considered one by any composer or songwriter looking to produce something coherent. It is also an incredibly diverse tool at a musician’s disposal; capable of a large range of notes anyway in a competent singer, by combining the voices of different people one can produce a tonal range rivalled only by the piano, and making it the only instrument regularly used as the sole component of a musical entity (ie in a choir). Admittedly, not using it in conjunction with other instruments does rather limit what it can do without looking really stupid, but it is nonetheless a quite amazingly versatile musical tool.

The voice also has a huge advantage over every other instrument in that absolutely anyone can ‘play’ it; even people who self-confessedly ‘can’t sing’ may still find themselves mumbling their favourite tune in the shower or singing along with their iPod occasionally. Not only that, but it is the only instrument that does not require any tool in addition to the body in order to play, meaning it is carried with everyone absolutely everywhere, thus giving everybody listening to a piece of music a direct connection to it; they can sing, mumble, or even just hum along. Not only is this a wet dream from a marketer’s perspective, enabling word-of-mouth spread to increase its efficiency exponentially, but it also makes live music that other level more awesome (imagine a music festival without thousands of screaming fans belting out the lyrics) and just makes music that much more compelling and, indeed, human to listen to.

However, the main artistic reason for the fundamental musical importance of the voice has more to do with what it can convey- but to adequately explain this, I’m going to need to go off on a quite staggeringly over-optimistic detour as I try to explain, in under 500 words, the artistic point of music. Right, here we go…:

Music is, fundamentally, an art form, and thus (to a purist at least) can be said to exist for no purpose other than its own existence, and for making the world a better place for those of us lucky enough to be in it. However, art in all its forms is now an incredibly large field with literally millions of practitioners across the world, so just making something people find pretty doesn’t really cut it any more. This is why some extraordinarily gifted painters can draw something next to perfectly photo-realistic and make a couple of grand from it, whilst Damien Hirst can put a shark in some formaldehyde and sell it for a few million. What people are really interested in buying, especially when it comes to ‘modern’ art, is not the quality of brushwork or prettifulness of the final result (which are fairly common nowadays), but its meaning, its significance, what it is trying to convey; the story, theatre and uniqueness behind it all (far rarer commodities that, thanks to the simple economic law of supply and demand, are thus much more expensive).

(NB: This is not to say that I don’t think the kind of people who buy Tracy Emin pieces are rather gullible and easily led, and apparently have far more money than they do tangible grip on reality- but that’s a discussion for another time, and this is certainly how they would justify their purchases)

Thus, the real challenge to any artist worth his salt is to try and create a piece that has meaning, symbolism, and some form of emotion; and this applies to every artistic field, be it film, literature, paintings, videogames (yes, I am on that side of the argument) or, to try and wrench this post back on-topic, music. The true beauty and artistic skill of music, the key to what makes those songs that transcend mere music alone so special, lies in giving a song emotion and meaning, and in this function the voice is the perfect instrument. Other instruments can produce sweet, tortured strains capable of playing the heart strings like a violin, but virtue of being able to produce those tones in the form of language, capable of delivering an explicit message to redouble the effect of the emotional one, a song can take on another level of depth, meaning and artistry. A voice may not be the only way to make your song explicitly mean something, and quite often it’s not used in such an artistic capacity at all; but when it is used properly, it can be mighty, mighty effective.

NUMBERS

One of the most endlessly charming parts of the human experience is our capacity to see something we can’t describe and just make something up in order to do so, never mind whether it makes any sense in the long run or not. Countless examples have been demonstrated over the years, but the mother lode of such situations has to be humanity’s invention of counting.

Numbers do not, in and of themselves, exist- they are simply a construct designed by our brains to help us get around the awe-inspiring concept of the relative amounts of things. However, this hasn’t prevented this ‘neat little tool’ spiralling out of control to form the vast field that is mathematics. Once merely a diverting pastime designed to help us get more use out of our counting tools, maths (I’m British, live with the spelling) first tentatively applied itself to shapes and geometry before experimenting with trigonometry, storming onwards to algebra, turning calculus into a total mess about four nanoseconds after its discovery of something useful, before just throwing it all together into a melting point of cross-genre mayhem that eventually ended up as a field that it as close as STEM (science, technology, engineering and mathematics) gets to art, in that it has no discernible purpose other than for the sake of its own existence.

This is not to say that mathematics is not a useful field, far from it. The study of different ways of counting lead to the discovery of binary arithmetic and enabled the birth of modern computing, huge chunks of astronomy and classical scientific experiments were and are reliant on the application of geometric and trigonometric principles, mathematical modelling has allowed us to predict behaviour ranging from economics & statistics to the weather (albeit with varying degrees of accuracy) and just about every aspect of modern science and engineering is grounded in the brute logic that is core mathematics. But… well, perhaps the best way to explain where the modern science of maths has lead over the last century is to study the story of i.

One of the most basic functions we are able to perform to a number is to multiply it by something- a special case, when we multiply it by itself, is ‘squaring’ it (since a number ‘squared’ is equal to the area of a square with side lengths of that number). Naturally, there is a way of reversing this function, known as finding the square root of a number (ie square rooting the square of a number will yield the original number). However, convention dictates that a negative number squared makes a positive one, and hence there is no number squared that makes a negative and there is no such thing as the square root of a negative number, such as -1. So far, all I have done is use a very basic application of logic, something a five-year old could understand, to explain a fact about ‘real’ numbers, but maths decided that it didn’t want to not be able to square root a negative number, so had to find a way round that problem. The solution? Invent an entirely new type of number, based on the quantity i (which equals the square root of -1), with its own totally arbitrary and made up way of fitting  on a number line, and which can in no way exist in real life.

Admittedly, i has turned out to be useful. When considering electromagnetic forces, quantum physicists generally assign the electrical and magnetic components real and imaginary quantities in order to identify said different components, but its main purpose was only ever to satisfy the OCD nature of mathematicians by filling a hole in their theorems. Since then, it has just become another toy in the mathematician’s arsenal, something for them to play with, slip into inappropriate situations to try and solve abstract and largely irrelevant problems, and with which they can push the field of maths in ever more ridiculous directions.

A good example of the way mathematics has started to lose any semblance of its grip on reality concerns the most famous problem in the whole of the mathematical world- Fermat’s last theorem. Pythagoras famously used the fact that, in certain cases, a squared plus b squared equals c squared as a way of solving some basic problems of geometry, but it was never known as to whether a cubed plus b cubed could ever equal c cubed if a, b and c were whole numbers. This was also true for all other powers of a, b and c greater than 2, but in 1637 the brilliant French mathematician Pierre de Fermat claimed, in a scrawled note inside his copy of Diohantus’ Arithmetica, to have a proof for this fact ‘that is too large for this margin to contain’. This statement ensured the immortality of the puzzle, but its eventual solution (not found until 1995, leading most independent observers to conclude that Fermat must have made a mistake somewhere in his ‘marvellous proof’) took one man, Andrew Wiles, around a decade to complete. His proof involved showing that the terms involved in the theorem could be expressed in the form of an incredibly weird equation that doesn’t exist in the real world, and that all equations of this type had a counterpart equation of an equally irrelevant type. However, since the ‘Fermat equation’ was too weird to exist in the other format, it could not logically be true.

To a mathematician, this was the holy grail; not only did it finally lay to rest an ages-old riddle, but it linked two hitherto unrelated branches of algebraic mathematics by way of proving what is (now it’s been solved) known as the Taniyama-Shimura theorem. To anyone interested in the real world, this exercise made no contribution to it whatsoever- apart from satisfying a few nerds, nobody’s life was made easier by the solution, it didn’t solve any real-world problem, and it did not make the world a tangibly better place. In this respect then, it was a total waste of time.

However, despite everything I’ve just said, I’m not going to decide that all modern day mathematics is a waste of time; very few human activities ever are. Mathematics is many things; among them ridiculous, confusing, full of contradictions and potential slip-ups and, in a field whose age of winning a major prize is younger than in any other STEM field, apparently full of those likely to belittle you out of future success should you enter the world of serious academia. But, for some people, maths is just what makes the world makes sense, and at its heart that was all it was ever created to do. And if some people want their life to be all about the little symbols that make the world make sense, then well done to the world for making a place for them.

Oh, and there’s a theory doing the rounds of cosmology nowadays that reality is nothing more than a mathematical construct. Who knows in what obscure branch of reverse logarithmic integrals we’ll find answers about that one…

Freedom Bridge

I must begin today with an apology- I’m going to go on about games today SORRY DON’T RUN AWAY IT’S DIFFERENT THIS TIME! Instead of looking into gaming as a whole today I want to focus on just one game.

Before I do, I should probably give you the rundown as to what I am getting at. The majority of the population, including (and quite possibly especially) the gaming population, generally views games as a pastime- a relaxation, a release, a chance to take out some of their surplus aggression and stress on an unassuming NPC. However, some people are willing to go further, and suggesting that games be considered something special on the mass-media scale- not just another tool for making money, but a tool of expression and delivery unmatched by even TV or film. In short, some people believe that games are a unique and special form of art.

This is the subject of quite some argument among both gamers, artists and (of course, since they are never ones to let a good contentious issue go to waste) journalists, but to explain both sides of the argument would be long, tedious and biased of me. So instead I thought I would present to you a case study, an example of just what the Games Are Art crowd are going on about. I give you Freedom Bridge.

Freedom Bridge is a free-to-play online Flash game (I’ll include a link to it at the bottom). It takes all of a minute or two to play (depending on how you play it), and it’s generally about as simple as games come. You play as a single black square on a white background, able to move up, down, left or right using the arrow keys. Your movement is somewhat restricted- you cannot move up or down beyond the dimensions of the playing screen you start with, and cannot move very far to your left either. Your only choice to progress involves moving right, towards a curly line that stretches across the screen in front of you. You cannot move to either side of it- your only choice is to go straight through. As you do so, your movement instantly slows- your block is struggling to move through, and when it finally does, it is leaving a thin, sparse trail of red spots behind it. The spots are blood, and that curly line is barbed wire.

Your direction is still limited to moving right, through a large expanse of white screen broken only by you and your trail. Stopping for a while causes the spots to build up into a bigger red mass- your blood piling up. As you continue to move right, another length of barbed wire appears in front of you, and you once again have no choice but to go through it. Once again, your motion becomes painfully slow, only this time, when you’re on the other side, some of your loss of speed remains, and the trail of blood is thicker and more obvious. You may turn back if you wish, but will not find anything new- your only real choice is to press on right. All the time the sound of rushing water, playing since the start, is getting slowly louder. Another length of barbed wire appears and, beyond it, the source of the sound is revealed- a fast-flowing river, with a bridge crossing it. Once again, your sole choice is to go through the wire, and once again you are slowed still further, and your bloody trail becomes still thicker. Your movement is laboured now- but the bridge awaits. You cannot travel up or down the river, so your only choice is to cross the bridge. As you do so, your movement now slow and bloody, a shot rings out, and you disappear into a splat of blood. That’s it. The game doesn’t even fade out (well, not for a while anyway). There’s just the sight of the blood, and the sound of the flowing water.

At first glance, this barely warrants its description as a game. This is a game that makes platforming look open-world, has no levels or sub-divisions- hell, there aren’t even any characters, or clearly defined plot for that matter. There are no options, no way to win. And that is the secret to its effectiveness.

The game does, in fact, have a plot, but it’s hidden amongst the detail. Think of the title, Freedom Bridge- that bridge is the embodied representative of freedom, of escape, of liberation, whilst the barbed wire and your side of the river in general is symbolic of restraint, or oppression. Think of the wire itself- used to guard borders by oppressive regimes who don’t want their citizens leaving. This bridge could be in Korea (where it is actually based on), cold war-era Germany, Zimbabwe, wherever- it represents them all. The white landscape itself is symbolic of the bleak emptiness of the borderlands, devoid of care and emotion. Think of the way it ends- the sound of the water very gently fades out to nothing, but for a long time the scene doesn’t change (and when it does, it’s onlt for some rather poignant context). Your death doesn’t change things, doesn’t make the world a different place. The world is uncaring, you appear immaterial, and all your sacrifice has done is coloured the earth red. And then, think of the game element itself. If you were to just hold down the right arrow key, you could replicate the experience almost exactly by watching a short video. But the effectiveness of that video? About zero. The important detail is that you have a choice of how to proceed. You can, if you want, go up, or left, or down, you can try to look for the thinnest points in the wire, you can try to see if there’s another way across the river- if you wanted to, you could draw pictures with your own bloodstained trail, or even (if you had rather too much time), turn every spot of white on the map red with it. The point is that you have all this choice, unavailable if this were simply a film, but it doesn’t make a scrap of difference. No matter what you do, the game is still going to end with you as a splat of blood on that bridge. This is a game about inevitability, and whatever you do in it, you are only delaying the inevitable. Death is inevitable. For the poor soul trying to escape their oppressive regime, there is no way out- only the icy grip of death awaits them.

Without the element of choice that the game offers, this message simply cannot be delivered with the same effectiveness. The experience of it cannot be replicated by a film, or even a piece of art- this is a an experience which, when thought about, can be immensely harrowing and poignant, and yet cannot be replicated in the same way by any classical art form- only the interactivity of games allows it to be quite so special. Some people argue that this kind of experience cannot really be called a game. But even so… if the experience that delivers isn’t art, then I don’t know what is.

To play Freedom Bridge, follow this link: http://www.necessarygames.com/my-games/freedom-bridge/flash