An open API service indexing awesome lists of open source software.

https://github.com/hexylena/poem-code

"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." - Wikipedia
https://github.com/hexylena/poem-code

cryptography historical-cipher

Last synced: 10 months ago
JSON representation

"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." - Wikipedia

Awesome Lists containing this project

README

          

# Poem Code

Implementation of the [SOE's 'poem code'](https://en.wikipedia.org/wiki/Poem_code) used during WW2, including some poems from [Between Silk & Cyanide](https://en.wikipedia.org/wiki/Between_Silk_and_Cyanide)

## Usage

```
$ python poem.py -a enc -r 1 'Hello darling' -p jabberwocky
HELLODARLING
ASJBKLONXAXRXLXXXGXXIDXXLHE
HELLODARLINGXXXXXXXXXX
```

This encrypt a message with one round of double transposition (i.e. `-r`ounds=1) using the jabberwocky poem. It prints the 'processed' message (upper case A-Z only), the enciphered string, and then the decryption of that to ensure the output looks good. Note the trailing Xs used for padding are quite excessive here.

> ... for security reasons, messages should be at least 200 words long.
> *via [wikipedia](https://en.wikipedia.org/wiki/Poem_code)*

This does not (yet) implement security checks but then neither did half the agents in the field :eyes:.

## Decryption

Don't know what poem was used? Using the power of computers...try them all!

```
$ python poem.py -a dec-test 'IJORVHXAXLLXLXXONRDIGEXXXXXXXXXXX' -r 1
jabberwocky
HELLODARLINGXXXXXXXXXXXXXXXX
bodington
XIXEOXNXXAXXXRLHXXLXXXXGDL
bodington.alt
XLHXXREIAXDXXOXLNGLX
yours
XLHXAXXRXIEOLLXXXXXDXGXN
degaul
XINLRXHXXADLXOL
degaul.alt
XXXXXAHEIOLXXRLXXXXXXXGNLXXD
middle
LODXXXLNHLXIGXAXRE
```

## Alternate poems

Agents were sometimes instructed to use incorrect word numbering by replacing a dash in some words with spaces. For poems including a `-`, an alternative version with the first one replaced with a ` ` is automatically generated under `{name}.alt`.

## License

AGPLv3