Posted in Science & Nature

Cryptography: Vigenere Cipher

It has thus been proven that the Caesar cipher, the pigpen cipher and any substitution cipher can be simply broken using frequency analysis. The basis for this is that each letter or symbol can only represent a single letter, meaning that letter frequencies (e, t, a, o…) are directly translated onto the cipher language. Ergo, by making each letter represent more than one letter, the letter frequencies can be masked and an additional level of security can be added to the cipher. This is called polyalphabetic substitution and it is the basis for a type of cipher known as the Vigenère cipher.

The cipher was first conceived in 1553 by Giovan Battista Bellaso and has been improved since. It is famous for being rather simple to use despite the difficult to decipher it at a beginner’s level. This trait earned the cipher the nickname “le chiffre indéchiffrable”, which is French for “the indecipherable cipher”.

The Vigenère cipher can be thought of a stack of Caesar ciphers (essentially a cipher within a cipher), where each letter is shifted by a variable key (in a normal Caesar shift, every letter is shifted by the same key). This is achieved by the implementation of a keyword and a table called a tabula recta. A tabula recta is simply a grid made from 26 rows of the alphabet, each row of which is made by shifting the previous one to the left. This table essentially shows all the possible outcomes of a Caesar shift.

Now, let us try encoding a message using the Vigenère cipher. The message “attack at dawn” is encoded using the keyword “nothing”. Ideally, there should be no repeating letters in the keyword for the sake of security. Therefore, if there are any repeating letters, just remove the repeated letters (e.g. “crocodile” -> “crodile”). First, repeat the keyword until it matches the number of letters of the message (e.g. “attackatdawn” is aligned with “nothingnothi”). Then, use the tabula recta to encrypt the message. The rule of thumb is “key-row, message-column”, meaning that the row of the tabula recta starting with the letter of the key is matched against the column starting with the respective letter of the message. To take the first letter as an example, the key letter is “n” and the message letter is “a”. The letter corresponding to where the “n” row and “a” column meets is “N”. If this rule is followed for each letter, the encrypted message becomes: “NHMHKXGGRTDV”. Although it takes some effort to find each letter on the table, the message becomes “indecipherable” to a beginner cryptanalyst as frequency analysis becomes useless. For example, the repeating letter “H” can represent either “t” or “a”. The longer the keyword is, the more secure the Vigenère cipher becomes.

However, the Vigenère cipher is not indecipherable. Next, we will look at a cryptanalysis method called the Kasiski examination that attacks a polyalphabetic cipher such as the Vigenère cipher to gain access to the keyword.

Posted in Psychology & Medicine, Special Long Essays

Lucid Dream

Dreams are wonderful things. Within a dream, nothing is impossible and the mind unleashes its full potential creativity. Is there a way to harness such power? The short answer is: yes.

Lucid dreams are defined as the state of being aware that you are in a dream. This means that unlike normal dreams, you know that you are dreaming. Although this may sound easy, it is quite hard to enter and stay in a lucid dream. Many people experience a lucid dream a few times in their life, but tend to pass it off as a normal dream or some paranormal event (many “out-of-body” experiences can be explained as lucid dreams).

The major difference between a normal dream and a lucid dream is the ability to control your dream. This concept is explored in detail in the movie Inception, where characters utilise the creative power of dreamspace, tricking the victim that they are in reality to manipulate information out of them. Inception is actually a great example of what a lucid dream is like: the architect can manipulate the dreamspace to her wishes, even going as far as ignoring the laws of physics and conjuring objects out of nothing. This ability is not exclusive to movies – you too can exert this power within your own dreams, every night.

The most important point to remember is that lucid dreams are based on memory. Reason being, if you cannot remember the dream, then it might as well not have happened. Also, you need the ability to distinguish a dream from reality, as otherwise it will pass you by without you realising. There are a few tips and tricks that can help the induction of a lucid dream.

Firstly, keep a dream diary – a record of every dream you have in excruciating detail. This not only trains your ability to remember dreams in detail, but also lets you prepare for when a lucid dream comes. So every morning when you wake up, record whatever you can remember from the night’s dream. Many people complain that they never dream, but this is false – they are merely forgetting it. After keeping a dream diary for at least a couple weeks, you will find that the frequency of dreams increase dramatically, with increasing creativity.

Secondly, look for dream signs. You will notice from your dream diary that certain things appear often in your dreams. This may be a certain person, an impossible object (such as the staircase from Inception), meeting a deceased person or something happening (e.g. falling). A classic example is a clock. In a dream, when you look at a clock (preferably digital) and blink, time suddenly leaps around, such as 3pm suddenly becoming 6pm. Looking for these signs in your surrounding can easily alert you to the fact that you are dreaming.

Lastly, do reality checks as often as possible. These are actions that confirm that you are in reality, or conversely if the check fails, that you are dreaming. Reality checks are represented as totems in Inception, and although the risk of “getting lost in a dream” is close to nothing in a lucid dream, it is an extremely useful tool. Reality checks (RC) are based on the fact that the laws of reality do not function in dreams. For example, a common RC is bending your fingers backwards. In real life, your fingers will only go back so far. In a dream, the fingers can touch the back of your hand: a definitive proof that you are not in reality. Other examples include breathing through a pinched nose, pinching yourself (no sensation in a dream) and… anything creative actually. The general rule is: “habituate what is not your habit” – i.e. make a habit of something that is not usually your habit, so you can do it in a dream as a RC.

After a few weeks practising using the above skills, prepare your mind for a lucid dream. Every night before going to sleep, keep thinking “I will dream” or “I will stay awake in my dream”. Continuous reinforcement directly increases your chance of “waking up” in your dream, and allows you to begin your journey into lucid dreams.

As mentioned above, within a dream, you have almost godly powers as you can manipulate the entire dreamspace to your will. However, there is a catch: you have to control the dreamspace. This may sound absurd, but it will be relevant when you have your first lucid dream. Dreams are like wild mustangs – they will spiral out of control as soon as you try to take control. For instance, a novice lucid dreamer (or, in Greek, oneironaut) will find that as soon as they acknowledge that they are in a dream, they will instantly wake up. This is a form of defence mechanism as the boundary of reality and dream is faded, causing your brain to become confused.

There are methods to help your stay in dreamstate. It has been suggested that when you notice signs of waking up (e.g. the surroundings become blurred and slowly disappear), spinning on the spot can prolong the dreamstate. Rubbing your hands together also helps. The duration you stay in the dream becomes longer as you become more proficient in lucid dreaming.

This is only the first step. The more you manipulate your dream, the more your brain will “reject” your dream-self. Again, this is seen in Inception (it is actually quite an accurate depiction of lucid dreaming). You will find that through practice, you not only lengthen your lucid dream, but also increase the power to manipulate things. In the advanced stage, you will not only be able to completely recreate the world around you, but also achieve flying and the ability to summon people.

A final point to learn about lucid dreaming is that there are two ways into a lucid dream: DILD and WILD.
The first, and the most common, type is Dream-Induced Lucid Dream. This is by far the easiest method. In DILD, you “wake up”, or become self-aware, in a dream and then continue to dream the same dream (except now it is lucid). It is easier to achieve this during a nap or when you go back to sleep after waking up in the middle of the night.

The second, and more advanced method, is the Wake-Induced Lucid Dream. WILD is when a lucid dreamer can go straight into a lucid dream from a state of alertness. This lets you enter a lucid dream anytime at will, and can be more powerful than a DILD. However, there is a catch. WILD easily induces sleep paralysis (see Sleep Paralysis) due to the forced induction of REM paralysis. This can be a horrifying experience for the unprepared, especially due to the nightmarish hallucinations it brings. But after practice and the correct mindset, you can easily vanquish this state with willpower, and freely enter a lucid dream. Sleep paralysis should not deter you from attempting lucid dreaming, for it is only a temporary side effect.

Lucid dreaming is one of the most useful skills one can learn. Not only does it let you explore your mind freely, you can go deeper to discover your subconscious (often through imagery), solve complex problems you couldn’t in real life and relieve the stress built up from reality. An interesting feature about dreams is that time is completely relative; this means you will enjoy a lengthy dream much longer than your actual sleep, giving you a better rested sleep. If you are lucky, you may even enjoy the delightful experience of a “dream within a dream” (or go even deeper).

Oneironauts, dream on.

Posted in Philosophy

Butterfly Dream

Zhuangzi was a philosopher whose writings are still famous for their deep and influential thoughts. The following is one of the most famous stories he tells, questioning the concept of reality and mind:

One day I dreamt that I was a butterfly, flying freely and doing what I pleased, without knowing that I was Zhuangzi.
But when I woke up, I was Zhuangzi without a doubt.
So did Zhuangzi dream of being a butterfly, or am I a butterfly dreaming of being Zhuangzi?