Started on documentation
[szyfrow.git] / szyfrow / __init__.py
1 """Simple ciphers, enciphering, deciphering, and breaking.
2
3 The ciphers implemented here are mostly ones that predate mechanical cipher
4 systems. The most complex cipher is the Enigma of World War II.
5
6 Each cipher is presented with functions to encipher, decipher, and
7 automatically break messages with that cipher.
8
9 Most of the time, messages are broken by brute-force trying each possible key
10 and scoring the resulting deciphered message using a bag-of-words probability
11 measure (or a bag-of-bigrams, or a bag-of-trigrams).
12
13 You can find more information on the ciphers and how they are implemented in
14 the [codes and ciphers area of my blog](https://work.njae.me.uk/tag/codes-and-ciphers/).
15
16 Ciphers work on messages encoded with the 26 letters of the Latin alphabet,
17 without accents (the letters contained in the `string.ascii_letters` constant).
18 Most of the ciphers convert letters to lowercase, strip accents from letters,
19 and drop all other characters (such as spaces and punctuation).
20
21 `szyfrow.support.text_prettify` contains functions to make the output easier
22 to read, such as automatically recovering word boundaries.
23
24 The name comes from the Polish cipher bureau, the Biuro Szyfrów, who were
25 breaking Enigma ciphers by hand before World War II.
26 """