Posted in Science & Nature

Clarke’s Three Laws Of Prediction

The following are three laws conjectured by acclaimed science fiction author, Arthur C. Clarke, regarding predicting the future.

  1. When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
  2. The only way of discovering the limits of the possible is to venture a little way past them into the impossible.
  3. Any sufficiently advanced technology is indistinguishable from magic.

Posted in Science & Nature

History Of The Earth

The Earth has been around for a good 4.6 billion years. Let us compress the long time from the Earth’s birth to today (2012) into one year to put everything in perspective.

The Earth’s history starts on January 1, 00:00:00. The Earth is a hard sphere, barren as any other planet. Incessant wind and rain erode away the barren mountains and tectonic forces create new ones. Nothing much happens for the next three months. Then, around the start of April, life begins in the form of bacteria. Over the course of the next few months, the bacteria divide and mutate, slowly forming new life forms that are multicellular. However, all life on Earth are still in the oceans.

Life on land only starts in the end of November, when plants begin to settle on land. Plants expertly take the abundant carbon dioxide in the atmosphere and convert it into oxygen. By early December, the oceans are teeming with fish, some of which adapt to living on land by developing lungs. These become the first amphibians. Insects also populate the land and become one of the most diverse types of life.

In December 12, reptiles evolve and the land is ruled by dinosaurs, but only for 9 days until they are wiped off the face of the Earth by a meteorite on December 20. Mammals quickly take the niche left by dinosaurs, populating the entire world. Even at this late time, there are no signs of humans.

December 31, humans have still not arrived on Earth. They only appear around 8pm, where the first hominids venture on to the plains of Africa. At 10pm, the Ice Age begins and the Earth is covered by a thick white sheet of ice. The ice comes and goes three more times. At 11:59pm, human civilisation begins as cities begin to rise. 22 seconds before the end of the year, the Egyptians build their pyramids. More monuments arise within seconds. At 11:59:47pm, Jesus teaches the people to love one another, until he is killed a millisecond later. In the last second of the year (about 150 years), humanity: has two major world wars, take to the skies, create the nuclear bomb that can wipe out all life on Earth and even step foot on the Moon.

We may like to think that we have made a significant impact in the history of the Earth, but we have only existed for an infinitesimally small fraction of the history. We are but a dot on the grand scheme of natural history.

Posted in Science & Nature

Slavemaker Ant

Slavery is considered one of the most inhumane acts in humanity’s history, where a group of people enslave another group of people to do their bidding in harsh conditions. Slavery is an interesting concept as at the cost of other members of your species, you can greatly increase the productivity of your own society. Some may argue that only humans are evil enough to enslave their own kind, but there is one other species that enslaves other animals: ants.

Certain species of ants, known as slavemaker ants, are known to enslave entire ant colonies to do the bidding of their own colony. The way slavemaker ants enslave colonies is as follows. First, a pregnant queen ant lies in front of an enemy nest after mating and feigns death. Scouts from the nest carry the “body” back to their queen so that she may devour the fallen enemy. When the two queens are left in the same room, the queen slavemaker ant springs back to life and proceeds to eviscerate the other queen ant. She then rolls around in her remains to coat herself in pheromones – the substance through which ants identify each other. The ants of the colony now believe the queen to be their own queen and serve her and her eggs. When the brood fully matures (only soldier ants), they swiftly overrun the nest and completely enslave the colony, forcing them to fill the role of the worker ants, which the slavemaker ants lack.

Eventually, the original slaves die out and the colony becomes short on worker ants (as the queen only produces soldier ants). To overcome this issue, the colony sends out massive raiding parties to attack other colonies, after which the ants steal the eggs and larvae of the captured colony to breed them into new slaves. Interestingly, it has been observed that slavemaker ants tend to attack the most defended nests, knowing that they contain the most eggs and larvae. There are variations on how the army attacks and raids a colony depending on the species. Some choose to launch a full-on assault, decimating the colony and leaving only the eggs and larvae. Some secrete chemical gases that force the colony to evacuate, leaving their young behind in the rush. In some cases, a fertilised queen ant will sneak into a raid and kill the queen ant in the midst of the battle, commandeering whatever is left of the colony following the raid.

One difference between human and ant slavery is that slave ants are not aware they are slaves. Since they have been brought up since birth to work for the colony, they simply believe that they are worker ants birthed by the queen. Thus, they have no objections to serving the colony as to them they are merely fulfiling their objectives. 

This type of interaction between species is known as social parasitism, where one group benefits and survives at the cost of another group. Interestingly, “parasitism” also suggests that slavemaker ants cannot survive without their host. The reason being, slavemaker ants are so specialised in infiltrating and raiding other colonies that they cannot feed themselves or construct a colony by themselves. Even their mandibles are evolved into perfect killing machines, so much that they cannot use it to feed (slave ants have to feed them). In some cases, it has even been observed that slave ants had to carry their masters from one colony to another.

Slavemaker ants enslave not because they are tough or superior, but because they are desperate and have adapted to this unique form of surviving. Thus, if there was an Abraham Lincoln ant, he would certainly kill his colony within one generation.

Posted in Science & Nature

Goldilocks

In the children’s story Goldilocks and the Three Bears, the protagonist is found trying out various porridges, chairs and beds until she finds the one that is just right for her. Because of this, the name “Goldilocks” has become a symbol for something that is “just right”. A Goldilocks economy is one where there is high growth but no inflation; a Goldilocks planet is one which is not too hot or too cold, making it an ideal planet for life; the Goldilocks effect is when success is achieved because something was not too great or too little.

The Goldilocks effect is a law of nature that is far more important than you would think. Nature always seeks consistency, as shown in the human body. For something as complex as life to exist, a cell must maintain its internal environment in a perfect, ideal state. French physiologist Claude Bernard observed that a cell’s internal environment does not change even with changes in the external environment, and commented that “The stability of the internal environment is the condition for the free and independent life”. This is the basis for homeostasis. Without homeostasis, life cannot exist and all living things put in all their effort in keeping homeostasis. Our body constantly strives to keep various factors such as pulse, blood pressure, oxygen saturation, temperature, blood glucose, electrolytes and numerous hormones etcetera in a stable range. One could possibly argue that the meaning of life is “to maintain homeostasis” – a rather cyclical argument.

To understand the importance of homeostasis, let us look at how changes in the external environment affect us. Our core temperature is maintained in a tight range around 36.5 degrees. If it is altered even a couple of degrees, we exhibit symptoms of hypothermia or hyperthermia. If the weather is too hot, we sweat to cool ourselves; if the weather is too cold, we shiver to raise our temperature. After a meal, we secrete insulin to lower our blood glucose, while we secrete glucagon when starving to raise our blood glucose. Failure of either system leads to either diabetes or hypoglycaemic shock respectively. Homeostasis is an extremely complicated and intricate self-repair system that cannot be imitated.

The Goldilocks effect can be applied beyond physiology to our lives. Everything in moderation; to go beyond is as wrong as to fall short. If we have too little money, it is a problem. If we have too much money, it causes other problems. Whether we work or play, doing too much or too little of either can be bad for us. Medicines become poison in excess and even love in excess becomes obsession. In the marathon that is life, if you run too fast you end up collapsing from exhaustion, while running too slow will mean you never get anywhere.

The secret to happiness lies in understanding what is “just right”.

Posted in Science & Nature

Bird Strike

An airplane flying across the sky faces many dangers. But a very common yet not well-known type of accident is the bird strike. Just as the name suggests, a bird strike is when a plane collides with a flying bird. This may not sound so dangerous, but considering a plane typically flies at 800~900km/h, the energy from the collision is quite significant. If a plane flying at 800km/h collides with a 5kg bird, the energy generated is 92 tonnes. This is not only enough to instantly kill the bird, but also enough to damage the plane.

The most common type of bird strikes is when a bird collides head-on with the windshield or gets sucked into the engine. The latter can cause severe damage to the engine and even cause it to fail. For example, in 1960 a plane flying above Boston collided with a flock of starlings, leading to all four of its engines failing and causing it to crash, killing 62 passengers. Since birds typically fly below an altitude of 9000m, bird strikes most often occur during take-off and landing. However, there are case reports of much higher altitude crashes, with the record being held at 11300m.

According to statistics, the most common type of bird involved are waterfowls and gulls, with 15% of bird strikes being severe. Bird strikes cause $1.2 billion worth of damage annually worldwide and has cost 200 lives since 1988. The first bird strike occurred with the invention of the airplane, as recorded by the Wright brothers (inventors of the modern airplane). As bird strikes cause so much damage, airports place many countermeasures to prevent them. The most frequently used methods are driving away birds from runways by using scarecrows and other methods, or modifying the plane and engines to be more bird-resistant.

Posted in Science & Nature

Cryptography: Book Cipher

So far, the three ciphers introduced could all easily be cracked using frequency analysis and the Kasiski examination. Is there a cipher that is easy to implement yet difficult to break for a beginner cryptanalyst? An extremely popular and surprisingly powerful cipher is the book cipher. Essentially, the book cipher replaces a keyword with an entire book. Instead of replacing a letter for a letter or symbol in a systematic and mathematical way (such as a set shift number or using a tabula recta), the book cipher replaces letters for numbers that refer to a certain text within a book. As the only way to decode the message is to have the book, it is an extremely secure way of enciphering a message given that both parties have an identical copy of the book.

There are many variations of the book cipher. The most popular type is giving a page number, with the first letter of the page being the plaintext. A variant of this is giving a set of three numbers for every letter: the page number, the line number and the word number (or just two: page and line, then take the first letter). Ironically, this may be less secure at times as it may reveal that it is a book cipher. However, doing this for each letter makes the enciphering and deciphering process incredibly long and arduous.

A shortcut method is to refer to a word within a page (using the three-number set coordinates method described above) to shorten the ciphertext. Although this method is much easier in practice, it poses the challenge of finding a book that includes all the words in the plaintext, which may be difficult if the code is for military or espionage purposes.

Because of this, and the fact that both parties (or everyone in the ring) need identical versions of the book while not standing out too much, the most common books used are the dictionary (typically a famous version such as the Oxford Dictionary) or the bible (again, a standard version is used). These books are not only good because they incorporate a massive vocabulary, but they are also inconspicuous while being carried around in an enemy territory.

The book cipher is a very difficult code to crack for most people without advanced cryptanalysis training. Thus, the easiest way to crack is to deduce what book is the keytext. There are numerous ways to do this, but one way would be to cross-match the books of two known spies until common books are found. In the setting of spies in a foreign country, a book such as a traveller’s guide or phrasebook dictionary can be considered a likely target as it can be carried around easily while containing many words. Ergo, the secret behind cracking the book cipher is less about cryptography and more about using the science of deduction.

Posted in Science & Nature

Cryptography: Kasiski Examination

The Kasiski examination can be used to attack polyalphabetic substitution ciphers such as the Vigenère cipher, revealing the keyword that was used to encrypt the message. Before this method was devised by Friedrick Kasiski in 1863, the Vigenère cipher was considered “indecipherable” as there was no simple way to figure out the encryption unless the keyword was known. But with the Kasiski examination, even the Vigenère cipher is not safe anymore.

The Kasiski examination is based on the fact that assuming the number of letters of the keyword is n, every nth column is encoded in the same shift as each other. Simply put, every nth column can be treated as a single monoalphabetic substitution cipher that can be broken with frequency analysis. Ergo, all the cryptanalyst needs to do to convert the Vigenère cipher into a Caesar cipher is know the length of the keyword.

To find the length of the keyword, look for a string of repeated text in the ciphertext (make sure it is longer than three letters). The distance between two equal repeated strings is likely to be a multiple of the length of the keyword. The distance is defined as the number of characters starting from the last letter of the first set of strings to the last letter of the second set of strings (e.g. “abcdefxyzxyzxyzabcdef” -> “abcdef” is repeated” -> distance is “xyzxyzxyzabcdef” which is 15 letters). The reason this works is that if there is a repeated string in the plaintext and the distance between these strings is a multiple of the keyword length, the keyword letters will line up and there will be repeated strings in the ciphertext also. If the distance is not a multiple of the keyword length, even if there is a repeated string of letters in the plaintext, the ciphertext will be completely different as the keyword would not match up and be different.

It is useful recording the distance between each set of repeated strings to find the greatest common factor. The number that factors the most into all of these distances (e.g. 6 is a factor of 6, 12, 18…) is most likely the length of the keyword. Once the length of the keyword is found, then every nth letter must have been encrypted using the same letter of the keyword. Thus, by recording every nth letter in one string, you can obtain what is essentially a Caesar cipher. The Caesar cipher is then attacked using frequency analysis. Once a few of these strings (of different positions on the ciphertext) are solved, the keyword can be revealed by checking the shift key against a tabula recta (e.g. if a certain string of nth letters is found to have been shifted 3 letters each, then the corresponding letter in the keyword must be “D”, which shifts every plaintext letter by 3 in the Vigenère cipher). When the keyword is deduced, every message encrypted using that keyword can now easily be decoded by you.

Although the Kasiski examination appears to be complex, attempting to try it reveals how simple the process is. Thus, it is useful to try encrypting a message using the Vigenère cipher then trying to work out the keyword using the Kasiski examination. Much like the frequency analysis, it is an extremely useful tool in the case of needing to break a secret code.

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.