Mathematics and espionage – basic science

by Edgard Pimentel

Encryption in the judiciary


The work of a mathematician is similar to that of a detective, a spy or a prosecutor. In math, we start with some guesswork, specific clues, and a little bit of intuition. After a while, there comes the discovery and the evidence to support it. But the reverse of this comparison can be quite interesting: the math of secret agents, national security, and even the courts.

Secret messages have been around since humans have been communicating with each other. And the need to protect its contents is at the origin of an important area of ​​mathematics, cryptography. This set of techniques has two, two-fold goals: on the one hand, to develop rules that allow you to securely encode messages; On the other hand, you get strategies to crack these codes.

An elementary example is the so-called Caesar cipher, which the Roman historian Suetonius described as follows: The secret message is written and then the letters A are replaced by D; B to E; C to F and so on. We replace each letter with one that takes up three positions in the alphabet. But what if the lyrics are over? What to do with X or Z Simple: X is replaced by A; the Y is replaced by B and the Z by C. Now it is very present in mathematics to identify the end and the beginning of a list. The concept of modular arithmetic or congruence according to the German Gauss is a formalization of this idea.

The Caesar cipher is an example of substitution cryptography. One way to reinforce a substitution cipher is to use more than one alphabet (e.g. letters and numbers), called the polyalphabetic cipher. A good example is the Hill cipher, which assigns a number to each letter and uses linear algebra to generate cipher messages by matrix multiplication. The Enigma and Purple encryption systems that Germany and Japan used during World War II are polyalphabetic.

More recently, extremely sophisticated math has entered the field. It turned out that one item capable of keeping secrets is the discrete logarithm (this is no joke!). The discrete logarithm can be defined for each group. And the calculation can be very difficult in some groups. Thus, a code whose key depends on solving discrete logarithms over these groups is more difficult to crack. This is where very (very!) Large and curved prime numbers come into play, reminiscent of the Copacabana coast.

Deciphering secret messages means discovering truths, and this practice manifests itself in court as well. The admission of DNA-based evidence is based on probability theory. The thirteen gene pairs used for identification vary so widely that the likelihood of two different people sharing the same pairs is less than 1 in 400 trillion. A statistical analysis of the fragments of some projectiles was used to find out whether or not there was a second shooter in Dallas that Friday in November 1963.

But the use of math in court is not unanimous. In an article published in the Harvard Law Review, Laurence Tribe, professor emeritus of constitutional law at the university, treats the subject with caution. The problem? Using math as an infallible piece could lead to errors in the judicial system.

At the end of the 19th century, Alfred Dreyfus was accused of having passed on secret information to the German armed forces. Statistical analysis of his spelling in a memo would prove his guilt. In 1904, mathematicians Darboux, Appel and Poincaré entered the field and resumed statistical analysis of this notation. The conclusion of these notable people was that the analysis was amateurish and relied on the abuse of probabilities. And I was wrong.

But the message of this trio is much deeper: in order to be really useful and to improve people’s lives even in secret dimensions, mathematics must be done (and used) with decency.


Edgard Pimentel is a mathematician and professor at PUC-Rio.

Subscribe to Serrapilheira’s newsletter for more news from the Institute and the Ciência Fundamental blog. Do you have a proposal for an agenda? This is how you can work together.

Leave a Reply

Your email address will not be published. Required fields are marked *