header image
Click to view the other books
Invent with Python cover thumbnail Making Games cover thumbnail Hacking Secret Ciphers cover thumbnail
Vote up on StumbleUpon.com

Source Code

Download

Zip file of source code for all programs.

dictionary.txt

wordPatterns.py

pyperclip.py (A module that adds clipboard copy/paste functions, imported by many of the book's programs.)
Chapter 4, Strings and Writing Programs
hello.py
Chapter 5, The Reverse Cipher
reverseCipher.py
Chapter 6, The Caesar Cipher
caesarCipher.py
password.py
password2.py
elifeggs.py
caesarCipher2.py
Chapter 7, Hacking the Caesar Cipher with the Brute Force Technique
caesarHacker.py
Chapter 8, The Transposition Cipher, Encrypting
transpositionEncrypt.py
helloFunction.py
nameCount.py
scope.py
addNumbers.py
Chapter 9, The Transposition Cipher, Decrypting
transpositionDecrypt.py
Chapter 10, Programming a Program to Test Our Program
transpositionTest.py
Chapter 11, Encrypting and Decrypting Files
transpositionFileCipher.py
Chapter 12, Detecting English Programmatically
detectEnglish.py
Chapter 13, Hacking the Transposition Cipher
transpositionHacker.py
Chapter 14, Modular Arithmetic and the Multiplicative Cipher
cryptomath.py
Chapter 15, The Affine Cipher
affineCipher.py
affineKeyTest.py
Chapter 16, Hacking the Affine Cipher
affineHacker.py
Chapter 17, The Simple Substitution Cipher
simpleSubCipher.py
Chapter 18, Hacking the Simple Substitution Cipher
makeWordPatterns.py
wordPatterns.py
simpleSubHacker.py
Chapter 19, The Vigenère Cipher
vigenereCipher.py
Chapter 20, Frequency Analysis
freqAnalysis.py
Chapter 21, Hacking the Vigenère Cipher
vigenereDictionaryHacker.py
vigenereHacker.py
Chapter 23, Finding Prime Numbers
primeSieve.py
rabinMiller.py
Chapter 24, Public Key Cryptography and the RSA Cipher
makeRsaKeys.py
rsaCipher.py

Copy and Paste

You can also select the text of the source code below, and copy & paste the code into IDLE.

(Click on the text field, then press Ctrl-C to copy.)