Download Introduction to Cryptography with Coding Theory 3rd Edition Trappe ebook All Chapters PDF
Download Introduction to Cryptography with Coding Theory 3rd Edition Trappe ebook All Chapters PDF
com
https://textbookfull.com/product/introduction-to-
cryptography-with-coding-theory-3rd-edition-trappe/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/introduction-to-cryptography-with-
coding-theory-3rd-edition-lawrence-c-washington-wade-trappe/
textboxfull.com
https://textbookfull.com/product/information-theory-coding-and-
cryptography-3rd-edition-ranjan-bose/
textboxfull.com
https://textbookfull.com/product/an-introduction-to-number-theory-
with-cryptography-second-edition-kraft/
textboxfull.com
https://textbookfull.com/product/an-introduction-to-number-theory-
with-cryptography-2nd-edition-james-kraft/
textboxfull.com
Introduction to Modern Cryptography 3rd Edition Jonathan
Katz
https://textbookfull.com/product/introduction-to-modern-
cryptography-3rd-edition-jonathan-katz/
textboxfull.com
https://textbookfull.com/product/introduction-to-analytic-and-
probabilistic-number-theory-3rd-edition-gerald-tenenbaum/
textboxfull.com
https://textbookfull.com/product/an-introduction-to-the-mathematical-
theory-of-inverse-problems-3rd-edition-andreas-kirsch/
textboxfull.com
https://textbookfull.com/product/an-introduction-to-symbolic-dynamics-
and-coding-2nd-edition-douglas-lind/
textboxfull.com
INTRODUCTION TO
CRYPTOGRAPHY
with Coding Theory
3rd edition
Wade Trappe
Wireless Information Network Laboratory
and the Electrical and Computer Engineering Department
Rutgers University
Lawrence C. Washington
Department of Mathematics
University of Maryland
Portfolio Manager: Chelsea Kharakozoua
Content Manager: Jeff Weidenaar
Content Associate: Jonathan Krebs
Content Producer: Tara Corpuz
Managing Producer: Scott Disanno
Producer: Jean Choe
Manager, Courseware QA: Mary Durnwald
Product Marketing Manager: Stacey Sveum
Product and Solution Specialist: Rosemary Morten
Senior Author Support/Technology Specialist: Joe Vetere
Manager, Rights and Permissions: Gina Cheselka
Text and Cover Design, Production Coordination, Composition, and Illustrations:
Integra Software Services Pvt. Ltd
Manufacturing Buyer: Carol Melville, LSC Communications
Cover Image: Photographer is my life/Getty Images
Copyright c 2020, 2006, 2002 by Pearson Education, Inc. 221 River Street, Hoboken, NJ
07030. All Rights Reserved. Printed in the United States of America. This publication is protected
by copyright, and permission should be obtained from the publisher prior to any prohibited
reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic,
mechanical, photocopying, recording, or otherwise. For information regarding permissions, request
forms and the appropriate contacts within the Pearson Education Global Rights & Permissions
department, please visit www.pearsoned.com/permissions/.
Text Credit: Page 23 Declaration of Independence: A Transcription, The U.S. National Archives and
Records Administration.
PEARSON, ALWAYS LEARNING, and MYLAB are exclusive trademarks owned by Pearson
Education, Inc. or its affiliates in the U.S. and/or other countries.
Unless otherwise indicated herein, any third-party trademarks that may appear in this work are the
property of their respective owners and any references to third-party trademarks, logos or other trade
dress are for demonstrative or descriptive purposes only. Such references are not intended to imply any
sponsorship, endorsement, authorization, or promotion of Pearson’s products by the owners of such
marks, or any relationship between the owner and Pearson Education, Inc. or its affiliates, authors,
licensees or distributors.
ScoutAutomatedPrintCode
Rental
ISBN-10: 0-13-673154-6
ISBN-13: 978-0-13-673154-2
Print Offer
ISBN-10: 0-13-486099-3
ISBN-13: 978-0-13-486099-2
Contents
Preface ix
2 Classical Cryptosystems 10
2.1 Shift Ciphers . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Affine Ciphers . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 The Vigenère Cipher . . . . . . . . . . . . . . . . . . . . . . 14
2.4 Substitution Ciphers . . . . . . . . . . . . . . . . . . . . . . . 20
2.5 Sherlock Holmes . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.6 The Playfair and ADFGX Ciphers . . . . . . . . . . . . . . . 26
2.7 Enigma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.9 Computer Problems . . . . . . . . . . . . . . . . . . . . . . . 37
iii
iv Contents
18 Games 349
18.1 Flipping Coins over the Telephone . . . . . . . . . . . . . . . 349
18.2 Poker over the Telephone . . . . . . . . . . . . . . . . . . . . 351
18.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
ix
x Preface
• The short section on the one-time pad has been expanded to become
Chapter 4, which includes sections on multiple use of the one-time
pad, perfect secrecy, and ciphertext indistinguishability.
• Added Chapter 14, “What Can Go Wrong,” which shows what can hap-
pen when cryptographic algorithms are used or designed incorrectly.
Preface xi
People have always had a fascination with keeping information away from
others. As children, many of us had magic decoder rings for exchanging
coded messages with our friends and possibly keeping secrets from parents,
siblings, or teachers. History is filled with examples where people tried to
keep information secret from adversaries. Kings and generals communicated
with their troops using basic cryptographic methods to prevent the enemy
from learning sensitive military information. In fact, Julius Caesar report-
edly used a simple cipher, which has been named after him.
As society has evolved, the need for more sophisticated methods of pro-
tecting data has increased. Now, with the information era at hand, the need
is more pronounced than ever. As the world becomes more connected, the
demand for information and electronic services is growing, and with the in-
creased demand comes increased dependency on electronic systems. Already
the exchange of sensitive information, such as credit card numbers, over the
Internet is common practice. Protecting data and electronic systems is cru-
cial to our way of living.
The techniques needed to protect data belong to the field of cryptogra-
phy. Actually, the subject has three names, cryptography, cryptology,
and cryptanalysis, which are often used interchangeably. Technically, how-
ever, cryptology is the all-inclusive term for the study of communication over
nonsecure channels, and related problems. The process of designing systems
to do this is called cryptography. Cryptanalysis deals with breaking such
systems. Of course, it is essentially impossible to do either cryptography or
cryptanalysis without having a good understanding of the methods of both
areas.
Often the term coding theory is used to describe cryptography; how-
ever, this can lead to confusion. Coding theory deals with representing
input information symbols by output symbols called code symbols. There
are three basic applications that coding theory covers: compression, secrecy,
and error correction. Over the past few decades, the term coding theory has
1
2 Chapter 1. Overview of Cryptography and Its Applications
Encryption Decryption
Key Key
plaintext ciphertext
Alice Encrypt Decrypt Bob
Eve
Which case we’re in depends on how evil Eve is. Cases (3) and (4) relate
to issues of integrity and authentication, respectively. We’ll discuss these
shortly. A more active and malicious adversary, corresponding to cases (3)
and (4), is sometimes called Mallory in the literature. More passive observers
(as in cases (1) and (2)) are sometimes named Oscar. We’ll generally use
only Eve, and assume she is as bad as the situation allows.
carefully directed around the outpost so that the transmissions would not
be stopped.
One of the most important assumptions in modern cryptography is Ker-
ckhoffs’s principle: In assessing the security of a cryptosystem, one should
always assume the enemy knows the method being used. This principle was
enunciated by Auguste Kerckhoffs in 1883 in his classic treatise La Cryp-
tographie Militaire. The enemy can obtain this information in many ways.
For example, encryption/decryption machines can be captured and ana-
lyzed. Or people can defect or be captured. The security of the system
should therefore be based on the key and not on the obscurity of the algo-
rithm used. Consequently, we always assume that Eve has knowledge of the
algorithm that is used to perform encryption.
was assumed known, and the security depended on keeping the (symmet-
ric) key private or unknown to adversaries. In public key cryptography, the
method and the encryption key are made public, and everyone knows what
must be done to find the decryption key. The security rests on the fact (or
hope) that this is computationally infeasible. It’s rather paradoxical that an
increase in the power of cryptographic algorithms over the years has corre-
sponded to an increase in the amount of information given to an adversary
about such algorithms.
Public key methods are very powerful, and it might seem that they
make the use of symmetric key cryptography obsolete. However, this added
flexibility is not free and comes at a computational cost. The amount of
computation needed in public key algorithms is typically several orders of
magnitude more than the amount of computation needed in algorithms such
as DES or AES/Rijndael. The rule of thumb is that public key methods
should not be used for encrypting large quantities of data. For this reason,
public key methods are used in applications where only small amounts of
data must be processed (for example, digital signatures and sending keys to
be used in symmetric key algorithms).
Within symmetric key cryptography, there are two types of ciphers:
stream ciphers and block ciphers. In stream ciphers, the data are fed into
the algorithm in small pieces (bits or characters), and the output is produced
in corresponding small pieces. We discuss stream ciphers in Chapter 5. In
block ciphers, however, a block of input bits is collected and fed into the
algorithm all at once, and the output is a block of bits. Mostly we shall be
concerned with block ciphers. In particular, we cover two very significant
examples. The first is DES, and the second is AES, which was selected in
the year 2000 by the National Institute for Standards and Technology as the
replacement for DES. Public key methods such as RSA can also be regarded
as block ciphers.
Finally, we mention a historical distinction between different types of
encryption, namely codes and ciphers. In a code, words or certain letter
combinations are replaced by codewords (which may be strings of symbols).
For example, the British navy in World War I used 03680C, 36276C, and
50302C to represent shipped at, shipped by, and shipped from, respectively.
Codes have the disadvantage that unanticipated words cannot be used. A
cipher, on the other hand, does not use the linguistic structure of the message
but rather encrypts every string of characters, meaningful or not, by some
algorithm. A cipher is therefore more versatile than a code. In the early days
of cryptography, codes were commonly used, sometimes in conjunction with
ciphers. They are still used today; covert operations are often given code
names. However, any secret that is to remain secure needs to be encrypted
with a cipher. In this book, we’ll deal exclusively with ciphers.
number (see Chapter 9) would not be factored within the foreseeable fu-
ture. However, advances in algorithms and computer architecture have made
such factorizations fairly routine (although they still require substantial
computing resources), so now numbers of several hundred digits are rec-
ommended for security. But if a full-scale quantum computer is ever built,
factorizations of even these numbers will be easy, and the whole RSA scheme
(along with many other methods) will need to be reconsidered.
A natural question, therefore, is whether there are any unbreakable cryp-
tosystems, and, if so, why aren’t they used all the time?
The answer is yes; there is a system, known as the one-time pad, that
is unbreakable. Even a brute force attack will not yield the key. But the
unfortunate truth is that the expense of using a one-time pad is enormous.
It requires exchanging a key that is as long as the plaintext, and even then
the key can only be used once. Therefore, one opts for algorithms that,
when implemented correctly with the appropriate key size, are unbreakable
in any reasonable amount of time.
An important point when considering key size is that, in many cases,
one can mathematically increase security by a slight increase in key size,
but this is not always practical. If you are working with chips that can
handle words of 64 bits, then an increase in the key size from 64 to 65 bits
could mean redesigning your hardware, which could be expensive. Therefore,
designing good cryptosystems involves both mathematical and engineering
considerations.
Finally, we need a few words about the size of numbers. Your intuition
might say that working with a 20-digit number takes twice as long as working
with a 10-digit number. That is true in some algorithms. However, if you
count up to 1010 , you are not even close to 1020 ; you are only one 10 billionth
of the way there. Similarly, a brute force attack against a 60-bit key takes
a billion times longer than one against a 30-bit key.
There are two ways to measure the size of numbers: the actual magnitude
of the number n, and the number of digits in its decimal representation (we
could also use its binary representation), which is approximately log10 (n).
The number of single-digit multiplications needed to square a k-digit number
n, using the standard algorithm from elementary school, is k 2 , or approx-
imately (log10 n)2 . The number of divisions needed to factor a number n
by dividing by all primes up to the square root of n is around n1/2 . An
algorithm that runs in time a power of log n is much more desirable than
one that runs in time a power of n. In the present example, if we double the
number of digits in n, the time it takes to square n increases by a factor of
4, while the time it takes to factor n increases enormously. Of course, there
are better algorithms available for both of these operations, but, at present,
factorization takes significantly longer than multiplication.
We’ll meet algorithms that take time a power of log n to perform cer-
tain calculations (for example, finding greatest common divisors and doing
modular exponentiation). There are other computations for which the best
known algorithms run only slightly better than a power of n (for example,
factoring and finding discrete logarithms). The interplay between the fast al-
gorithms and the slower ones is the basis of several cryptographic algorithms
that we’ll encounter in this book.
8 Chapter 1. Overview of Cryptography and Its Applications
2. Data integrity: Bob wants to be sure that Alice’s message has not
been altered. For example, transmission errors might occur. Also,
an adversary might intercept the transmission and alter it before it
reaches the intended recipient. Many cryptographic primitives, such
as hash functions, provide methods to detect data manipulation by
malicious or accidental adversaries.
3. Authentication: Bob wants to be sure that only Alice could have sent
the message he received. Under this heading, we also include iden-
tification schemes and password protocols (in which case, Bob is the
computer). There are actually two types of authentication that arise
in cryptography: entity authentication and data-origin authentication.
Often the term identification is used to specify entity authentication,
which is concerned with proving the identity of the parties involved
in a communication. Data-origin authentication focuses on tying the
information about the origin of the data, such as the creator and time
of creation, with the data.
4. Non-repudiation: Alice cannot claim she did not send the message.
Non-repudiation is particularly important in electronic commerce ap-
plications, where it is important that a consumer cannot deny the
authorization of a purchase.
that allow for electronic messages to be signed in such a way that everyone
believes that the signer was the person who signed the document, and such
that the signer cannot deny signing the document.
Identification: When logging into a machine or initiating a communi-
cation link, a user needs to identify herself or himself. But simply typing
in a user name is not sufficient as it does not prove that the user is really
who he or she claims to be. Typically a password is used. We shall touch
upon various methods for identifying oneself. In the chapter on DES we
discuss password files. Later, we present the Feige-Fiat-Shamir identifica-
tion scheme, which is a zero-knowledge method for proving identity without
revealing a password.
Key establishment: When large quantities of data need to be en-
crypted, it is best to use symmetric key encryption algorithms. But how
does Alice give the secret key to Bob when she doesn’t have the opportu-
nity to meet him personally? There are various ways to do this. One way
uses public key cryptography. Another method is the Diffie-Hellman key ex-
change algorithm. A different approach to this problem is to have a trusted
third party give keys to Alice and Bob. Two examples are Blom’s key genera-
tion scheme and Kerberos, which is a very popular symmetric cryptographic
protocol that provides authentication and security in key exchange between
users on a network.
Secret sharing: In Chapter 17, we introduce secret sharing schemes.
Suppose that you have a combination to a bank safe, but you don’t want to
trust any single person with the combination to the safe. Rather, you would
like to divide the combination among a group of people, so that at least two
of these people must be present in order to open the safe. Secret sharing
solves this problem.
Security protocols: How can we carry out secure transactions over
open channels such as the Internet, and how can we protect credit card
information from fraudulent merchants? We discuss various protocols, such
as SSL and SET.
Electronic cash: Credit cards and similar devices are convenient but
do not provide anonymity. Clearly a form of electronic cash could be useful,
at least to some people. However, electronic entities can be copied. We
give an example of an electronic cash system that provides anonymity but
catches counterfeiters, and we discuss cryptocurrencies, especially Bitcoin.
Games: How can you flip coins or play poker with people who are not in
the same room as you? Dealing the cards, for example, presents a problem.
We show how cryptographic ideas can solve these problems.
Chapter 2
Classical Cryptosystems
10
2.1. Shift Ciphers 11
x 7→ αx + β (mod 26).
affine 7→ CVVWPM.
Let’s try this. The letter V (= 21) is mapped to 3·21+20 ≡ 83 ≡ 5 (mod 26),
which is the letter f . Similarly, we see that the ciphertext CVVWPM is
decrypted back to affine. For more examples, see Examples 2 and 3 in the
Computer Appendices.
Suppose we try to use the function 13x + 4 as our encryption function.
We obtain
input 7→ ERRER.
If we alter the input, we obtain
alter 7→ ERRER.
2. Known plaintext: With a little luck, knowing two letters of the plain-
text and the corresponding letters of the ciphertext suffices to find
the key. In any case, the number of possibilities for the key is greatly
reduced and a few more letters should yield the key.
For example, suppose the plaintext starts with if and the corresponding
ciphertext is PQ. In numbers, this means that 8 (= i) maps to 15 (= P )
and 5 maps to 16. Therefore, we have the equations
(plaintext) h e r e i s h o w i t w o r k s
(key) 21 4 2 19 14 17 21 4 2 19 14 17 21 4 2 19
(ciphertext) C I T X W J C S Y B H N J V M L
a b c d e f g h i j
.082 .015 .028 .043 .127 .022 .020 .061 .070 .002
k l m n o p q r s t
.008 .040 .024 .067 .075 .019 .001 .060 .063 .091
u v w x y z
.028 .010 .023 .001 .020 .001
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com