Cracking Codes with Python: An Introduction to Building and Breaking Ciphers

Cracking Codes with Python: An Introduction to Building and Breaking Ciphers — page 7
Chapter 16 Programming the Simple Substitution Cipher covers writ ing a simple substitution cipher encryption program Chapter 17 Hacking the Simple Substitution Cipher explains how to write a program to hack the simple substitution cipher Chapter 18 Programming the Vigenère Cipher explains a program for the Vigenère cipher a more complex substitution cipher Chapter 19 Frequency Analysis explores the structure of English words and how to use it to hack the Vigenère cipher Chapter 20 Hacking the Vigenère Cipher covers a program for hack ing the Vigenère cipher Chapter 21 The One-Time Pad Cipher explains the one-time pad cipher and why it’s mathematically impossible to hack Chapter 22 Finding and Generating Prime Numbers covers how to write a program that quickly determines whether a number is prime Chapter 23 Generating Keys for the Public Key Cipher describes pub lic key cryptography and how to write a program that generates public and private keys Chapter 24 Programming the Public Key Cipher explains how to write a program for a public key cipher which you can’t hack using a mere laptop The appendix Debugging Python Code shows you how to use IDLE’s debugger to find and fix bugs in your programs how to use this Book Cracking Codes with Python is different from other programming books because it focuses on the source code of complete programs Instead of teaching you programming concepts and leaving it up to you to figure out how to make your own programs this book shows you complete programs and explains how they work In general you should read the chapters in this book in order The programming concepts build on those in the previous chapters However Python is such a readable language that after the first few chapters you can probably jump ahead to later chapters and piece together what the code does If you jump ahead and feel lost return to earlier chapters Typing Source Code As you read through this book I encourage you to manually type the source code from this book into Python Doing so will definitely help you understand the code better When typing the source code don’t include the line numbers that appear at the beginning of each line These numbers are not part of the actual programs and we use them only to refer to specific lines in the code But aside from the line numbers be sure to enter the code exactly as it appears including the uppercase and lowercase letters xxiv Introduction