physics, maths & computer science

The book ‘Code’ by Simon Singh gives a readable history of codes and ciphers. I used the descriptions and examples he provides to make procedures for enciphering and deciphering using different systems.

Working my way through the book, I made procedures in python for:

Simple, random substitution

Caesar shift (simple)

Caesar shift with keyword

Railfence transposition

Vigenère cipher

Playfair

ADFGVX

Homophonic substitution cipher

Enigma (generic)

I also made procedures for:

Frequency analysis (substitution)

Frequency analysis (Vigenère)