Cracking Codes with Python: An Introduction to Building and Breaking Ciphers: Sweigart, Al: 9781593278229: Amazon.com: Books
Full Disclosure: I solicited Mr. Sweigart for an eBook copy of this book for review purposes. This was AFTER purchasing the original Hacking Secret Ciphers book for Python 2 around 3 years ago and AFTER purchasing a physical copy of Cracking Codes immediately upon release based solely on my love for the previous installment. If it makes you feel any better, he got me the eBook months ago, and I'm dreadfully late on my review.
I'm a huge fan of Mr. Sweigart's work. I found Hacking Secret Ciphers to be a brilliant primer on basic Python programming practices, and find that it has only been refined and updated in Cracking Codes. Many friends have expressed an interest in what I do and asked me where to begin to learn programming concepts, and I frequently point them toward Python and Mr. Sweigart's resources.
Cracking Codes walks you through several different methods of encoding messages with different ciphers using the Python programming language. From a simple Caesar cipher all the way through an implementation of the textbook RSA cipher. He walks you through from basic data types and decision structures through loops, data structures, common Python modules, and other advanced concepts. You read from and write to files, and learn to powerfully process and transform text with Python.
I frequently use Hacking Secret Ciphers/Cracking Codes and Automate The Boring Stuff as references for writing basic Python programs. They're outstanding resources, and it's a joy to go back through Cracking Codes, retype all the exercises, and troubleshoot them until they run. The diff tool on Mr. Sweigart's InventWithPython site is a godsend, and the ability to run the source code to see what my code should look like when it executes has helped me pass many a roadblock.
I don't quite understand how every cipher works or why it's difficult to hack, but I do generally get what each program is doing at any given point, and you can, too. If you don't quite get cryptography, this is also a neat way to look under the hood and get some of the basic concepts. It's pretty wild to see a computer hack a cipher in seconds that would take a human hours, days, or months -- if they could solve it at all.
An excellent and entertaining book of exercises. I wholeheartedly suggest it, especially for teens and adults interested in computer science and programming. Thank you for another great book, Mr. Sweigart!