Cracking Codes with Python: An Introduction to Building and Breaking Ciphers

ISBN-13: 978-1593278229, ISBN-10: 1593278225
4.3 on Goodreads
(158)
Loading Images...
Double-tap to zoom
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
Buy New
-44% $22.30
FREE delivery Sunday, May 24 on orders shipped by Amazon over $35
Ships from: Amazon.com
Sold by: Amazon.com
$22.30 with 44 percent savings
List Price: $39.99
FREE delivery Sunday, May 24 on orders shipped by Amazon over $35
Or Prime members get FREE delivery Thursday, May 21. Order within 1 hr 1 min. Join Prime
Only 3 left in stock (more on the way).
$$22.30 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$22.30
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Shipper / Seller
Amazon.com
Amazon.com
Shipper / Seller
Amazon.com
Returns
FREE 30-day refund/replacement
FREE 30-day refund/replacement
Quick refund
Usually issued within 24 hours. See exceptions
FREE return
At least one free return option available.
Convenient dropoff
At any of our 50,000 US locations.
See return policy
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
Gift options
Available at checkout
Available at checkout This item is a gift. Change
Gift options
At checkout, you can add a custom message, a gift receipt for easy returns and have the item gift-wrapped
$9.05
May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less
In stock
$$22.30 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$22.30
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Access codes and supplements are not guaranteed with used items.
Ships from and sold by ThriftBooks-Baltimore.
{"mobile_buybox_group_1":[{"displayPrice":"$22.30","priceAmount":22.30,"currencySymbol":"$","integerValue":"22","decimalSeparator":".","fractionalValue":"30","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"2g%2BOyMcUW8vio8DxWLgnY9fTwngfUSZmodwy5lS7x%2BPUkLGShKJ%2F81Iwf6%2FzXsU81XDqwi8KL%2FyxnNI4w%2FrMuoZo7FBYYdemVjXjw9qXj314svbW9kVlSGZyX50E8muEDN0PMTQMyCheqbn4MZOVcw%3D%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$9.05","priceAmount":9.05,"currencySymbol":"$","integerValue":"9","decimalSeparator":".","fractionalValue":"05","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"2g%2BOyMcUW8vio8DxWLgnY9fTwngfUSZm82BpXe08rG53JRD8%2Ft4g6AEyF1Md%2B%2F8lWBr%2B0GC%2ByxsuyZDBQea7ZfKEif3zSGsqA8AgmaV5hoT7jI9LZmrxC305lYUUpSLp%2F2kuGIbx5jHHNTIsw9sZxtOTdFrhjGhpCTSOHsCE7EZsDEcfVdE8Ohx2i7fxjQlY","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Book details

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.
Learn how to program in Python while making and breaking ciphers—algorithms used to create and send secret messages! 

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!

Review

“Definitely worth the read even as an experienced Python developer. I learned more about cryptography and even a few new Python tricks.”
—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

Al Sweigart is a professional software developer who teaches programming to kids and adults. He is the author of Automate the Boring Stuff with Python, Invent Your Own Computer Games with Python, and Scratch Programming Playground, also from No Starch Press. His programming tutorials can be found at inventwithpython.com.

About the author

Follow authors to get new release updates, plus improved recommendations.
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

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.

Frequently bought together

+
Python Crash Course, 3rd Edition: A Hands-On, Project-Based Introduction to Programming
+
The Big Book of Small Python Projects: 81 Easy Practice Programs

Frequently bought together

Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.
Total price: $00
Details
Added to Cart
Some of these items ship sooner than the others.
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Features & details

Features

  • Book - cracking codes with python: an introduction to building and breaking ciphers
  • Language: english
  • Binding: paperback

Product information

ASIN 1593278225
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.05 x 0.94 x 9.25 inches
Best Sellers Rank
Customer Reviews 4.7 out of 5 stars 397Reviews

Customers say

Customers find this book to be a brilliant primer on basic Python programming practices. They appreciate its comprehensive approach, with one customer noting it covers most of the basics.
AI Generated from the text of customer reviews

Select to learn more

14 customers mention content, 14 positive, 0 negative
Customers praise the book's content, describing it as an excellent introduction to ciphers and Python programming, with one customer noting how it makes learning the language more engaging.AI Generated from the text of customer reviews
Great Book really breaks down the fundamentals of cracking.Read more
Nice book with all concepts clearly explainedRead more
Reading, and as a Python primer; touching on a bit of crypto history in the process.Read more
Good book to learn python off of.Read more
6 customers mention comprehensive, 6 positive, 0 negative
Customers find the book comprehensive and outstanding as a resource, with one customer noting it covers most of the basics and provides historical context.AI Generated from the text of customer reviews
...Codes with Python gets right into producing something that is comprehensive and useful. In this book you learn by doing....Read more
...Covers most of the basics, not very deeply though, but in my opinion good enough....Read more
...As a student of computer history, I really appreciated the historical context provided for why codebreaking and ciphers are so important to the...Read more
...types and decision structures through loops, data structures, common Python modules, and other advanced concepts....Read more

Submit a report

A few common reasons customers report reviews:
  • Harassment, profanity
  • Spam, advertisement, promotions
  • Given in exchange for cash, discounts
When we get your report, we'll check if the review meets our Community guidelines. If it doesn't, we'll remove it.
Sorry we couldn't load the review
Thank you for your feedback

Sorry, there was an error

Please try again later.

Top reviews from the United States

  • 5 out of 5 stars
    Verified Purchase

    An excellent book of Python exercises and basic cryptography primer!

    Reviewed in the United States on September 25, 2018
    Format: Paperback

    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!

    30 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Verified Purchase

    Learn about computers, programming, and secret codes - all in one book!

    Reviewed in the United States on May 19, 2021
    Format: Paperback

    Cracking 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!

    One person found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Verified Purchase

    More about learning Python than it is about Cracking Codes

    Reviewed in the United States on March 15, 2018
    Format: Paperback

    As 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.

    57 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 4 out of 5 stars
    Verified Purchase

    Good introduction, it help strengthen what I already knew and exposed me too newer content c

    Reviewed in the United States on August 3, 2022
    Format: Paperback

    Not 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!

    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Verified Purchase

    Excellent Resource!

    Reviewed in the United States on September 26, 2018
    Format: Paperback

    Prior 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.

    16 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Verified Purchase

    Good stuff

    Reviewed in the United States on June 13, 2018
    Format: Paperback

    Decent 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.

    10 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Verified Purchase

    Enjoayble

    Reviewed in the United States on November 18, 2021
    Format: Kindle

    Good 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.

    3 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Verified Purchase

    Does what the title says

    Reviewed in the United States on January 6, 2020
    Format: Paperback

    Great Book really breaks down the fundamentals of cracking.

    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

Top reviews from other countries

  • 5 out of 5 stars
    Verified Purchase

    Awesome quality

    Reviewed in India on August 6, 2020
    Format: Paperback

    Quality of the book is awesome. Gave 5 start for the book quality and availability. Delivery was on time. Over all awsome experience

    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Verified Purchase

    Great Book!

    Reviewed in Germany on September 16, 2021
    Format: Kindle

    A 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.

    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • 5 out of 5 stars
    Verified Purchase

    Looking forward to the study.

    Reviewed in Australia on February 6, 2026
    Format: Paperback

    I haven't sat down in earnest to study it. But, having flicked through the contents, it seems an good way to learn.

    Sending feedback...
    Thanks, we'll investigate in the next few days.
  • Translated by Amazon
    See original
  • 5 out of 5 stars
    Verified Purchase

    Il miglior libro da affiancare alla teoria

    Reviewed in Italy on March 17, 2022
    Format: Paperback

    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!

    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.

    Sending feedback...
    Thanks, we'll investigate in the next few days.
    Translated from Italian by Amazon
    See original
  • 5 out of 5 stars
    Verified Purchase

    Great Book

    Reviewed in Canada on February 1, 2020
    Format: Paperback

    I'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!!

    Sending feedback...
    Thanks, we'll investigate in the next few days.

How customer reviews and ratings work

Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.Learn more how customers reviews work on Amazon