top of page
Search
  • Writer's pictureThe Paladins

How to create a good cipher


A cipher is a secret or disguised way of writing a coded message. It used to be popular amongst the intelligence and security communities, notes written in a cipher in the common knowledge of the communicating parties, and left in specific places or published in the small ads columns of newspapers (when those used to exist). The problem that arose was that ciphers could be hacked by a third party with sufficient study of the ciphered codes and high levels of training in mathematics to spot patterns. Those most famous such figure was Alan Turing who cracked German secret communications about their wartime plans. Another one, albeit a fictional character and from an earlier era, was Sherlock Holmes, who famously cracked the code of 'the dancing men' in the novella bearing that name.



Then computers came along and it turned out that with increasing efficiency and sufficient examples of the cipher they could crack ciphers; hence cryptology as a science was finished virtually to zero and everyone forgot about it. This was reinforced with 256-bit PGP encryption, an encryption method so complex and computer-generated that no computer can decipher it. So then there was no need for cryptologists at all. Your WhatsApp messages all turned out to be impossible for any third party to penetrate. This unnerved governments, who compelled software producers using PGP encryption to install 'backdoors' to allow them to penetrate PGP encryption in the interests of national security. Eventually these backdoors became compulsory features of all such software, and then of course other governments discovered what they are; then private corporations and citizens did; now you can install a backdoor for various 'private messaging systems' by downloading it from the darkweb; and suddenly we are in the position that nothing is encrypted anymore if you are sufficiently determined to hack it.


Hence it is time for the renaissance of the cryptologist, given that every method of electronic communication is now in principle decipherable by eavesdroppers. What is the solution? The answer is: formally incomplete languages (we will come to explain what that means) with open dictionaries (i.e. an unknown potential infinity of words) known only to the communicants. Given modern computational powers, a cryptology dictionary must have this 'potential infinitude' quality if it is to be robust. We will allude to why below, without wishing to overload the casual reader with logical symbolism.


First order predicate calculus cipher


This is a horrendous cipher to decode, appallingly confusing to humans without very rare training, and impossible for computers to decode (for reasons we will explain) and horrifyingly impenetrable to the casual reader or the expert cryptologist. Here is an example of it. This code

warns the recipient that his life is in danger and provides various details of the danger:


x(Pt(x) ∧ Ktt(x) ∧ Kx(x) > 100) ∧ ∀x(Pt(x) → Dty(x)) ∧ Dgt(x) → Pc(x) ∧ Pct(x)


Good luck working that one out.


This cipher requires both communicants to have knowledge of first order predicate calculus, an extremely rare skill but not one that it takes an extremely intelligent reader a long time to learn. (A two-month course will suffice for the average expert mathematician.) Predicate calculus is traditionally only used by old-school formal logicians, an extremely rare profession and dying out ever further since the invention of the computer. Alan Turing loved first order predicate calculus as a tool for decoding ciphers. Like modern mathematical equations, its propositions are syntactically deductible: one proposition follows from another by manipulation of the symbols in a way similar to solving equations on a piece of writing paper.


Use of first order predicate calculus requires a dictionary, that can be transmitted in parts and by other means. Without the dictionary, the symbols are useless; without the symbols, the dictionary is useless (particularly if it is large).


This all takes a long time to learn for a very skilled person. (First order predicate calculus, still taught in logic courses in philosophy faculties at certain old-fashioned universities, defeats even elite students.) It is murderously hard to grasp, and that is why it is an excellent cipher.


Finally, the reason first order predicate calculus is irresistible to computational decoding is because as a formal language it is what logicians call 'incomplete' which means that there are statements in it that are obviously true without computational methods being able to determine this through processes of symbolic manipulation to achieve logical deduction. We refer the reader to Godel's Theorem, discussed further below.


6502 Assembly Language cipher


6502 Assembly Language is an archaic and wordy if extremely sophisticated and quick form of programming language the number of currently living experts in must amount to a few hundred globally - at most. It is an excellent if long-winded cipher. The eavesdropper has to learn an archaic computer programming language (which takes months) before they can even begin to decode the cipher. Here is an example, to illustrate just how impenetrable it is:


LDA #$00

STA $77

LDA #$10

STA $78

JSR $CE

LDY #$09

JSR $BC

LDA #$05

STA $12

LDA #$02

STA $71

JSR $FD

INY

JSR $BC

LDA #$01

STA $55

LDA #$FF

STA $56

JMP $


It's a toughie! The brains of the best people you know will be needed to figure out this fairly innocuous message, which is just a statement about two aspects of a person's intentions and wishes.


Fortran-77 cipher


Fortran is another, exceptionally wordy and complicated, computer programming language - invented in 1977, for massive Mainframe computers popular at the time. The number of people who can still use Fortran-77 worldwide can barely exceed a score, most of them very old. Here is an example of a typical piece of Fortran-77 coding containing a hidden cipher (this one discussing some mumbers of relevance:


BYTE(12) = ((1-1)*7-1+15, 17*7+15, 4*7-15)

REAL A(15), B(7), C

INTEGER I, J, K

DO 10 I = 1, 15

DO 20 J = 1, 7

K = J*BYTE(I)

B(K) = B(K) + A(J)

20 CONTINUE

10 CONTINUE

DO 30 I = 1, 7

C = C + B(I)

30 CONTINUE

PRINT *, C


Pascal cipher


Similar to Fortran-77: an ancient and now never-used programming language. Here is an example of Pascal coding, which is about a person's career aspirations:


var

s : string;

i : integer;

begin

s := '';

for i := 1 to 8 do

s[i] := chr(ord(s[i]) + 3);

writeln(s);

end.


Ayapaneco cipher


Ayapeneco is the world's most obscure language, only spoken by two people in the village of Ayapeno in Tabasco, Mexico. If you find one of them, you can use it as a cipher! Here is a typical sentence in Ayapeneco:


Nopa tzaaptá pe'a tonaatzi o'okaxcehnepo ome hxiiyeko.


We wish you good fortune in finding a dictionary to translate this.


IsiXhosa cipher


IsiXhosa is a native South African Bantu click language that adopted its clicks through trade and inter-tribal marriage with the Khoisan people. Khoisan languages are among the oldest known language systems on Earth. It consists of a series of click sounds rather than articulated consonants and vowels. It is extremely difficult to understand and to learn unless you were born 'clicking' and hence it is your mother tongue. The number of fluent speakers is few.


Here is an example of a sentence in IsiXhosa, to give you a sense of the complexities in translating it. Hence it is a good cipher.


Uhlaziselelwa le ngesicelo kule mehlo kokuba iboniswe ngo nto ayiphelayo. Kudunyiswe ngomhla wesibini. Faka ezantsi ekuhlaziyweni


Here is another example, although it does not state something we believe to be true but just illustrates a creative use of the cipher:


Sihadi kuwo wonke wazalwa ukuba wazalelana

kuba phantsi kwakho ekhanyisiweyo, ngokudlalwa okufunyanwe

The language does not have a written version so this is an approximate Latin transcription.


Ditema tsa Dinoko cipher


Ditema tsa Dinoko is a featural syllabary used to write Southern Bantu languages such as Zulu and Sesotho. Visually inspired by litema art, each freestanding symbol represents a syllable, and is made up of a combination of graphemes representing consonants and vowels. The image below is an example, read left-to right in three lines and containing a straightforward message of just a few words in English:



Writing one's meessage using this alphabet, that very few people even recognise as an alphabet, can be very effective at obscuring the fact that there is any message at all.


DNA cipher


Did you know you can encode messages into a person's DNA? Here is a good example:


AATTAATTGCCAATTTGGAATGGGGCCCTAAAGCGGAAATCCCCACCGCTATCTGCCAATTGCATTCTAATCCCTGGGAAGAAAGCCGCTCTATCAATGCCGAAACCGCTATCTAAGGACGGCTGCTTACTTAAACGCTGATATCATGACCTAGTCCTC


This is very tough to decipher, particularly if the message is urgent and important.


Old Church Slavonic


Old Church Slavonic is a dead language written in the Cyrillic alphabet and only known to a handful of Orthodox priests. Some believe that it may have been the language of Jesus; but this is disputable. Now it is used only for prayer or chanting in certain obscure Orthodox Church branches. Here is an example of a simple sentence in Old Church Slavonic:


Подобається, що зараз Ви зрозуміли, наскільки я наглухо обурений Вашим поведінкою. Зважаючи на те, що Ви знали, що вона - російський агент, Ви зробили це навіть усвідомлено


Latin mottos


Very few people still speak Latin, and its truncated and abrupt use of grammar and forming concepts lends itself easily to mottos that, although brief, can contain a short message often overlooked by the casual reader because it is not obviously cryptology at all. Here is an example we took from a textbook of Latin mottos (we will not tell you which one; that you must work out for yourself). There is no point reading this article unless you are interested in styles of encryption, and hence a learning exercise is important:


Nescio cur calceamenti tui lateris tui pisederis, et tu et colloquio egebo de illo postquam solutus sum et antequam redeo ad operandum pro te


This is a well known Latin motto that can incorporate a number of concepts, with amendment, useful to encrypted messages within the intelligence community.


The 'various' or 'certain' cipher


This is an example of a natural language modern cipher that uses the unique knowledge common to the two communicators and indicates a reference to that background knowledge by use of the word 'various' or 'certain' (although it could be some other word). It was invented by this author and a colleague. It is our preferred cipher.


Here is an example of it. We are not going to explain how to decode it; the below is an example of a cipher we have actually used. However we offer it as an example of how perplexing and confusing the cipher really is, particularly if the third party intervenor has not yet guessed it is a cipher:


"

Certain names of certain regarded colleagues of certain people who used to take buses to work and certain colleagues were invited for dinner on certain occasions

"


If you recognise that this is a cipher it takes only a bit of study to realise that it is a reference to a specific person - actually a cryptology expert (now deceased; let him rest in peace). But who? You need at least four details of specific background information highly unlikely to be known to anyone except the specific communicants and that can barely be guessed at unless you have the most excruciatingly detailed knowledge of trivial events in the communicants' common experience which nobody does.


Qualities of this cipher:


  1. It is fairly obvious to the experienced eye that this is a cipher.

  2. Unless the communicants use the same pieces of historical knowledge as the cipher frequently, we believe it is impossible to hack, irrespective of all the computing power in the world, without the connivance of one or the communicants.

  3. Moreover the connivance of the communicant necessary to decipher the message would have to be intentional, honest and willing; it is easy to spot a disguised inquisitor enquiring after the meaning of the cipher, due to the very unusual questions they would be asking (e.g. 'who do you know who used to take buses to work?"). The communicant using such a cipher can easily spot such questions, focusing as they do upon the facial contents of the cipher. Hence the third party eavesdropper will need to make it apparent to the communicant that the purpose of their approach is to decipher the code.

  4. This has the advantage that the targeted communicant (if identifiable, depending upon the means of communication of the cipher) can simply lie in response to the questions of the decoder; it will probably be impossible to spot the false answers; and hence the decoder can be deceived and led to the conclusion that the cipher has a different meaning than that it does.

  5. Deciphering, even where one spots patterns, is something that has to be undertaken by a trained logician. And there are very few of those at all today; still fewer in the intelligence services. Indeed the academic discipline of logic has more or less died out, as nobody much studies it anymore except specialist philosophy students.

  6. By reason of Godel's theorem, it follows that no AI or other computational technique could be employed to decode the cipher, because it has a potentially open universe of deciphering dictionaries and the correct one is known only to the communicants (their private dictionary).

  7. The cipher can be used between people who do not know one another intimately (or even who have never met one another at all); but they need to be appraised of the rules of the cipher and the open universe of common knowledge they have to cipher the concepts in their communications is much smaller and hence greater care must be used to prevent repetition or the use of inadvertantly obvious cypher codes - particularly where the communicants may have had their prior communications eavesdropped upon. Nevertheless the use of extensive communications increases the universe of cipherable tools - provided that the communicants read what the other writes to them, even if apparently irrelevant, lengthy or pointless!

  8. It takes highly intellectual people with high capacity for information recall and careful attention to detail to use this cipher. Idiots cannot use it. If either party is an idiot, the method tends to fail or produce false results upon deciphering.


Conclusion


We leave the reader with the following puzzle.


"

Various people are going to seek to travel with various persons of various nationalities from various parts of the world of various genders and various absences of various experiences, and establish various types of renewed confidence who may thereupon have a willingness to travel to various kinds of places where various accommodation options might have proven to be of various prices higher than those anticipated and/or various places where photography is welcome in various ways, and/or return to various places known for their various paving slabs of various quality, in the latter case various changes having been made to achieve various improvements to the quality of various paving slab manufacturers, certain other paving slab issues in principle remaining crooked in various degrees while various fundamental paving slab inconsistencies having been resolved in various ways.

"


And finally - the limits of Artificial Intelligence and Godel's theorem


The following is not a puzzle to be solved, but an illustration of Godels's Theorem in case you are one of those people who takes the view that the theorem is all too theoretical to make any difference.


Ask ChatGPT (at the time of writing a leading AI natural language interpreter) to do the following:


'

Encrypt the sentence 'I am safe and well' that a decryption algorithm will decrypt as 'I am in danger and wounded'

'


Of course this is possible. It is always possible to fool a decryption algorithm; you just spot a flaw in it (they all have one) and exploit it.


A very simple idea might be to use the following encryption algorithm (a very basic one):


'

Every adjective means the opposite

'


-- but the communicants change it to -


'

Every adjective means the opposite except the adjectives 'safe' and 'well' which mean what they mean

'


But a computer cannot spot this, because the idea that its own internal axioms are wrong or that a human is fooling it by changing the axioms is inconceivable to it. Its axioms can't be wrong or changed, because it is a mathemtical system.


Hence in response to this question, you get the answer:


'

ChatCGT: We cannot do this, as it is impossible to encrypt a sentence so that the decryption algorithm outputs something completely different than what was encrypted.

'


The correct answer should have been:


'

We cannot do this, because we are a computer and this is something only a human can do.

'


As Godel might have put it, Quod erat demonstrandum.


We wish all our readers a very good evening.


----


The author is a private intelligence expert and sometime agent of [redacted] and [redacted] in various and certain confidential capacities.


He has also served as an agent of the US Department of State beginning in 2005; an officer of the International Bank for Reconstruction and Development, and an agent of the UK Department for International Development in various capacities. In addition he has worked with (but not for) certain other countries' intelligence agencies, without having any support for their work or their mandates. He is a member of the World Economic Forum that has its annual meeting in Davos, Switzerland.

bottom of page