Hacking Secret Ciphers with Python

(Ann) #1

56 http://inventwithpython.com/hacking


Email questions to the author: [email protected]


Checking Your Source Code with the Online Diff Tool


Even though you could copy and paste or download this code from this book’s website, it is very
helpful to type in this program yourself. This will give you a better idea of what code is in this
program. However, you might make some mistakes while typing it in yourself.


To compare the code you typed to the code that is in this book, you can use the book’s website’s
online diff tool. Copy the text of your code and open http://invpy.com/hackingdiff in your web
browser. Paste your code into the text field on this web page, and then click the Compare button.
The diff tool will show any differences between your code and the code in this book. This is an
easy way to find typos that are causing errors.


Figure 5-1. The online diff tool at http://invpy/hackingdiff

How the Program Works............................................................................................................................................


reverseCipher.py



  1. Reverse Cipher




  2. http://inventwithpython.com/hacking (BSD Licensed)




The first two lines are comments explaining what the program is, and also the website where you
can find it. The “BSD Licensed” part means that this program is free to copy and modify by
anyone as long as the program retains the credits to the original author (in this case, the book’s
website at http://inventwithpython.com/hacking)) (The full text of the Berkeley Software

Free download pdf