Skip to content
"Hacking Secret Ciphers with Python" programs
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
affineCipher.py
affineHacker.py
affineKeyTest.py Updates from Ari's edits and consistency checks. Mar 30, 2013
al_sweigart_privkey.txt
al_sweigart_pubkey.txt Reverting key files back to their originals. Feb 26, 2013
buggy.py
caesarCipher.py
caesarCipher2.py
caesarHacker.py
codebreaker_unit_tests.py
coinFlips.py Updates from Ari's edits and consistency checks. Mar 30, 2013
cryptomath.py
detectEnglish.py
dictionary.txt
encrypted_file.txt
frankenstein.txt Initial commit. Aug 20, 2012
freqAnalysis.py Got all the unit tests working again. Feb 26, 2013
freqFinder.py Various changes. This completely breaks the unit tests, I know. I'll … Jan 11, 2013
makeRsaKeys.py
makeWordPatterns.py
nullCipher.py
nullHacker.py
primeSieve.py
pyperclip.py
rabinMiller.py
reverseCipher.py
rsaCipher.py
run_pylint.bat
simpleSubCipher.py
simpleSubDictionaryHacker.py
simpleSubHacker.py
simpleSubKeyword.py Various changes. Dec 14, 2012
transpositionDecrypt.py
transpositionEncrypt.py
transpositionFileCipher.py
transpositionFileHacker.py
transpositionHacker.py
transpositionTest.py Various changes. Dec 14, 2012
vigenereCipher.py
vigenereDictionaryHacker.py
vigenereHacker.py

README.md

codebreaker

Hacking Secret Ciphers with Python" programs

This repo contains the source for the encryption and code breaking programs featured in the book "Hacking Secret Ciphers with Python". Since the code in the book is at this point set in print, I'm only interested in receiving bug reports rather than refactors. But feel free to fork this repo!

Here's a general description of each of the files:

affineBreaker.py Break Affine Cipher-encrypted messages.

affineCipher.py Encrypt and decrypt using the Affine Cipher.

al_sweigart_privkey.txt A sample private key file that is used by the rsaCipher.py program.

al_sweigart_pubkey.txt A sample public key file that is used by the rsaCipher.py program.

buggy.py Used as practice for using Python's debugger.

caesarBreaker.py Break Caesar Cipher-encrypted messages.

caesarCipher.py Encrypts and decrypts using the Caesar Cipher.

coinFlips.py Used as practice for using Python's debugger.

detectEnglish.py Used to detect if a string is English.

dictionary.txt A dictionary file of English words, one per line.

encrypted_file.txt A sample encrypted file from the

frankenstein.txt A large text file sample. (The public domain novel Frankenstein.)

freqFinder.py Module for gathering letter frequency statistics.

makeRsaKeys.py Generate a public/private RSA key pair.

nullBreaker.py Breaks Null Cipher-encrypted messages.

nullCipher.py Encrypts and decrypts using the Null Cipher.

primeSieve.py Generates prime numbers using the Sieve of Erastothenes algorithm

pyperclip.py A module for copying and pasting to the clipboard. This source code isn't going to be featured in the book, and is only included so that people can test the programs that use it.

rabinMiller.py Module for primality testing using the Rabin-Miller algorithm.

README.md The file that you are reading right now, silly. :D

reverseCipher.py Encrypts with the reverse "cipher", which just reverse the string.

rsaCipher.py Encrypts and decrypts using the RSA Cipher.

simpleSubBreaker.py Breaks Simple Substitution Cipher-encrypted messages.

simpleSubCipher.py Encrypts and decrypts using the Simple Substitution Cipher.

simpleSubKeyword.py Encrypts and decrypts using the Simple Substitution Cipher, using an English word for the key.

transpositionBreaker.py Breaks Transposition Cipher-encrypted messages.

transpositionCipherFile.py Encrypts and decrypts files using the Transposition Cipher.

transpositionDecrypt.py Decrypts messages using the Transposition Cipher.

transpositionEncrypt.py Encrypts messages using the Transposition Cipher.

transpositionFileBreaker.py Breaks Transposition Cipher-encrypted files.

transpositionTest.py Tests to see if the Transposition Cipher program works.

vigenereBreaker.py Breaks Vigenere Cipher-encrypted messages.

vigenereCipher.py Encrypts and decrypts using the Vigenere Cipher.

You can’t perform that action at this time.