Contributing Authors

Each month a number of articles will apear here.

Daniel Saunders-Quantum Cryptography 

Quantum Cryptography

The race between Cryptographers and Cryptanalysts


There is currently an intense race between code-makers, the cryptographers, and their rival code-breakers, the cryptanalysts. As the dawn of the quantum computer approaches, all current and past mass-used cryptography techniques will be rendered useless. The burden is now on the cryptographer to develop new techniques, based on the laws of quantum mechanics, to maintain the level of security mankind has sought, enjoyed and become dependent upon.

Alice, Bob and Eve
By convention in cryptography we imagine three fictional characters - Alice, Bob and Eve (many cryptography techniques can be described using analogies with these characters). Alice is attempting to send a message securely to Bob, but Eve (the eavesdropper) can intercept this message. The main aim of cryptography is to ensure that even if Eve can intercept the message, it is of no use to her, so the message remains secure.
Many current and past techniques such as the ‘Caesar shift’, ‘Substitution Ciphers’ (variations of the Caesar shift using a key), the ‘Vigenére Cipher’, and even the ‘Enigma machine’ involve substitution of the message’s alphabet with one or more cipher-alphabets. In the case of the Caesar shift, each letter of the alphabet is substituted with another that is shifted down by a fixed number of places (this only offers 26 possible cipher-alphabets). Substitution Ciphers start the cipher-alphabet with a key or key-phrase (see image below), which can increase the number of possible cipher alphabets to over 400 trillion trillion [1]! The ‘Vigenére Cipher’ has increased security again by using up to 26 cipher-alphabets, and the enigma machine has the potential to cycle through trillions of cipher-alphabets for a message (had the Germans used the enigma machine more efficiently, the Enigma would have been unbreakable). However, Enigma machine aside, all these methods can be broken using simple frequency analysis of the encoded message. Any alphabet has certain letters which are more popular than others; for example in English, the letter ‘e’ is the most popular, followed by ‘s’, so it’s likely the most popular letters used in an encoded message is either an ‘e’ or an ‘s’. In cases such as the Vigenére Cipher, where several cipher-alphabets are used periodically, the same frequency analysis can be applied once the letters of each cipher-alphabet have been collected (every nth letter belongs to the same cipher-alphabet based on a key n letters long).

An example of a substitution cipher with key ‘A Brown Fox’. NB1: the ‘o’ is not repeated a second time, and at the end of the key, the alphabet continues filling in all the other letters. NB2: Even in the short message, the letters ‘P’ and ‘W’ are the most frequency (which correspond to ‘s’ and ‘e’).

The Enigma machine is far more difficult to decipher given the vast number of cipher-alphabets used in any message, but there are other techniques to break it. The Enigma machine operates by a set of initial conditions, such as electrical cable connections, which were often included at the start of the message, and knowing these settings drastically reduces the number of possible cipher-alphabets. Also, certain messages such as the weather broadcast (transmitted at a unique time of day) followed a consistent layout, such as starting with the word ‘Weather’, which gave hints to the settings of the Enigma machine. In fact, after the end of WW2, having cracked the Enigma the British attempted to sell on the captured enigma machines pronouncing the Germans swore by them [1].

The Enigma machine. The three cogs and cable positions, which were aligned according to a manual distributed through the German forces, cycled through several cipher alphabets per message.

There is another method of cryptography that can be proven to be unbreakable, which does not require the periodic use of cipher alphabets or initial conditions of hardware, called the ‘One-Time Pad’. The idea is to use a different substitution for each letter based on other literature or random events. This has the advantage of not having a cipher alphabet that is repeated; thus it is immune to frequency analysis. In the same way the Vigenére Cipher uses 26 cipher-alphabets (based on 26 Caesar shifts), an agreed text (the pad) is chosen between Alice and Bob, and each letter in a message is substituted using a Caesar shift based on a letter in the pad. Often texts such as the Bible or Road maps are used as pads. This method can be improved if the pad is based on a random event, such as the radiation count from a Geiger counter. Given the pad does not repeat a cipher alphabet periodically; a brute force method would never work, as it would return every possible combination of letters the length of the message. Brute force methods by guessing could return anything from the actual message, to an extract from Shakespeare, part of this article, or works of literature not yet written!
This introduces another flaw with these cryptography methods – if Alice uses a key or pad to encrypt her message, Bob must also know this key or have a copy in order to decode the message, which must be kept secret from Eve. This can be likened to an analogy where Alice sends a package to Bob that is padlocked, and both Alice and Bob have keys to this padlock. However, this would require the secure sending of the key before hand, and as seen it’s extremely difficult to send anything using techniques described above. In the sixties, when cryptography was becoming popular in the business world, businessmen would often be seen carrying suitcases handcuffed to themselves from one building to another around cities containing keys to ciphers. The solution to this problem can be understood with a similar analogy to above. This time Alice sends the package with her padlock to Bob, who then adds his own padlock to the package, and then returns it to Alice. Alice then removes her own padlock, sends it back to Bob, who can then open the package with his key. In this circumstance, neither Alice nor Bob have had to share any keys, and the package has remained secure. This is known as ‘public-key cryptography’ or an ‘asymmetric’ system. Taking the analogy into codes is difficult, but the same principles apply. Most e-commerce and mass used cryptography methods used in the world today are based on public-key cryptography. Bob has a numerical ‘public-key’, which is a one-way function, and is known by everyone including Alice and Eve. If Alice wants to encrypt something, she does so using Bob’s public-key, then sends it back to Bob who can decrypt it using another one way function called the ‘private-key’. When dealing with computers and codes, we can think of this mathematically. The functions involved are factors of prime numbers. Bob chooses two prime numbers (the private key) and multiplies them together (giving the public key). To decipher the encrypted message, Bob uses the private key (the two original prime numbers), which only he knows. From Eve’s perspective, she needs to find the two original factors of the public key, which if large enough (e.g. 10150) could take up to fifty years to calculate with a computer!

Quantum Computers
So far, a brute force method of guessing a cipher-alphabet or key to break these ciphers seems unrealistic (e.g. up to fifty years). Substitution and public-key cryptography techniques both offer trillions and trillions of cipher-alphabets or public-keys; however a brute force approach is becoming possible via the use of quantum computers. In brief, a quantum computer works using quantum uncertainties. In quantum mechanics, a quantity is all possible values at one time until measured. This is the same as the famous example of Schrödinger’s cat being both dead and alive at the same time in the sealed box. The quantity that a quantum computer measures is called the ‘spin’ of a particle. Electrons can spin in one of two ways, which can be thought of as easterly or westerly. Until measured, the particles are spinning in both directions at once. If we now imagine representing a letter in binary (seven 1’s or 0’s) by the spin of electrons, there are 128 orientations of the particles (128 ways to order seven 1’s or 0’s). In a quantum computer, until measured, the seven particles represent all of the 128 orientations at any time – thus for seven particles, one operation can actually be 128 combinations at once! If we were to increase the number of particles from 7 to 250, we find one operation can be around 1075 combinations at once. If we think of each operation as an attempt to break a substitution cipher or to factor a public key, the amount of time to try each possibility is reduced significantly, and a brute force method is very realistic! This means cryptographers are racing against the birth of the quantum computer to find a new cipher which is immune to the quantum computer [1].


Quantum Cryptography
This new cipher is actually based on the one-time pad system [2], which we know can be unbreakable if the pad is truly random, and not known by Eve. Thus, this cipher requires a technique to send a one-time pad securely, such that eve cannot use the message. This cipher relies on the difficulty of measuring the polarization of light. Polarization describes the direction of oscillations of a wave. There is a quantum mechanical effect, such that measuring diagonally oriented light is extremely difficult. It can be shown mathematically that half of diagonally polarized photons will be measured as vertically polarized, and the other half measured as horizontally polarized. In binary language, we’ll call vertically polarized light 1’s, and horizontally polarized light 0’s.

An example of the quantum cipher based on the polarization of light. NB1: occasions where Bob used the wrong detector are discarded despite sometimes being the correct measurement [4].

Alice can send Bob the content of the one-time pad in the following way. Alice sends the sequence of letters in binary language via the orientation of the light waves (see image above). Bob has a choice of two detectors, one that can detect horizontal or vertical light (a + shape), and one where he can detect diagonal light (an x shape). For each detector there are two possible measurements. Given bob doesn’t know what order to use his detectors, he chooses randomly. Bob will then measure the orientation of the light – some measurements will be correct and some will be incorrect based on the choice of his detector. He then telephones Alice (insecurely) and checks the order which he used his detectors. On occasions where Bob used a correct detector, he will have measured a 1 or a 0, and the occasions where he used the wrong detector are discarded. Even if Eve intercepted this call, she still does not know the orientation of the light, only the orientation of the detectors (for which there are two possible measurements). So Alice has sent pieces of information to Bob; Bob and Alice have discarded the incorrectly measured pieces, and now have a sequence of 1’s and 0’s which are now only known by Alice and Bob, and can form a one-time pad. Even if Eve intercepted the light, she would have to measure the polarization of the light, and retransmit the light to Bob. However, as we have seen, Eve has no way to measure the light correctly without discarding some of the information, and therefore has no way to forward the message on to Bob without changing the message. Once Bob realises the message has been tampered with (when comparing his orientations with Alice’s) they can discard the tampered message.
This method of Cryptography is truly unbreakable, and has been performed in the laboratory. In fact, many papers have been written describing ‘off the shelf’ methods of quantum cryptography based on the polarization of light [3]. However, widespread implementation is still far off, and not cost effective, thus describing the race between cryptographers and cryptanalysts. Can cryptographers implement an effective method of quantum cryptography before the invention of the quantum computer?

References
1. Simon Singh (2000) The Code Book.
2. David Race (2010) Quantum Cryptography and Relativity.
3. Joanna Duligall (2007) Compact and Low-cost Quantum Cryptography.
4. Against the modern world - blog

Daniel Saunders.



The Statistics of Emotions

wefeelfine.org
In the time it takes to read this article, around 3 million bananas will be eaten, where around 35 bananas are eaten in America for every 1 banana in China [1].
I think statistics is amazing. I know it’s a curse among millions of A-level students (though still statistically higher scoring than mechanics), but it plays a vital role in all sciences; be it Astrophysics and Quantum Theory, through to applications in Medicine and Evolutionary Biology. This article outlines the recent work conducted by Stanford University, who have developed software to scan social networking sites, including twitter and many blogs, in an ‘exploration of human emotion on a global scale’ [2]. Using statistics, and the massive amount of data online, Stanford University is on a mission to statistically analyze what it means to be human.


Background

the happiest time of day is lunchtime, and the most relaxed day is Wednesday

The study of statistics has played a massive role in our history. It’s an elegant, unprejudiced, and simplistic way to describe some of the most complex and even random systems. This is surprising given that the use of statistics is a more modern tool than people appreciate. One of the earliest uses of statistics was in healthcare, advocated by Florence Nightingale - now best known as the founder of modern nursing - in the nineteenth century. With statistics, she was able to prove that unhygienic hospitals had an up to twenty-fold increase in mortality rates when compared with more hygienic military camps. This statistical evidence led to a revolution in health care, most noticeably in the army, who established an Army Medical School to monitor the effectiveness of treatments and conditions in army hospitals [3]. At the other end of the scale, statistics has been used extensively in Cosmology and Astrophysics. It’s the random fluctuations in the early (tiny) universe, which can be analyzed statistically, that have allowed the formation of the structure visible in the universe today.
Fluctuations are also how supermarkets can offer value or basics in their food range – if a supermarket bakes crumpets, statistics show that a certain proportion will be too big or too small (around one third would be beyond the standard deviation) - so to avoid waste and loss, they get sold as basics and labeled ‘just all different sizes’.


wefeelfine.org

A screenshot of the variables the user can choose to look for trends. The website will return the most common emotions for these factors, and whether they are significantly higher than the average.

As we go into the 2010’s, there is a staggering amount of data available to us online (Google can tell you how many banana’s are eaten per hour and where!). Stanford University has setup wefeelfine.org, which scans thousands of blogs and tweets every day, searching for sentences starting with “I feel” or “I am feeling” and catalogues the feelings into a massive database. Around 20 thousand emotions are added every day to the database, and since the website began in 2005, around 13 million emotions have been recorded. The results are fascinating to analyze. The most common emotions can be ‘better’, ‘bad’, ‘good’, ‘right’, ‘guilty’, through to less common emotions such as ‘uncertain’ or ‘shaky’ [1].
Given blogs are fairly similar and have public access, the database can record factors such as gender, age and location. The website allows the user to factor in such variables (see screenshot above) and look for trends. The database can also record variables independent of the user’s information, such as the weather at the location. There are also many ways to display the data collected from the blogs and tweets. The user can view the emotions as a cascade; or a collection of the more common emotions; or as a montage; or in mobs (bar charts). As part of this interface, the user can search for very specific trends, such as weather with the emotion ‘depressed’. As an example, the website has analyzed Valentines Day for the past 2 years, and has proved people feel more loved (double the average), but also more lonely (triple the average). Similar analysis shows that on Obama’s election day, Americans on average felt a peak of pride and excitement, which continued for the weeks following his election [4].

The frequency of ‘depressed’ in tweets and blogs is 1.2 times the average value when its raining, compared with 0.9 times the average when sunny.



Some Interesting Results
As a summary of the websites findings, Stanford University created an emotional graph, of which a large part is shown below. The size of each emotion denotes its frequency. The graph shows connections between emotions often expressed in the same sentence. It is noted that emptiness and frustration seem like emotional islands, as well as appreciation and awkwardness. There is also a large amount of evidence to suggest people get happier when they get older, but for different reasons. When younger, people are happy because of excitement, whereas when older, people are happier when at peace.

The emotional graph created by Stanford University

Many trends the website has noticed are not necessarily intuitive. It can be demonstrated that women feel more loved than men, but also feel guiltier; whereas men often feel happier, yet lonelier. It’s also noted that women are more open about their emotions online, but men are more likely to post more than one emotion at any time [3]. Some trends can be time dependent. Statistically, the happiest time of day is lunchtime, and the most relaxed day is Wednesday; but data also suggest Wednesday is also the most stressful day (this does seem contradictory, however it may be understood if posts include both emotions, such as “I’ve felt stressed today, now its time to relax”). The website can also record the cause of an emotion if its also posted in the blog or tweet. Some strong correlations include guilt by money (in all senses), jealousy by romance, and depression by ‘no apparent reason’ [5]. It should be noted this article has commented on the most significant results – given the massive number of variables, there are many other trends and some could be coincidence or chance.
This is an excellent example of how powerful statistics can be, and also the power of displaying the vast amount of data available to us in a clever, meaningful and intuitive way. This also shows how statistics could change science. Previously, the scientific method would be to conceive a theory that agrees with current observations, and suggest further observations to test that theory. This method could now get reversed. Computers could finds trends normally predicted by a theory, and the theory could be suggested afterward. However, this can be dangerous. As an example, after the Second World War pregnancies increased dramatically, as did the import of apples; so statistically, it could be reasonable to suggest a higher consumption of apples increases fertility! This is a good example of confusion between cause and effect, which can be flaws in computer models.


References:
1. Hans Rosling, ‘The Joy of Statistics’, BBC 4, 2010.
2. wefeelfine.org
3. Simon Singh and Edzard Ernst, ‘Trick or Treatment: Alternative medicine on trial’, Corgi, May 2009.
4. Sepandar Kamvar & Jonathan Harris, ‘We Feel Fine and the Emotional Web’
5. Sepandar Kamvar & Jonathan Harris ‘We feel fine – An Alamanac of Human Evolution’, Scribner Dec 2009

By Daniel Saunders.