The Knights Templar Cipher

The Knights Templar flag. A red cross on a black (above) and white (below (background)
The flag of the Knight’s Templar. Image by CS4FN

The Knights Templar were a 12th century order of catholic warrior monks, more accurately if convolutedly called “The Poor Fellow-Soldiers of Christ and of the Temple of Solomon” though they weren’t exactly poor. In addition to their original role of protecting catholic pilgrims heading to Jerusalem from robbery and murder, they also acted as a kind of international banker to support their main role. They laid some important foundations of modern international banking in the process. In particular, they invented a way to move money (or gold) around safely, without ever actually moving it anywhere. That sounds like a magic trick! Did they use some supposed mystical magic powers to do this? No, they kept the actual money given to them in the nearest of their large network of 1000 or so headquarters and forts around the continent. The money didn’t have to move anywhere. They then gave the person a note to hand in at their headquarters in another country. It promised that the Knights there would give them the equivalent amount from their money store when asked and given the note. The Knights there just swapped them the money for that note. This worked as long as they had a suitable store of money in each location, which of course would be topped up each time someone wanted to move money from that point. This is a simple version of how international banking works now. A British 20 pound note just promises to pay the bearer an equivalent amount, and without that promise (and people’s belief in it) it is just a piece of paper. It is just a similar promissory note, except people now just swap notes, treating it as money in its own right. Similarly, the banks don’t actually move any gold or other physical form of money about when you pay a shop with your debit card or banking app. They just move information equivalent to those promissory notes embodied in the transaction, around a network (though a computer one rather than a network of forts connected by roads).

There is a problem though with moving money from one person to another in this way using notes. If someone steals the note then it is potentially as valuable to them as actually stealing the chest of gold left in the original fort (just as stealing a 20 pound note is). In the Templar’s time the thief would just need to take it to a Templar headquarters and swap it for money just as the original owner would have done (a bit risky perhaps, given how fearsome the Templars were, but potentially possible!). Worse though, without a system to protect from this kind of attack, a thief could copy the note and then ask for the money repeatedly!

However, the Templars are know to have used encryption in their communications. The notes may therefore have been encrypted too and if so that would have made them useless if stolen. Banks now encrypt all those messages that move money about computer networks for the same reason. If only the Templar’s could read their notes (as only the Templar’s knew the key to their code), then only they could know it even was promising money. That doesn’t fully make it secure though, perhaps a thief could guess it was such a note, and if so what is to stop them then trying to cash it in (apart from the risk of being wrong). You would need something more. A simple possibility is the person with the note would need to know the encrypted amount that was contained somewhere within it. If they didn’t ask for the right amount then they couldn’t have handed over the money in the first place. They would reveal themselves as a thief!

Modern banks have to deal with similar problems even though modern financial transactions are all encrypted. Simple encryption alone is still not enough, protocols (special algorithms) are needed to prevent wide ranging kinds of attack being possible. Banks also need to use better ciphers than those from the Middle Ages, as today we can quickly crack ciphers as simple as the Templar Cipher. Banking is all done differently in detail today, but the ideas behind what is done and why are the same.

Can you crack the Templars’ cipher and decrypt the message below? One way might be using frequency analysis. The most common letters in English are likely (if not definitely) the most common in the message. E is most frequent in English, so which symbol might stand for E? Frequency analysis had been known for several hundred years before the Templars used ciphers (at least by the Arabs, though the Templars weren’t exactly their friends!), so it is actually possible even then that the Templars’ messages might be cracked, unknown to them. It was an Arabian scholar called Al Kindi, who actually invented frequency analysis (or at least was the earliest known person to write about it in his manuscript “On Deciphering Cryptographic Messages”.) Another way to crack the code might be to look for cribs – what words might be included in the message if it is a promissory note? Using both together may give you a good chance of decrypting the message. If you can’t crack their code (there is a big clue in this article), the key is given at the end if you scroll down. Use it to then decrypt the message.

Templar Cipher Puzzle using triangles, diamonds and other symbols.

More on …

Magazines …

Subscribe to be notified whenever we publish a new post to the CS4FN blog.


This blog is funded by EPSRC on research agreement EP/W033615/1.

QMUL CS4FN EPSRC logos

Scroll down for the solutions

Solutions: The Key

The Templar’s cipher uses symbols based on their flag’s triangles. To encrypt a message swap letters for symbols. (They had no J).

The cipher mapping symbols to letters§§

Can you decrypt the message given the above key? Here is an example – the message HELLO as encrypted in this cipher.

HELLO in the cipher

Scroll down further for what the message says…

Solutions: The Message

The message reads …

GIVE KING PHILIP OF FRANCE ONE HUNDRED GOLD PIECES


Superhero Syllogisms

Superheroes don’t just have physical powers. Often they come out on top because of their mental abilities. Sherlock is a good example, catching villains through logical thinking. Anyone can get better at thinking! Just practice.

It is important for everyone to be able to think clearly. It is especially true for programmers, detectives and lawyers as well as superheroes. You need to be able to work things out from the facts you know. The Ancient Greeks were very good at logic. They invented the idea of a ‘syllogism’. These are common patterns that combine facts where you figure out a conclusion only using the facts.

For example, if we know facts 1 and 2 below (where you can swap in anything for X, Y and Z) then we can create a new fact as shown.

FACT1 ALL X Y
FACT 2 Z IS A X
NEW FACT Z Y
Image by Paul Curzon

So let’s replace X with the word superheroes, Y with fight crime and Z with my favourite superhero, Ghost Girl. If we put them in to the picture above we get the new picture:

FACT 1 ALL super heroes fight crime
FACT 2 Ghost girl is a super hero
NEW FACT Ghost Girl fights crime
Image by Paul Curzon

In this case we can deduce the new fact that Ghost Girl fights crime. Notice how you use the plurals in Fact 1 and singular words in the other facts to make the English work.

Puzzles

Can you solve these Superhero Syllogism puzzles? Work out which conclusion is the one that follows from the given facts. Use our coloured template above to help.

Superhero syllogism puzzle 1

FACT 1: ALL superheroes do good.
FACT 2: The Invisible Woman is a superhero.

Which statement below (a, b, c or d) can we say from these facts alone? Don’t use anything extra, just use fact 1 and fact 2. (ANSWERS at the bottom of the page).

a) The Invisible Woman has superpowers.
b) The Invisible Woman does good.
c) The Invisible Man does good.
d) The Invisible Woman does not do good

Superhero syllogism puzzle 2

FACT 1: ALL superheroes sometimes accidentally do harm.
FACT 2: Jamila is a superhero.

What can we say from these facts alone?

a) Jamila sometimes accidentally does harm.
b) Jamila is not a superhero
c) Those with superpowers only do good.
d) Jamie is a superhero

Superhero syllogism puzzle 3

FACT 1: ALL supervillains laugh in an evil way.
FACT 2: The Spider is a supervillain.

What can we say from these facts alone?

a) The Spider sometimes accidentally does harm.
b) The Spider does not laugh in an evil way.
c) Supervillains are evil.
d) The Spider laughs in an evil way.

As long as the facts are true the conclusion follows, though if the facts are not true then nothing is really known.

Superhero syllogism puzzle 4

The following logic is good but something has gone wrong because the conclusion is not true. The superhero called the Angel does not actually have any superpowers! The Angel just wears a flying suit! Can you work out what has gone wrong with our logic?

1. ALL superheroes have superpowers.
2. The Angel is a superhero.

Therefore we can conclude from these facts alone that

3.The Angel has superpowers.

Answers are at the bottom of the page.

Fun to do

Take the pattern of the above syllogisms and invent your own. Just substitute your own words, but keep the pattern.See how silly the “facts” you can deduce are.

– Paul Curzon, Queen Mary University of London, first appeared in A BIT of CS4FN 2

More on …


Magazines …


Our Books …

Subscribe to be notified whenever we publish a new post to the CS4FN blog.


This blog is funded by EPSRC on research agreement EP/W033615/1.

QMUL CS4FN EPSRC logos

Answers

Superhero syllogism puzzle 1

Answer: b.
FACT 1: ALL superheroes … do good.
FACT 2: The Invisible Woman is a superhero
Therefore we can conclude from these facts alone that
NEW FACT: The Invisible Woman … does good.

Superhero syllogism puzzle 2

Answer: a.
FACT 1: ALL superheroes … sometimes accidentally do harm.
FACT 2: Jamila is a superhero
Therefore we can conclude from these facts alone that
NEW FACT: Jamila … sometimes accidentally does harm.

Superhero syllogism puzzle 3

Answer: d.
FACT 1: ALL supervillains … laugh in an evil way.
FACT 2: The Spider is a supervillain.
Therefore we can conclude from these facts alone that
NEW FACT: The Spider … laughs in an evil way.

Superhero syllogism puzzle 4

Something has gone wrong. We are told  that The Angel has no superpowers. They just wear a special flying suit. The new fact is therefore not true. This means that one of the original ‘facts’ was not actually true. If we start from things that are not true then the things we deduce will not be true either! In this case

EITHER:

Some superheroes do NOT have superpowers

OR:

The Angel is NOT a superhero.

Happy Hallowe’en

Free spooky puzzles and activities

Visit our sister site, Teaching London Computing’s, Halloween puzzle area to access our free colouring-in puzzles and activities linked to Halloween.

It includes computational thinking-linked puzzles for Halloween to download and print:

  • “Maggot” logic puzzles: Place 10 Maggots, one in each of the 10 separately coloured areas of the pumpkin picture so that …
  • Colour by number Pixel Puzzles: Colour each square (pixel) according to its number. See our pixel puzzle page for lots more pixel puzzles.
  • Halloween Kriss-Kross: Given a list of words of different lengths, you must fit them all in to the grid
  • Make a Halloween “Useless Machine” coffin. Switch it on and the occupant reaches out of the coffin and switches it off again.
  • Program a pumpkin: Create a programmable paper face light up pumpkin

More on …


Subscribe to be notified whenever we publish a new post to the CS4FN blog.


This blog is funded by EPSRC on research agreement EP/W033615/1.

QMUL CS4FN EPSRC logos