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 Science & Nature

Cryptography: Pigpen Cipher

Another well-known substitution cipher is the “pigpen cipher” or “Freemason’s cipher”. As the name suggests, it was often used by Freemasons to encrypt their messages. However, as time has passed, it has become so well-known that it is not a very secure cipher at all.

The pigpen cipher does not substitute the letter for another letter, but instead uses a symbol that is derived from a grid-shaped key. The key is made of two 3×3 grids (#)(one without dots, one with dots) and two 2×2 grids (X)(one without dots, one with dots). The letters are filled in systematically so that each shape represents a certain letter (e.g. v=s, >=t, <=u, ^=v)

The cipher has many variations that attempt to throw off an attacker by rearranging the order of the grids or the letters. Thus, even if a cunning attacker picks up on the fact that the cipher is a pigpen cipher, they may use the wrong key and get a completely wrong message. Nonetheless, it is a useful skill to recognise the unique symbols of the pigpen cipher as it is a popular cipher used commonly in puzzles.

As with any substitution ciphers, frequency analysis and pattern recognition is the key to cracking the pigpen cipher.

Posted in Science & Nature

Cryptography: Caesar Cipher

One of the earliest known uses of cryptography can be traced back to ancient Rome. Julius Caesar was well-known for his use of a type of substitution cipher dubbed “Caesar cipher” or “Caesar shift”. The encryption is very simple: shift every letter a certain value down the alphabet (the value is known as the key). For example, Caesar used a key of 3 to encrypt his messages to his general, so the message “ATTACK AT DAWN” would be encrypted into “DWWDFN DW GDZQ” (use the scheme of a=0, b=1, c=2, d=3…).

Although it was an efficient encryption system in ancient times, since then it has been revised to be much more secure. The Caesar cipher has thus been demoted to the preferred code used by children and teenagers for basic decoding puzzles.

Due to the simplicity of the encryption, cracking the Caesar cipher is quite easy with the use frequency analysis, pattern recognition and brute force analysis. Brute force analysis can be used if the attacker knows that a Caesar cipher has been used. If that is the case, the message can be decrypted using every possible key (e.g. 1, 2, 3…) until a message that makes sense is acquired.

Posted in Science & Nature

Cryptography: Frequency Analysis

A cipher is a message that has been encoded using a certain key. The most common and basic type of ciphers are encrypted using letter substitution, where each letter represents a different, respective letter. For example, the message may be encoded in a way so that each letter represents a letter three values before it on the alphabet (e.g. if a=0, b=1… “a” becomes “d”, “b” becomes “e” etc.). This creates a jumble of letters that appears to be indecipherable.

However, the characteristics of substitution ciphers make them the most decipherable type of encryptions. As each letter can only represent one other letter, as long as the key is cracked (i.e. what letter is what), the message and any future messages can be cracked. The most important tool in decrypting substitution ciphers is pattern recognition and frequency analysis.

Frequency analysis relies on the fact that every language has certain letters that are more used than others. In the English language, the letters that are most used, in order, are: E, T, A, O, I, N, S, H, R, D, L, U (realistically, only E, T, A, O are significant and the rest are neither reliable nor useful in frequency analysis).

For example, if Eve intercepted a long, encrypted message that she suspects to be a simple substitution cipher, she will first analyse the text for the most common letter, bigram (two letter sequence) and trigram. If she found that I is the most common single letter, XL the most common bigram and XLI the most common trigram, she can ascertain with considerable accuracy that I=e, X=t and L=h (“th” and “the” are the most common bigram and trigram respectively). Once she substitutes these letters into the cipher, she will soon discover that certain patterns arise. Eve may notice words such as “thCt” and deduce that C=a, or find familiar words and fill in the blanks in the key. The discovery of each letter leads to more patterns and the vicious cycle easily breaks the code.

Frequency analysis is extremely useful as it can be used to attack any simple substitution ciphers, even if they do not use letters. For example, in Sir Arthur Conan Doyle’s Sherlock Holmes tale The Adventure of the Dancing Men, Sherlock Holmes uses frequency analysis to interpret a cryptogram showing a string of hieroglyphs depicting dancing men.

To reinforce this weakness in substitution ciphers, many cryptographers have devised better encryption methods such as polyalphabetic substitution, where several alphabets are used (e.g. a grid of two alphabets – also called a tabula recta).

Posted in Psychology & Medicine

The Desire Of Others

This world endlessly tells us to live for the desires and wants of others. We live every day to fulfil the desire of our parents, our teachers, our friends and our lovers. But to live for other people’s desired, you must first fulfil your own desires. For our weak “self” identity to survive and develop, we cannot allow other people’s desires dominate us.

There is a mental illness called delusional disorder where the patient is obsessed about a “false belief” and is completely convinced that it is the truth. The word “delusion” brings to mind strange cases such as “I was abducted by aliens” and “the government is monitoring my phone calls”, but these delusions are more common with conditions such as schizophrenia. Instead, delusional disorder presents with delusions such as Othello syndrome (believing your spouse is having an affair) or hypochondria that are not too strange and allows for a relatively normal day-to-day life, making delusional disorder very hard to detect. Furthermore, the patients form these delusions in a very logical and highly structured manner, causing the patient to become easily obsessed with it and make the delusions more believable.

Delusional disorder can be categorised into six types:

  • Erotomanic type: delusion that someone is in love with you
  • Grandiose type: delusion that you are godlike and possess greater value, strength, intelligence or identity than others
  • Jealous type: delusion that your lover is unfaithful
  • Persecutory type: delusion that someone is acting malevolently or trying to harm you
  • Somatic type: delusion that you have a medical condition or physical defect
  • Mixed type: delusion showing characteristics of more than one of the above types, with no one type being prominent

As these patients are so attached to their delusions, treatment is extremely difficult. As soon as a psychiatrist or psychologist attempts treatment or even a close friend denies the delusion, they instantly become an “enemy”. The patient automatically incorporates those people into their delusion and antagonise them to worsen the situation. This is why the key principle of treating delusion is “do not touch the delusion”. For example, if the patient believes they are someone else, instead of negating that delusion you should give them a chance to be that person. A treatment called “psychodrama” uses impromptu acting to bypass the delusion and tries to reach the patient’s subconscious, or their “self”. Through this, one can approach the patient’s “self” via affirming their delusions, allowing the psychiatrist or psychologist to ask what the patient’s “self” wants and discover the source of the delusion. The important point is that this treatment is not an instant cure for the delusions (it takes a while for the patient to rid themselves of the delusions completely).

Delusional disorder is a phenomenon which is not uncommon in people who live for the desires of others. A perfect example would be young celebrities. If young teenagers begin life in the entertainment sector and live for the audience before they develop their own “self”, they may not be able to find answers to questions such as “who am I” and “what do I want”, ultimately causing a weakening of their identity. As the “self” is highly capable of tricking itself, it creates a delusion that can rationalise this situation and works to create a different identity.

Thus, the most important tool for surviving in this world is not money, power, wisdom or love: it is your identity and “self”. If you do not know what you truly want, then life cannot give you happiness and success.

Posted in History & Literature

Knock

The following is the world’s shortest horror story.

The last man on Earth sat alone in a room. There was a knock on the door.

Posted in Life & Happiness

The Old Man And The Horse

There once lived an old man in northern China who was a great fortune teller. One day, his horse ran away to the land of the savages. The villagers all gave the old man their condolences, but the old man said without a hint of sorrow:

“Who knows? This may bring good fortune.”

A few months later, the horse came back with the fastest horse of the savages. When the villagers praised the old man, he said without a shred of joy:

“Who knows? This may bring bad fortune.”

Then one day, the old man’s son who loved horse riding fell off the savage’s horse and broke his leg. When the villagers tried to cheer him up, the old man replied in a calm manner:

“Who knows? This may bring good fortune.”

A year later, when the savages attacked the village, all of the young men had to fight them and ultimately died during battle. But the old man’s son survived as he was lame.

Nothing in life is certain. Good and bad, luck and misfortune come in random order in life and cannot be predicted. Thus, it is wiser to enjoy every day as it is, throw away all of your preconceptions of the future and dream and hope for the best.

Posted in Psychology & Medicine

Pleasure Centre

During the 1950’s when the field of neuroscience was making many research breakthroughs, a fascinating fact was discovered. Scientists had located the specific part of the brain responsible for feeling pleasure. In 1954, two Canadian neuroscientists named James Olds and Peter Milner were undertaking research to find the association between electrical stimulation of the brain and sensation in rodents. During their research, they found that if they stimulated a certain part of the brain, the rats would interpret the signal as pleasure. Based on this, they inserted electrodes into the rats’ limbic system (the part responsible for emotions) and connected it to a lever in the cage. Thus, they had devised a device that allowed the rat to feel pleasure by stimulating its own brain with the press of a lever. The results were astounding. The rat furiously pumped at the lever, forgetting to eat or sleep, until it ultimately died of exhaustion (over 26 hours, the rat pressed the lever 50,000 times).

Pleasure is not the same as happiness. Happiness awards us with satisfaction and contentment, but pleasure only brings greed, obsession and addiction. Pleasure was originally a mechanism devised to reward behaviour that aided survival (such as mating and eating), but addictive things like alcohol, smoking and drugs ruin your life and any chance at happiness instead of helping you survive.

The foolish run around to seek temporary pleasure while the wise seek permanent happiness.

Posted in Philosophy

Curvy And Straight

A natural world is a world of curved lines while a man-made one is a world of straight lines.

Mountains, trees, valleys, rivers, rocks… all of these have curved edges.
Apartments, buildings, desks, cellphones… everything in a city has straight edges.

Those with life are curved and those that are dead are straight.
But whether it be a city or the countryside, a person is curved.

We are still nature.

Posted in History & Literature

Taegeukgi

The Taegeukgi is the official flag of the Republic of Korea. It was chosen as the official flag of Joseon by Emperor Gojong in 1883 and has been used as the flag for South Korea since 1948. The Taegeukgi is an extremely symbolic flag that expresses the values and ideals of the Korean people while also containing the sorrow caused by the great tragedies in modern Korean history: the 36 years of Japanese colonisation and the Korean War. Even before Korea was founded, the flag was used in protest of the Japanese Empire and for the independence of Korea (especially in the famous March 1st movement). Much like Hangul (the Korean alphabet), the Taegeukgi, designed by Park Young-hyo and commissioned by Gojong, is a very scientific and mathematical flag. Let us analyse each part of the Taegeukgi.

The Taegeukgi is composed of a red and blue taegeuk symbol (“yin(eum)-yang symbol” is technically a misnomer) on a white background, surrounded by four black trigrams (4괘, sa-gwe). The white background symbolises brilliance and purity and the Korean people’s traditional love for peace. The taegeuk symbol symbolises the harmony of eum (blue) and yang (red), an imagery of the interaction between the two extremes and the natural rule of continuous generation and progress seen in the universe.

The trigrams in each of the four corners is called geun gon ri gam (건곤리감, 乾坤離坎) in order and each trigram symbolises a certain characteristic of everything in the universe.

Geun (three lines) symbolises the sky, spring, metal (geum, 금, 金) and humanity (yin, 인, 仁). Gon (six lines) symbolises the earth, summer, earth (toh, 토, 土) and righteousness (eui, 의, 義). Ri (four lines) symbolises the sun, autumn, fire (hwa, 화, 火) and courtesy (ye, 예, 禮). Gam (five lines) symbolises the moon, winter, water (su, 수, 水) and intelligence (ji, 지, 智). The taegeuk lies in the centre of the four extremes in each each corner to establish an infinite harmony and balance.

As you can see, the taegeuk is far more scientific and deeply philosophical than simpler flags such as those symbolising the Sun God (Japan), the number of states (USA) or a composite of three different flags (UK). It is the ultimate flag that prides the Korean people’s wisdom and advanced culture.