Elementary Cryptanalysis a Mathematical Approach Abraham Sinkov
Total Page:16
File Type:pdf, Size:1020Kb
ELEMENTARY CRYPTANALYSIS A MATHEMATICAL APPROACH ABRAHAM SINKOV The Mathematical Association of America New Mathematical Library ELEMENTARY CRYPTANALYSIS A MATHEMATICAL APPROACH by Abraham Sinkov Arizona Stai,e University with a supplement by Paul L. Irwin Randolph Macon Woman's College 22 THE MATHEMATICAL ASSOCIATION OF AMERICA FOR Delia, Judy, Michael Illustrations by George H. Buehler Fifth Printing ©Copyright 1966 by The Mathematical Association of America (Inc.) All rights reserved under International and Pan-American Copyright Conventions. Published in Washington, D.C. by The Mathematical Association of America Library of Congress Catalog Card Number: 72-89953 Complete Set ISBN-0-88385-600-X Volume 22: ISBN-0-88385-622-0 Manufactured in the United States of America Note to the Reader his book is one of a series written by professional mathematicians Tin order to make some important mathematical ideas interesting and understandable to a large audience of high school students and laymen. Most of the volumes in the New Mathematical Library cover topics not usually included in the high school curriculum; they vary in difficulty, and, even within a single book, some parts require a greater degree of concentration than others. Thus, while the reader needs little technical knowledge to understand most of these books, he will have to make an intellectual effort. If the reader has so far encountered mathematics only in classroom work, he should keep in mind that a book on mathematics cannot be read quickly. Nor must he expect to understand all parts of the book on first reading. He should feel free to skip complicated parts and return to them later; often an argument will be clarified by a subse quent remark. On the other hand, sections containing thoroughly familiar material may be read very quickly. The best way to learn mathematics is to do mathematics, and each book includes problems, some of which may require considerable thought. The reader is urged to acquire the habit of reading with paper and pencil in hand; in this way mathematics will become in creasingly meaningful to him. The authors and editorial committee are interested in reactions to the books in this series and hope that readers will write to: Anneli Lax, Editor, New Mathematical Library, NEw YoRK UNIVERSITY, THE CouRANT INSTITUTE OF MATHEMATICAL SCIENCES, 251 Mercer Street, New York, N. Y. 10012. The Editors NEW MATHEMATICAL LIBRARY 1 Numbers: Rational and Irrational by Ivan Niven 2 What is Calculus About? by W. W. Sawyer 3 An Introduction to Inequalities by E. F. Beckenbach and R. Bellman 4 Geometric Inequalities by N. D. Kazarinoff 5 The Contest Problem Book I Annual High School Mathematics Examination$ 1950-1960. Compiled and with solutions by Charles T. Salkind 6 The Lore of Large Numbers, by P. /. Davis 7 Uses of Infinity by Leo Zippin 8 Geometric Transformations I by I. M. Yaglom, translated by A. Shields 9 Continued Fractions by Carl D. Olds 10 Graphs and Their Uses by Oystein Ore 11 } Hungarian Problem Books I and II, Based on the Eotvos 12 Competitions 1894-1905 and 1906-1928, translated by E. Rapaport 13 Episodes from the Early History of Mathematics by A. Aaboe 14 Groups and Their Graphs by I. Grossman and W. Magnus 15 The Mathematics of Choice or How to Count Without Counting oy Ivan Niven 16 From Pythagoras to Einstein by K. 0. Friedrichs 17 The Contest Problem Book II Annual High School Mathematics Examinations 1961-1965. Compiled and with solutions by Charles T. Salkind 18 First Concepts of Topology by W. G. Chinn and N. E. Steenrod 19 Geometry Revisited by H. S. M. Coxeter and S. L. Greitzer 20 Invitation to Number Theory by Oystein Ore 21 Geometric Transformations II by I. M. Yaglom, translated by A. Shields 22 Elementary Cryptanalysis-A Mathematical Approach by A. Sinkov 23 Ingenuity in Mathematics by Ross Honsberger 24 Geometric Transformations III by I. M. Yaglom, translated by A. Shenitzer 25 The Contest Problem Book III Annual High School Mathematics Examinations 1966-1972. Compiled and with solutions by C. T. Salkind and/. M. Earl 26 Mathematical Methods in Science by George Pblya 27 International Mathematical Olympiads-1959-1977. Compiled and with solu tions by S. L. Greitzer 28 The Mathematics of Games and Gambling by Edward W. Packel 29 The Contest Problem Book IV Annual High School Mathematics Examinations 1973-1982. Compiled and with solutions by R. A. Artino, A. M. Gaglione and N. Shell 30 The Role of Mathematics in Science by M. M. Schiffer and L. Bowden 31 International Mathematical Olympiads 1978-1985 and forty supplemePt'U)' problems. Compiled and with solutions by Murray S. Klamkin 32 Riddles of the Sphinx (and Other Mathematical Puzzle Tales) by Martin Gardner Other titles in preparation. Contents Introduction 1 Chapter 1 Monoalphabetic Ciphers Using Direct Standard Alphabets 4 1.1 The Caesar Cipher 4 1.2 Modular arithmetic 6 1.3 Direct standard alphabets 10 1.4 Solution of direct standard alphabets by completing the plain component 13 1.5 Solving direct standard alphabets by frequency considerations 16 1.6 Alphabets based on decimations of the normal sequence 22 1.7 Solution of decimated standard alphabets 28 1.8 Monoalphabets based on linear transformations 32 Chapter 2 General Monoalphabetic Substitution 37 2.1 Mixed alphabets 37 2.2 Solution of mixed alphabet ciphers 40 2.3 Solution of monoalphabets in five letter groupings 47 2.4 Monoalphabets with symbols as cipher equivalents 55 vii viii CONTENTS Chapter 3 Polyalphabetic Substitution 58 3.1 Polyalphabetic ciphers 58 3.2 Recognition of polyalphabetic ciphers 61 3.3 Determination of number of alphabets 70 3.4 Solution of individual alphabets, if standard 75 3.5 Polyalphabetic ciphers with a mixed plain sequence 78 3.6 Matching alphabets 82 3.7 Reduction of a polyalphabetic cipher to a monoalphabet 93 3.8 Polyalphabetic ciphers with mixed cipher sequences 95 3.9 General comments about polyalphabetic ciphers 110 Chapter 4 Polygraphic Systems 113 4.1 Digraphic ciphers based on linear transforma- tions-matrices 113 4.2 Multiplication of matrices-inverses 121 4.3 Involutory transformations 128 4.4 Recognition of digraphic ciphers 130 4.5 Solution of a linear transformation 132 4.6 How to make the Hill System more secure 140 Chapter 5 Transposition 142 5.1 Columnar transposition 142 5.2 Solution of transpositions with completely filled rectangles 149 5.3 Incompletely filled rectangles 152 5.4 Solution of incompletely filled rectangles- probable word method 154 5.5 Incompletely filled rectangles-general case 160 5.6 Repetitions between messages; identical length messages 169 CONTENTS ix Appendix A Table of Digraphic Frequencies 175 Appendix B Log Weights 176 Appendix C Frequencies of Letters of the Alphabet 177 Appendix D Frequencies of Initial Letters of Words 178 Appendix E Frequencies of Final Letters of Words 179 Solutions to Exercises 180 Suggestions for Further Reading 184 Index 187 Supplement-Computer Programs by P. L. Irwin 191 I. Trigraphic Frequency Distributions 195 II. Index to Coincidence 201 III. Matching Alphabets 204 IV. Trigraphic Frequency Distribution for Individual Alphabets of a Periodic Polyalphabetic Cipher 208 V. Digraphic Frequency Distributions 216 Introduction To a very great extent, mankind owes its progress to the ability to communicate, and a key aspect in this ability is the capability of communicating in writing. From the earliest days of writing, there have been occasions when individuals have desired to limit their information to a restricted group of people. They had secrets they wanted to keep. To this end, such individuals developed ideas by means of which their communications could be made unintelligible to those who had not been provided with the special information needed for decipherment. The general techniques used to accomplish such a purpose, i.e. the hiding of the meaning of messages, constitute the study known as cryptography. Before the development of postal systems and electrical trans mission of information, the usual manner of sending a communication was by private messenger. Even under these circumstances the use of the concealment tactics of cryptography was often advisable because of the possibility that the messenger might be apprehended or prove disloyal. In recent times a message transmitted by radio could be copied by anyone having appropriate equipment and listening to the right frequency at the right time. In such a case, if the sender desired privacy of communication he would be required to employ some method of cryptographic concealment. Now, just as the sender of the message attempted to conceal his information from any but the desired recipient, there would be individuals very much interested in determining what the message said-most probably the very individuals from whom the sender was trying to keep the information. Should such an individual obtain-in one way or another-a copy of the cryptographed message, he would attempt to unravel the secret it carried. But of course his attempt would have to be made without a knowledge of the cryptographic 1 2 CRYPTANALYSIS details employed to hide the content. Efforts aimed at reading a secret message in this way come under the heading of the study called cryptanalysis. History abounds with accounts of situations where successful cryptanalysis proved a most important element in achieving diplo matic successes, gaining military victories apprehending criminals, preventing espionage. Cryptanalysis has contributed to the trans lation of historical documents which came to light in official archives and were found to be in secret language. It has even aided in the reconstruction of lost languages which had been dead for so long that nothing was known about them so that they were, in effect, secret languages. These aspects of the history and drama of crypt analysis are adequately treated in many other sources, and are not discussed in this book.