Many steps in enciphering and deciphering are routine: shift this letter, look up that one, repeat for the whole message. Computers are very good at routine work. This book uses the Python programming language to do that work for us, and this chapter teaches the Python you need to get started.
In This Chapter¶
Introduction to Programming in Python
Numbers, strings, variables, comparisons and if statements, ending with a program for the reverse cipher.
Loops
while loops and for loops, so the computer can repeat a step for every letter of a message.
Functions
Packaging code so it can be reused.
Programming the Rail Fence Cipher
Putting it all together.