press starch no THE MANGA GUIDE TO CRYPTOGRAPHY MASAAKI MITANI SHINICHI SATO IDERO HINOKI AND VERTE CORP
Contents Preface xi Prologue 1 1 The Foundations of Encryption 15 What Is a Cipher 17 Shannon’s Encryption Model 20 The Relationship Between the Encryption Key and the Decryption Key 21 Classic Encryption Methods 24 Caesar Cipher 24 Substitution Cipher 25 Polyalphabetic Cipher 26 Transposition Cipher 27 Cipher Security 28 The Substitution Cipher’s Key Space 31 Permutation Combination and Frequency Analysis 32 The Polyalphabetic Cipher’s Key Space 33 The Transposition Cipher’s Key Space 34 When Breaking Classical Encryption is Possible 37 Perfectly Secure Encryption 37 2 Symmetric-Key Algorithms 47 Binary Digits and Logical Operators 48 Symmetric-Key Algorithms 59 Stream Ciphers 65 Block Ciphers 68 CBC Mode 71 DES Ciphers 72 The Basic Configuration of a Feistel Cipher 73 Involution 74 Generating DES Encryption Subkeys 77 The DES Round Function f 78 The Full Structure of DES Encryption and Decryption 79 3-DES Encryption and AES Encryption 80 An Outline of AES 85 Simplified DES Encryption and Decryption 89
Converting Data into Binary 89 Generating a DES Ciphertext 90 Perform the Initial Permutation 91 Separate Data into Higher and Lower-Order Bits 92 Feistel Rounds Variant 92 Swap the Higher and Lower-Order Bits 95 Perform the Final Permutation 95 Decrypting a DES Ciphertext 97 Perform the Initial Permutation 97 Separate Data into Higher and Lower-Order Bits 97 Round 1 97 Round 2 98 Generating DES Keys 100 Perform Permuted Choice PC 1 101 Rotate the Bits 102 Perform Permuted Choice PC 2 102 Rotate the Bits Again 103 Compress the Bits 103 How Reduced DES Differs from Real DES 104 3 Public-Key Encryption 105 The Basics of Public-Key Encryption 106 Mathematical Dependencies of Public-Key Encryption 115 One-Way Functions 116 The Birth of RSA Encryption 119 Prime Numbers and Integer Factorization 120 Types of Primality Tests 129 Modulo Operations 134 Addition and Subtraction in Modulo Operations 137 Multiplication and Division of Modulo Operations 146 Fermat’s Little Theorem and Euler’s Theorem 152 Fermat the Father of Number Theory 153 Fermat’s Method and Pseudoprime Numbers 155 Euler’s Theorem 156 The Mathematician Euler 157 Euler Function on the Product of Two Prime Numbers 158 The Structure of RSA Encryption 161 RSA Encryption Encryption and Decryption 163 Generating an RSA Encryption Key 165 Verifying That the Public Key e and Private Key d Work in RSA Encryption 166 How to Make Public Keys and Private Keys 167 Generating a Ciphertext Using RSA 169 Decrypting a Ciphertext Using RSA 171 Contents