Skip to main content

Tools for using and breaking simple ciphers

Project description

Szyfow ciphers

Simple (mainly manual) ciphers, and routines for enciphering, deciphering, and breaking messages created with them.

The ciphers implemented here are mostly ones that predate mechanical cipher systems. The most complex cipher is the Enigma of World War II.

Each cipher is presented with functions to encipher, decipher, and automatically break messages with that cipher.

Most of the time, messages are broken by brute-force trying each possible key and scoring the resulting deciphered message using a bag-of-words probability measure (or a bag-of-bigrams, or a bag-of-trigrams).

You can find more information on the ciphers and how they are implemented in the codes and ciphers area of my blog.

Ciphers work on messages encoded with the 26 letters of the Latin alphabet, without accents (the letters contained in the string.ascii_letters constant). Most of the ciphers convert letters to lowercase, strip accents from letters, and drop all other characters (such as spaces and punctuation).

szyfrow.support.text_prettify contains functions to make the output easier to read, such as automatically recovering word boundaries.

The name comes from the Polish cipher bureau, the Biuro Szyfrów, who were breaking Enigma ciphers by hand before World War II.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

szyfrow-0.0.7.tar.gz (5.0 MB view hashes)

Uploaded Source

Built Distribution

szyfrow-0.0.7-py3-none-any.whl (5.0 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page