Anyone who was paying attention during the previous section will have realised that both the methods of cracking the message relied on the key being substaancially shorter than the message. This is true and leads us to a method of encryption called the one time pad. This, I believe, is the only method of encryption that has been proved to be impossible to crack and it is very simple: generate a key longer than the message and combine the two using a 1-1 function. It doesn't matter how simple our function is - since knowing it's inverse doesn't help.
Okay, it's slightly more complex than that. In order to ensure that it is impoosible to crack the message we must guarantee that the key is entirely unpredicatable at every stage (i.e. entirely random) and the the encoded message is also statisically indistingushable from random `noise'. This is actually harder than it sounds, for large messages it is quite difficult to find anything with enough entropy to create an entirely random key. Having said that, this isn't the biggest problem with the one time pad. The big problem is that we need to have a secure data channel over which we can send the key. We have to transfer as much, if not more, data over this secure channel (i.e. the key itself) than we do over the insecure channel that we are sending the message over. This is clearly silly so we will stop and look at what we really want to use our code for.