September 28, 2018

Caesar's Cipher in Python (AVW ZLJYLA!)

Aol Ffily-Vtlsslaal


Growing up I was always fascinated by hidden messages, secret codes, ancient languages, and all manner of disguised communication. As I started learning math and computer science, that interest strangely faded. This was likely because modern cryptography seemed so complicated I didn't think I'd be able to make sense of it.

This all changed recently when I read a spectacular book called The Code Book. It starts with examples of secret codes (or ciphers) used in Ancient Rome, Medieval Scotland, and Victorian England. It carries on through WWI, WWII, early internet encryption, and ends with a breakdown of the expected uses of Quantum Computing.

I would love to share much more about this book, but you're better off to just read it and I'll get on  with my post. 

While reading the early chapters, I started thinking about how powerful I could have been in Medieval times if I had access to a computer and a python interpreter. Naturally I started writing some code just in case. The resulting program ended up being both fun, and pretty beginner friendly. So I have decided to write up a guide to how these work.

In this post I will start with what is called Caesar's Cipher.

Caesar's Cipher