Posted in Life & Happiness

Hidden Messages

Communication is easy on paper. We say what we think or feel, the other person hears it, and understands it. But in practice, so much can go wrong. Failure to communicate has been the cause of so much grief for people throughout history, even resulting in wars and disasters. Most importantly, poor communication is one of the greatest barriers to building a deep connection with another person.

The problem lies in the fact that despite being social animals, we are quite bad at being social. We care too much about how others may judge us, so we avoid being direct and literal when we communicate our thoughts and feelings. Instead, we choose to encrypt our messages and hope (or worse, expect) that the other person will understand the hidden meaning behind our words.

For example, instead of telling our partner that we are angry at them over something they did, we act passive-aggressively or pick a fight over an unrelated manner. Instead of speaking up about something that is unfair or unjust, we choose to stay silent and accept it to avoid conflict. We will flirt and tease with someone without telling them just how much we adore them. Instead of just saying what is on our mind, we try to package what we want to say in a cryptic form through vague, suggestive messages. Sometimes, we act out like a little boy pulling at the ponytail of a girl he likes on the playground, by sulking or being cruel to our loved ones.

Because we all tend to hide our feelings behind our words and actions, we become conditioned to try and analyse and decode messages to interpret the true meaning of what other people say. But because we are not mind readers, this often leads to misunderstandings. Instead of trying to talk openly with the person, we assume that we have unraveled their true intentions and act on it, which often leads to even more misunderstandings. In time, the relationship breaks down.

This is the reason why practising good communication is such a crucial relationship advice. Why waste our time and energy crafting delicate riddles and trying to be codebreakers, when it will only result in misunderstandings? It would be far more efficient to fight through our awkwardness and insecurities to talk about what is really on your minds.

That said, this is not a simple task and takes a lot of courage and trust. That is why the other takeaway point is how lucky it is to find someone who truly “gets you” – someone who has the patience to listen to you talk in a roundabout way, and spend the effort to try to understand what you really mean. If you find someone who knows you well enough that they can decipher your messages and actually listen to what you are really trying to say, then that is something to be grateful for.

Because the greatest gift we can receive from another person is for them to truly understand us.

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.