




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































B U I L D I N G A N D B R E A K I N G C I P H E R S
“Aaron was part of an army of citizens that believes democracy only
works when the citizenry are informed, when we know about our rights—and our obligations. An army that believes we must make justice and knowledge available to all—not just the well born or those that have grabbed the reins of power—so that we may govern
ourselves more wisely. When I see our army, I see Aaron Swartz and
my heart is broken. We have truly lost one of our better angels.” —Carl Malamud
about the author
about the technical reviewers
C o n t e n t s i n d e t a i l
Who Should Read This Book? xxii What’s in This Book? xxiii How to Use This Book xxiv Typing Source Code xxiv Checking for Typos xxv Coding Conventions in This Book xxv Online Resources xxv Downloading and Installing Python xxv Windows Instructions xxvi macOS Instructions xxvi Ubuntu Instructions xxvi Downloading pyperclip py xxvi Starting IDLE xxvii Summary xxviii
What Is Cryptography? 2 Codes vs Ciphers 3 The Caesar Cipher 4 The Cipher Wheel 4 Encrypting with the Cipher Wheel 5 Decrypting with the Cipher Wheel 6 Encrypting and Decrypting with Arithmetic 7 Why Double Encryption Doesn’t Work 8 Summary 8 Practice Questions 9
Some Simple Math Expressions 12 Integers and Floating-Point Values 13 Expressions 13 Order of Operations 14 Evaluating Expressions 14 Storing Values with Variables 15 Overwriting Variables 17 Variable Names 18 Summary 18 Practice Questions 19
xii Contents in Detail
Contents in Detail xv