ArticleslgStudy

computer science

Poem code

Poem code is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Poem code rather than just read about it. In short: The poem code is a simple and insecure cryptographic method which was used during World War II by the British Special Operations Executive (SOE) to communicate with their agents in Nazi-occupied Europe. The method works by having the sender and receiver pre-arrange a poem to use.

Key takeaways

  • Poem code belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Poem code to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Poem code from memory before moving on to harder problems.

Reference excerpt

The poem code is a simple and insecure cryptographic method which was used during World War II by the British Special Operations Executive (SOE) to communicate with their agents in Nazi-occupied Europe. The method works by having the sender and receiver pre-arrange a poem to use. The sender chooses a set number of words at random from the poem and gives each letter in the chosen words a number. The numbers are then used as a key for a transposition cipher to conceal the plaintext of the message, often by double transposition. To indicate to the receiver which words were chosen, an indicator group of letters is sent at the start of the message.

Description To encrypt a message, words are selected from a poem to form the key. Every poem-encoded message commences with an indicator group of five letters, whose positions in the alphabet indicate which five words of the poem were used to encrypt the message. For instance, if the poem is the first stanza of "Jabberwocky":

The five words the, wabe, toves, twas, and mome could be selected, at positions 4, 13, 6, 1, and 21 in the poem, and be described with the corresponding indicator group DMFAU. The five words are written sequentially and their letters numbered to create a transposition key for encrypting the message. The letters are numbered alphabetically and sequentially in order of appearance, and any absent letters are skipped. In the example of the wabe toves twas mome, the two A's are numbered 1 and 2; the B is numbered 3; there are no C's or D's; the four E's are numbered 4, 5, 6, 7; there are no G's; the H is numbered 8; and so on. This results in a transposition key of 15 8 4, 19 1 3 5, 16 11 18 6 13, 17 20 2 14, 9 12 10 7. This defines a permutation which is used for encryption. First, the plaintext message is written in the rows of a grid that has as many columns as the transposition key is long. Then the columns are read out in the order given by the transposition key. For example, the plaintext "THE OPERATION TO DEMOLISH THE BUNKER IS TOMORROW AT ELEVEN RENDEZVOUS AT SIX AT FARMER JACQUES" would be written in a grid, along with the transposition key numbers, as:

15 8 4 19 1 3 5 16 11 18 6 13 17 20 2 14 9 12 10 7 T H E O P E R A T I O N T O D E M O L I S H T H E B U N K E R I S T O M O R R O W A T E L E V E N R E N D E Z V O U S A T S I X A T F A R M E R J A C Q U E S X

The columns are then read out in the order specified by the transposition key numbers:

PELA DOZC EBET ETTI RUVF OREE IOAX HHAS MOOU LRSS TKNR ORUE NINR EMVQ TSWT ANEA TSDJ IERM OHEX OTEA

The indicator group (DMFAU) is then prepended, resulting in the ciphertext:

DMFAU PELAD OZCEB ETETT IRUVF OREEI OAXHH ASMOO ULRSS TKNRO RUENI NREMV QTSWT ANEAT SDJIE RMOHE XOTEA

Analysis In most uses of code poems, the process of selecting an indicator group and transposing the text was repeated once (double transposition) to further scramble the letters. As an additional security measure, the agents would add prearranged errors into the text as security checks. For example, there might be an intentional error in every 18th letter to ensure that, if an agent was captured or a poem was found, the enemy might transmit messages without typos, revealing the code's discovery. The code's advantage was that it provided relatively strong security without requiring any codebook. However, the encryption process was error-prone when done by hand, and for security reasons, messages should be at least 200 words long. The security check was usually not effective: if a code was used after being intercepted and decoded by the enemy, any security checks were revealed. Further, the security check could often be tortured out from the agent. There were a number of other weaknesses. Because poems were re-used, if one message was broken by any means (including threat, torture, or even cryptanalysis), past and future messages were readable. If the agent used the same poem words to send a number of similar messages, these words could be discovered easily by enemy cryptographers. If the words could be identified as coming from a famous poem or quotation, then all of the future messages submitted with that poem code could be read. The German cryptographic units were successful in decoding many of the poems by searching through collections of poems. Since the poems used had to be memorable for ease of use by an agent, there was a temptation to use well-known poems or poems from well-known poets, further weakening the encryption (e.g., agents often used verses by William Shakespeare, Jean Racine, Alfred Tennyson, Molière, and John Keats).

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Poem code

Start with the simplest possible case. Write down what Poem code claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Poem code before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Poem code ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Poem code

In research
Poem code appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Poem code in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Poem code is common in secondary-school and first-year university syllabi. It links to neighbouring topics Classical ciphers, History of cryptography, Special Operations Executive, so understanding it makes those chapters shorter.
In everyday life
Look for Poem code outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Poem code in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Poem code means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Poem code out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Poem code in simple terms?

The poem code is a simple and insecure cryptographic method which was used during World War II by the British Special Operations Executive (SOE) to communicate with their agents in Nazi-occupied Europe. The method works by having the sender and receiver pre-arrange a poem to use.

Why does Poem code matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Poem code?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Poem code.

Tags

  • Classical ciphers
  • History of cryptography
  • Special Operations Executive
  • World War II espionage

Keep exploring