Hacking Secret Ciphers with Python

(Ann) #1

4 http://inventwithpython.com/hacking


Email questions to the author: [email protected]


ciphertext). A cipher is a set of rules for converting between plaintext and ciphertext. These
rules often use a secret key. We will learn several different ciphers in this book.


Let’s learn a cipher called the Caesar cipher. This cipher was used by Julius Caesar two thousand
years ago. The good news is that it is simple and easy to learn. The bad news is that because it is
so simple, it is also easy for a cryptanalyst to break it. But we can use it as a simple learning
exercise. More information about the Caesar cipher is given on Wikipedia:
http://en.wikipedia.org/wiki/Caesar_cipher.


To convert plaintext to ciphertext using the Caesar cipher, we will create something called a
cipher wheel (also called a cipher disk). You can either photocopy the cipher wheel that
appears in this book, or print out the one from http://invpy.com/cipherwheel. Cut out the two
circles and lay them on top of each other like in Figure 1-8.

Free download pdf