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

Cracking Codes with Python: An Introduction to Building and Breaking Ciphers — page 5
The Electronic Frontier Foundation a young digital civil liberties orga nization represented Bernstein in Bernstein v United States For the first time ever the courts ruled that written software code was speech protected by the First Amendment and that the export control laws on encryption vio lated Bernstein’s First Amendment rights Now strong cryptography is at the foundation of a large part of the global economy safeguarding businesses and e-commerce sites used by millions of internet shoppers every day The intelligence community’s pre dictions that encryption software would become a grave national security threat were unfounded But as recently as the 1990s spreading this knowledge freely as this book does would have landed you in prison for arms trafficking For a more detailed history of the legal battle for freedom of cryptography read Steven Levy’s book Crypto How the Code Rebels Beat the Government Saving Privacy in the Digital Age Penguin 2001 who should read this Book Many books teach beginners how to write secret messages using ciphers A couple of books teach beginners how to hack ciphers But no books teach beginners how to program computers to hack ciphers This book fills that gap This book is for those who are curious about encryption hacking or cryptography The ciphers in this book except for the public key cipher in Chapters 23 and 24 are all centuries old but any laptop has the compu tational power to hack them No modern organizations or individuals use these ciphers anymore but by learning them you’ll learn the foundations cryptography was built on and how hackers can break weak encryption no t e The ciphers you’ll learn in this book are fun to play with but they don’t provide true security Don’t use any of the encryption programs in this book to secure your actual files As a general rule you shouldn’t trust the ciphers that you create Real-world ciphers are subject to years of analysis by professional cryptographers before being put into use This book is also for people who have never programmed before It teaches basic programming concepts using the Python programming lan guage which is one of the best languages for beginners It has a gentle learning curve that novices of all ages can master yet it’s also a power ful language used by professional software developers Python runs on Windows macOS Linux and even the Raspberry Pi and it’s free to down load and use See Downloading and Installing Python on page xxv for instructions In this book I’ll use the term hacker often The word has two defini tions A hacker can be a person who studies a system such as the rules of a cipher or a piece of software to understand it so well that they’re not limited by that system’s original rules and can modify it in creative ways xxii Introduction