Buy new:
-41% EUR20.21EUR20.21
EUR 9.42 delivery Wednesday, January 28
Ships from: Amazon.com Sold by: Amazon.com
Save with Used - Good
EUR8.56EUR8.56
EUR 9.42 delivery Thursday, January 29
Ships from: Amazon Sold by: 2nd Life Books
Return this item for free
Free returns are available for the shipping address you chose. You can return the item for any reason in new and unused condition: no return shipping charges.
Learn more about free returns.- Go to your orders and start the return
- Select your preferred free shipping option
- Drop off and leave!
Sorry, there was a problem.
There was an error retrieving your Wish Lists. Please try again.Sorry, there was a problem.
List unavailable.
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
Cracking Codes with Python: An Introduction to Building and Breaking Ciphers Illustrated Edition
Purchase options and add-ons
After a crash course in Python programming basics, you’ll learn to make, test, and hack programs that encrypt text with classical ciphers like the transposition cipher and Vigenère cipher. You’ll begin with simple programs for the reverse and Caesar ciphers and then work your way up to public key cryptography, the type of encryption used to secure today’s online transactions, including digital signatures, email, and Bitcoin.
Each program includes the full code and a line-by-line explanation of how things work. By the end of the book, you’ll have learned how to code in Python and you’ll have the clever programs to prove it!
You’ll also learn how to:
- Combine loops, variables, and flow control statements into real working programs
- Use dictionary files to instantly detect whether decrypted messages are valid English or gibberish
- Create test programs to make sure that your code encrypts and decrypts correctly
- Code (and hack!) a working example of the affine cipher, which uses modular arithmetic to encrypt a message
- Break ciphers with techniques such as brute-force and frequency analysis
There’s no better way to learn to code than to play with real programs. Cracking Codes with Python makes the learning fun!
- ISBN-101593278225
- ISBN-13978-1593278229
- EditionIllustrated
- PublisherNo Starch Press
- Publication dateJanuary 23, 2018
- LanguageEnglish
- Dimensions7 x 0.97 x 9.25 inches
- Print length416 pages
Frequently bought together

What other items do customers buy after viewing this item?
Customers also bought or read
- The Big Book of Small Python Projects: 81 Easy Practice Programs
PaperbackEUR30.98EUR30.98EUR 9.38 delivery Wed, Jan 28 - Impractical Python Projects: Playful Programming Activities to Make You Smarter
PaperbackEUR21.51EUR21.51EUR 9.42 delivery Feb 2 - 11 - Beyond the Basic Stuff with Python: Best Practices for Writing Clean Code
PaperbackEUR29.04EUR29.04EUR 9.31 delivery Jan 29 - Feb 13 - Black Hat Python, 2nd Edition: Python Programming for Hackers and Pentesters
PaperbackEUR25.99EUR25.99EUR 7.46 delivery Wed, Jan 28 - Object-Oriented Python: Master OOP by Building Games and GUIs
PaperbackEUR37.43EUR37.43EUR 9.31 delivery Wed, Jan 28 - Serious Cryptography, 2nd Edition: A Practical Introduction to Modern Encryption
PaperbackEUR23.07EUR23.07EUR 9.31 delivery Wed, Jan 28 - Invent Your Own Computer Games with Python, 4th Edition
PaperbackEUR17.86EUR17.86EUR 7.98 delivery Wed, Jan 28 - Learn to Code by Solving Problems: A Python Programming Primer
PaperbackEUR21.51EUR21.51EUR 8.20 delivery Wed, Jan 28 - Python Crash Course, 3rd Edition: A Hands-On, Project-Based Introduction to Programming#1 Best SellerIntroductory & Beginning Programming
PaperbackEUR23.70EUR23.70EUR 9.42 delivery Wed, Jan 28 - Dive Into Algorithms: A Pythonic Adventure for the Intrepid Beginner
PaperbackEUR30.37EUR30.37EUR 7.47 delivery Feb 2 - 13 - Modeling and Simulation in Python: An Introduction for Scientists and Engineers
PaperbackEUR28.78EUR28.78EUR 7.76 delivery Wed, Jan 28 - Serious Python: Black-Belt Advice on Deployment, Scalability, Testing, and More
PaperbackEUR28.88EUR28.88EUR 7.81 delivery Wed, Jan 28 - Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners
PaperbackEUR27.97EUR27.97EUR 9.52 delivery Wed, Jan 28 - How Computers Really Work: A Hands-On Guide to the Inner Workings of the Machine
PaperbackEUR32.72EUR32.72EUR 9.58 delivery Wed, Jan 28 - Math for Deep Learning: What You Need to Know to Understand Neural Networks
PaperbackEUR31.04EUR31.04EUR 7.56 delivery Wed, Jan 28 - Doing Math with Python: Use Programming to Explore Algebra, Statistics, Calculus, and More!
PaperbackEUR22.45EUR22.45EUR 7.47 delivery Thu, Jan 29 - The Ultimate Kali Linux Book: Harness Nmap, Metasploit, Aircrack-ng, and Empire for cutting-edge pentesting
PaperbackEUR30.41EUR30.41EUR 9.79 delivery Wed, Jan 28 - Network Basics for Hackers: How Networks Work and How They Break
PaperbackEUR31.78EUR31.78EUR 9.31 delivery Wed, Jan 28 - Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples
PaperbackEUR32.08EUR32.08EUR 7.98 delivery Wed, Jan 28 - Think Like a Programmer: An Introduction to Creative Problem Solving
PaperbackEUR35.89EUR35.89EUR 8.20 delivery Jan 30 - Feb 11 - Cryptanalysis: A Study of Ciphers and Their Solution (Dover Brain Games & Puzzles)
PaperbackEUR13.64EUR13.64EUR 7.05 delivery Wed, Jan 28 - Python for Data Science: A Hands-On Introduction
PaperbackEUR34.90EUR34.90EUR 7.71 delivery Wed, Jan 28 - Dead Simple Python: Idiomatic Python for the Impatient Programmer
PaperbackEUR36.32EUR36.32EUR 9.94 delivery Wed, Jan 28 - PowerShell for Sysadmins: Workflow Automation Made Easy
PaperbackEUR21.08EUR21.08EUR 7.98 delivery Wed, Jan 28 - How Cybersecurity Really Works: A Hands-On Guide for Total Beginners
PaperbackEUR29.86EUR29.86EUR 7.41 delivery Wed, Jan 28 - Python One-Liners: Write Concise, Eloquent Python Like a Professional
PaperbackEUR28.41EUR28.41EUR 7.76 delivery Wed, Jan 28 - Practical SQL, 2nd Edition: A Beginner's Guide to Storytelling with Data#1 Best SellerComputer Programming Structured Design
PaperbackEUR16.65EUR16.65EUR 8.20 delivery Feb 2 - 18 - The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography
PaperbackEUR8.81EUR8.81EUR 7.44 delivery Wed, Jan 28
Editorial Reviews
Review
—Ray Doyle, The Ethical Hacker Network
“I recommend this book for anyone who wants to learn Python/programming and is interested in security or puzzles.”
—Jeanne Boyarsky, Code Ranch
“A fantastic programming and cryptography course for any high school-aged child.”
—The Old Schoolhouse Magazine
About the Author
Product details
- Publisher : No Starch Press
- Publication date : January 23, 2018
- Edition : Illustrated
- Language : English
- Print length : 416 pages
- ISBN-10 : 1593278225
- ISBN-13 : 978-1593278229
- Item Weight : 1.75 pounds
- Reading age : 12 years and up
- Dimensions : 7 x 0.97 x 9.25 inches
- Best Sellers Rank: #198,900 in Books (See Top 100 in Books)
- #30 in Computer Cryptography
- #33 in Web Encryption
- #155 in Python Programming
- Customer Reviews:
About the author

Al Sweigart is a software developer and tech book author living in Houston. He has written several programming books for beginners, including Automate the Boring Stuff with Python. His books are freely available under a Creative Commons license at his website https://inventwithpython.com.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonCustomers say
Generated from the text of customer reviewsSelect to learn more
Reviews with images
Learn about computers, programming, and secret codes - all in one book!
Top reviews from the United States
There was a problem filtering reviews. Please reload the page.
- Reviewed in the United States on September 25, 2018Format: PaperbackVerified PurchaseFull 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!
- Reviewed in the United States on May 19, 2021Format: PaperbackVerified PurchaseCracking Codes with Python is a fantastic introduction to the Python programming language -- and coding in general -- using the super-fun theme of codebreaking. What's especially fun about this approach is that you can use these secret codes to send messages to your friends -- it's way better than invisible ink. As a student of computer history, I really appreciated the historical context provided for why codebreaking and ciphers are so important to the history of computers and technology. It's also great that the book provides a companion website with answers to all the practice problems at the end of each chapter, so that you can easily check your work.
I've recommended this book to folks who want to learn to code, and I'll keep doing so! By the end of it, you'll become quite the code-breaker and also a great Python programmer! I hope you enjoy it!
5.0 out of 5 starsCracking Codes with Python is a fantastic introduction to the Python programming language -- and coding in general -- using the super-fun theme of codebreaking. What's especially fun about this approach is that you can use these secret codes to send messages to your friends -- it's way better than invisible ink. As a student of computer history, I really appreciated the historical context provided for why codebreaking and ciphers are so important to the history of computers and technology. It's also great that the book provides a companion website with answers to all the practice problems at the end of each chapter, so that you can easily check your work.Learn about computers, programming, and secret codes - all in one book!
Reviewed in the United States on May 19, 2021
I've recommended this book to folks who want to learn to code, and I'll keep doing so! By the end of it, you'll become quite the code-breaker and also a great Python programmer! I hope you enjoy it!
Images in this review
- Reviewed in the United States on March 15, 2018Format: PaperbackVerified PurchaseAs a Python tutorial, it is superb - comprehensive, well organized and painless. Follow along with the exercises and you'll end up with a good working knowledge of the language. Each succeeding chapter introduces more and more complex and useful language constructs, each of which is identified in the accompanying text and clearly explained. Indeed, it is the use of constructs like lists and dictionaries that make Python the very valuable and powerful scripting tool that it is.
As a Code Cracking tutorial, it is, as declared in the book sub-title, an "Introduction". You'll see how various algorithmic strategies can be used against comparatively simple ciphers. The techniques include frequency analysis, word pattern matching and dictionary tests for decrypted text.
But the book is more about Learning Python than it is about Cracking Codes. Upon completing it you'll emerge a journeyman Python programmer and a novice cryptographer.
- Reviewed in the United States on August 3, 2022Format: PaperbackVerified PurchaseNot much to dislike here guys! It's good to have some basic knowledge of python in hand. However, if you don't just take it one chapter at a time. It's worth it!
- Reviewed in the United States on September 26, 2018Format: PaperbackVerified PurchasePrior to picking this book up I had made various attempts to learn how to program. I would go good for a while, but then I would get bored with it and move onto something else. The practice codes that other sources provide, just don't seem to hold interest due to them not really being useful. However, Cracking Codes with Python gets right into producing something that is comprehensive and useful. In this book you learn by doing. Then he walks you through line by line and explains everything in such a way that I gained an understanding of previously misunderstood concepts.
- Reviewed in the United States on June 13, 2018Format: PaperbackVerified PurchaseDecent content, should keep a beginner busy for some time. I picked project in there and modified it so it can decode and code stuff the way I like it and added a some what UI to it. Covers most of the basics, not very deeply though, but in my opinion good enough. Would recommend, but if ur looking into cyber security, look else where, as the encryption technique in here is really just practice for newer engineers. If your looking to start your python career somewhere and specifically cyber security, this is much better than the other books on the basics.
- Reviewed in the United States on November 18, 2021Format: KindleVerified PurchaseGood tutorial of basic python programming with the added bonus of interesting introduction to encrypting and decrypting old ciphers. It's probably the only tech book I ever read from cover to cover.
- Reviewed in the United States on January 6, 2020Format: PaperbackVerified PurchaseGreat Book really breaks down the fundamentals of cracking.
Top reviews from other countries
no-panicReviewed in Germany on September 16, 20215.0 out of 5 stars Great Book!
Format: KindleVerified PurchaseA great book, but only for those who are programming Python for the first time and also have no idea about the history of cryptography. But nothing else has been promised.
One can get into Python programming and cryptography without any prior knowledge. Each chapter introduces successively further into Python programming and at the same time into the history of cryptography.
The theory, the code and also the examples are very well explained.
Also, the presentation as an ebook for Kindle is also well done, which is not a given with technical books.
-
FedericoReviewed in Italy on March 17, 20225.0 out of 5 stars Il miglior libro da affiancare alla teoria
Format: PaperbackVerified PurchaseSono uno studente del corso Cryptography e cercavo un libro che si approcciasse all'aspetto pratico della crittografia utilizzando Python e ho trovato questo MAGNIFICO libro. È proprio quello che cercavo!
Il libro è molto ben strutturato seguendo la tipica impronta americana che si focalizza più sulla pratica che sulla teoria (che ho apprezzato molto).
La qualità del libro è notevole e la carta è buona, lo consiglio a tutti gli interessati alla materia.
Sono uno studente del corso Cryptography e cercavo un libro che si approcciasse all'aspetto pratico della crittografia utilizzando Python e ho trovato questo MAGNIFICO libro. È proprio quello che cercavo!5.0 out of 5 stars
FedericoIl miglior libro da affiancare alla teoria
Reviewed in Italy on March 17, 2022
Il libro è molto ben strutturato seguendo la tipica impronta americana che si focalizza più sulla pratica che sulla teoria (che ho apprezzato molto).
La qualità del libro è notevole e la carta è buona, lo consiglio a tutti gli interessati alla materia.
Images in this review
Mehedi Hasan ShuvoReviewed in Australia on January 20, 20205.0 out of 5 stars Love it.
Format: PaperbackVerified PurchaseAlways interested in cipher, cryptography, this book guiding me in the right direction for my enthusiasm.
Anustup kanrarReviewed in India on April 2, 20215.0 out of 5 stars 5 stars ! Awesome page and cover quality
Format: PaperbackVerified PurchaseLoved it ! 😁 Fastest delivery by Amazon! The page quality and cover is awesome
Gr3g0ryReviewed in Canada on February 1, 20205.0 out of 5 stars Great Book
Format: PaperbackVerified PurchaseI'm addicted to these No starch Python books.
Cracking Codes is a great starting point for ciphers and encryprions. Well explained easy to follow.
Worth every cent!!
















