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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file szyfrow-0.0.7.tar.gz.

File metadata

  • Download URL: szyfrow-0.0.7.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for szyfrow-0.0.7.tar.gz
Algorithm Hash digest
SHA256 6b864fa3fea98e726e7921ef592ce1b8c861507b75d2ea98deb0f348e15615be
MD5 bd4e9f1d52750a91717a8c248f67c3b0
BLAKE2b-256 9337b9b8bc918d5ea0716876d66f769d533c749a7a38eb20e37ec88257fe686d

See more details on using hashes here.

File details

Details for the file szyfrow-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: szyfrow-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for szyfrow-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f08f3d96f46e023fd67c405c77944b29c84ebc8c2c6a16b230f55ac51b855f10
MD5 060de31fe12468f31e976b7efc247089
BLAKE2b-256 76649422746f1c1b6572e10a7b93673e748d0b54b33394fb623a12c1ffc3717f

See more details on using hashes here.

Supported by

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