










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!











Cryptography I^ Dr. Bill Young Department of Computer SciencesUniversity of Texas at AustinLast updated: April 14, 2015 at 14:41^ CS329E Slideset 5: 1
Cryptography I
Suppose you’re confronted with a textthat you believe to be the encryption ofsome message. You’d like to apply yourcryptanalytic skills.
How do you get
started? What questions should youask? CS329E Slideset 5: 2
Cryptography I
Suppose you’re confronted with a textthat you believe to be the encryption ofsome message. You’d like to apply yourcryptanalytic skills.
How do you get
started? What questions should youask?
What is the likely underlying language of the plaintext? What characteristics of the probable source text are relevant? What characteristics of the source language are relevant? Have any transformations/compressions been applied prior toencryption? What is the likely nature/complexity of the encryptionalgorithm? Anything else?
CS329E Slideset 5: 3
Cryptography I
The setting:
In the early 1800’s, a man named William Legrand finds a scrap ofparchment on a South Carolina beach. Theparchment appears blank, but when he holdsclose to a candle flame to examine it, astrange encoded message appears. In theupper corner is a drawing of a goat’s head.Legrand wonders if the message could bedirections to the location of a treasure burieby the infamous pirate Captain Kidd. CS329E Slideset 5: 4
Cryptography I
CS329E Slideset 5: 5
Cryptography I
CS329E Slideset 5: 6
Cryptography I
S^ to recipient
R. Suppose
S^ entrusts the message to
T^ , who
delivers it to
R. We call
T^ a
transmission medium
If an outsider
O^ wants to access the message (to read, change, or destroy it), we call
O^ an
interceptor
or^ intruder
. This might take
different forms:^ block it
by preventing it reaching
intercept it
by reading or listening to the message; modify it
by seizing the message and changing it; fabricate
an authentic looking message and cause it to bedelivered. For which of these would encryption help?
CS329E Slideset 5: 7
Cryptography I
Encrypt^ ✻^ key
(optional)e ✲^
✲
plaintext
ciphertext
as is the process of decryption:
Decrypt^ ✻^ key
(optional)d ✲^
✲
ciphertext
plaintext
CS329E Slideset 5: 8
Cryptography I
and^
If^ KE
, then the algorithm is calledD
symmetric
. If not, then it
is called
asymmetric
(or public key). In general,^ P^ =
An algorithm that does not use a key is called a
keyless cipher
CS329E Slideset 5: 13
Cryptography I
,^ K^ ) and
,^ K^ ) becomes cumbersome.
An alternative notation is often used, particularly in cryptographicprotocols.We’ll often use
to denoteK
,^ K^ ), and sometimes to
denote
,^ K^ ). For example,^ P^ =
This is usually appropriate since, in many of the most importantcommercial crypto systems, the same algorithm is used for bothencryption and decryption (i.e., the algorithm is its own inverse).
CS329E Slideset 5: 14
Cryptography I
cryptography
means “secret writing.” It refers to the
practice of using encryption to conceal text. Cryptanalysis
is the attempt to extract the meaning of encrypted messages. Cryptology
is the research into and study of encryption and decryption; it includes both cryptography and cryptanalysis.
CS329E Slideset 5: 15
Cryptography I
to break a single message; to recognize patterns in encrypted messages; to infer some meaning without breaking the algorithm; to deduce the key; to find weaknesses in the implementation or environment orthe use of encryption; to find weaknesses in the algorithm, without necessarilyhaving intercepted any messages.
CS329E Slideset 5: 16
Cryptography I
encrypted messages, known encryption algorithms, intercepted plaintext, data items known or suspected to be in a ciphertext message, mathematical and statistical tools and techniques, properties of languages, computers, ingenuity and luck.
CS329E Slideset 5: 17
Cryptography I
if, given enough time and data, an analyst can recover theplaintext.However, just because an algorithm isbreakable doesn’t mean that it isfeasible to break it.
CS329E Slideset 5: 18
Cryptography I
consider a simple substitution algorithm on the 26 characters of English. There are something like 26! differentpossible encipherments. Checking 10
10 per second, this would still
require thousands of years to check them all.This is infeasible, and obviously unnecessary. No-one wouldattempt to break a simple substitution that way. But the fact that you could try all combinations, means that theencryption is breakable!
CS329E Slideset 5: 19
Cryptography I
15 operations. An exhaustive approach would require only aboutone day. (But still not be needed, probably!)Because of advances in computer technology, algorithms that wereconsidered
strong enough
20 years ago, can be effectively broken
today.You see the result in current discussion of increasing the
key length
for standard algorithms such as DES and RSA. We’ll consider thisissue later.
CS329E Slideset 5: 20
Cryptography I
CS329E Slideset 5: 25
Cryptography I
k! permutations of an alphabet of
k^ characters.
Thus, we generally rely on redundancy in the source language forclues that speed the decryption. Note that not all substitution ciphers are simple substitutionciphers.
CS329E Slideset 5: 26
Cryptography I
Computer Security: Art and Science
to encode the following
text: “four score and seven years ago.” Align the two texts,possibly removing spaces:plaintext:
fours corea ndsev enyea rsago
key:^
monit orsto gotot hebat hroom
ciphertext:
rcizl qfkxo trlso lrzet yjoua
Then use the letter pairs to look up an encryption in a table (calleda^ Vigen`
ere Tableau
or^ tabula recta
). For example, look up the pair
(f, m)
by consulting row
f^ and column
m^ to obtain
r, etc.
What is the corresponding decryption algorithm?
CS329E Slideset 5: 27
Cryptography I
A^ B^ C^
D^ E^ F
G^ H^
I^ J^ K^
L^ M^ N
O^ P^
Q^ R^ S^
T^ U^ V
W^ X^
Y^ Z
A^ A^ B
C^ D^
E^ F^ G^
H^ I^ J^
K^ L^ M
N^ O^
P^ Q^ R
S^ T^
U^ V^ W
X^ Y^ Z
B^ B^ C
D^ E^
F^ G^ H
I^ J^
K^ L^ M
N^ O^
P^ Q^ R
S^ T^
U^ V^ W
X^ Y^ Z
A
C^ C^ D
E^ F^
G^ H^ I^
J^ K^ L^
M^ N^ O
P^ Q^
R^ S^ T
U^ V^ W
X^ Y^ Z
A^ B
D^ D^ E
F^ G^
H^ I^ J^
K^ L^ M
N^ O^
P^ Q^ R
S^ T^
U^ V^ W
X^ Y^ Z
A^ B^
C
E^ E^ F
G^ H^
I^ J^ K^
L^ M^ N
O^ P^
Q^ R^ S^
T^ U^ V
W^ X^
Y^ Z^ A
B^ C^
D
F^ F^ G
H^ I^
J^ K^ L^
M^ N^ O
P^ Q^
R^ S^ T
U^ V^ W
X^ Y^ Z
A^ B^
C^ D^ E
G^ G^ H
I^ J^
K^ L^ M
N^ O^
P^ Q^ R^
S^ T^ U
V^ W^
X^ Y^ Z
A^ B^
C^ D^ E
F
H^ H^ I^
J^ K^ L^
M^ N^ O
P^ Q^
R^ S^ T
U^ V^ W
X^ Y^ Z
A^ B^
C^ D^ E
F^ G
I^ I^ J^
K^ L^ M
N^ O^
P^ Q^ R^
S^ T^ U
V^ W^
X^ Y^ Z^
A^ B^ C
D^ E^
F^ G^ H
J^ J^ K^
L^ M^ N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 X
Y^ Z^
A^ B^ C^
D^ E^ F^
G^ H^ I^
J^ K^ L^
M^ N^ O
P^ Q^
R^ S^ T
U^ V
X^ X^ Y
Z^ A^
B^ C^ D
E^ F^
G^ H^ I^
J^ K^ L^
M^ N^ O
P^ Q^
R^ S^ T
U^ V^ W
Y^ Y^ Z
A^ B^
C^ D^ E^
F^ G^ H
I^ J^
K^ L^ M
N^ O^
P^ Q^ R
S^ T^
U^ V^ W
X
Z^ Z^ A
B^ C^
D^ E^ F^
G^ H^ I^
J^ K^ L^
M^ N^ O
P^ Q^
R^ S^ T
U^ V^ W
X^ Y
CS329E Slideset 5: 28
Cryptography I
CS329E Slideset 5: 29
Cryptography I
ere Tableau means that you are using
twenty-six different Caesar Ciphers, chosen based on thecorresponding letter in the key.
CS329E Slideset 5: 30
Cryptography I
light light light light light ... inverse key:
psuth psuth psuth psuth psuth ... Though easy to remember, it is weak because every fifth letter isencoded with the same Caesar Cipher. If you knew the key period(five letters) and had enough ciphertext, it would be easy todecipher with a bit of statistical analysis and trial and error.
CS329E Slideset 5: 31
Cryptography I
In general, running key ciphers aresusceptible to statistical analysis. Boththe key and the plaintext are Englishlanguage strings and so have thecharacteristics of English.
In particular, the letters A, E, O, T, N, I make up approximately50% of English text. Thus, at approximately 25% of indices, thesecan be expected to coincide.We can work backwards from the tableau, looking for those lettersin the ciphertext that correspond to the row-column intersection ofcombinations of these common letters.This is an example of a
regularity
in the ciphertext that would not
be expected merely from chance. It provides clues that can beused by the cryptanalyst.
CS329E Slideset 5: 32
Cryptography I
.^ How many decryptions are possible? With no additional information:
If you know a simple substitution cipher was used:
(Reduce search space by a factor of 27.)
CS329E Slideset 5: 37
Cryptography I
.^ How many decryptions are possible? With no additional information:
If you know a simple substitution cipher was used:
(Reduce search space by a factor of 27.) and you know the plaintext is an English word:
around 40.
(Reduce original search space by a factor of 439.)
CS329E Slideset 5: 38
Cryptography I
xyy
rqk. What can you infer? How many different potential decryptionscome to mind?
CS329E Slideset 5: 39
Cryptography I
n^ over an alphabet
A, this is
sometimes denoted as
n A. A length preserving cipher
is a mapping
from^
n^ A→
n B. Most substitution ciphers are length preserving.
CS329E Slideset 5: 40
Cryptography I
n^ Aand an
encryption algorithm
Efor keyk^
k^ such that
E(Pk^
, then
(abusing notation) the encryption is
perfect
if,
h(P|C
) =^ h
That is, the uncertainty (the likelihood of guessing the plaintext)of the message is exactly the same
whether or not you know the
ciphertext.
CS329E Slideset 5: 41
Cryptography I
“Perfect Secrecy” is defined by requiring of a system thatafter a cryptogram is intercepted by the enemy the aposteriori probabilities of this cryptogram representingvarious messages be identically the same as the a prioriprobabilities of the same messages before theinterception. It is shown that perfect secrecy is possiblebut requires, if the number of messages is finite, thesame number of possible keys. If the message is thoughtof as being constantly generated at a given “rate” R (tobe defined later), key must be generated at the same or agreater rate.
(Claude Shannon)^ CS329E Slideset 5: 42
Cryptography I
one-time pad
, invented in 1917 by Vernam and Mauborgne, is
theoretically considered a perfect cipher. This was proved byClaude Shannon.
The idea is to use a key that isthe same length as the plaintext,and to use it only once. The keyis XOR’d bit by bit with theplaintext.
CS329E Slideset 5: 43
Cryptography I
⊕) is the boolean function with the following truth table:
x^ y
x^ ⊕
y 0 0
It’s called XOR (eXclusive OR) because it returns 1 if either, butnot both, of the arguments are 1.XOR has the following properties:
x^ ⊕^ 0 =
x x^ ⊕^ 1 =
¬x x^ ⊕^ x
(x^ ⊕^
y^ )^ ⊕^
z^ =^ x
⊕^ (y
⊕^ z)
x^ ⊕^ y
=^ y^
⊕^ x
CS329E Slideset 5: 44
Cryptography I
seed
Obviously this would not work if the state of the PRNG isrefreshed with randomness from the environment, as is often donein^ cryptographic
PRNGs.
This works well because a pseudorandom sequence may have avery long
period
. However, notice that it is susceptible to
compromise by someone who knows the algorithm and the seed.
CS329E Slideset 5: 49
Cryptography I
Confusion:
transforming information in plaintext so that aninterceptor cannot readily extract it. Diffusion:
spreading the information from a region of plaintextwidely over the ciphertext. For example, the Caesar Cipher is poor at confusion; decryption ofa few letters leads to decryption of many others. It is also poor atdiffusion, since all of the information in a plaintext letter iscontained in the corresponding ciphertext letter.
Analyze the
one-time pad with respect to these criteria.
CS329E Slideset 5: 50
Cryptography I
confusion
. The goal of transposition is
diffusion
Columnar transposition
is a simple variety of transposition
algorithm. Write the plaintext characters in a number of fixedlength columns such as the following: Form the ciphertext by reading down the rows.If the message length is not a multiple of the number of rows, padthe final rows with any character (or leave blank).
CS329E Slideset 5: 51
Cryptography I
time
complexity linear in the length of the
message.Unlike simple substitution, it has greater
space
complexity since
the message can’t be decrypted until it has been read in itsentirety. This may be an issue for very long messages, and causes adelay in the decryption.
CS329E Slideset 5: 52
Cryptography I
n, adjacent
characters in the plaintext are at
cand^1
cn+
,^ cand^2
cn+
, etc.
We hypothesize a distance of
n^ and check these pairs to see if they
contain common digrams, as would be expected for the language.If so, we may have found the key to the cipher. Otherwise, try adistance of
n^ + 1.
CS329E Slideset 5: 53
Cryptography I
product cipher
or
sometimes a
cascade cipher
. These are typically performed one
after another.
(P,^ k^1
),^ k)^2
Note that a combination is not necessarily stronger than eithercipher individually. It may be stronger, but it may even be weaker.
CS329E Slideset 5: 54
Cryptography I
1 The degree of secrecy required should determine the effortexpending in encryption / decryption. 2 The keys and algorithm should be free from complexity. 3 The implementation should be as simple as possible. 4 Errors in encryption should not propagate. 5 The size of the ciphertext shouldn’t be more than the size ofthe plaintext. Which of these still apply to modern cryptography?
CS329E Slideset 5: 55
Cryptography I
is based on sound mathematics; has been analyzed by competent experts and found to besound; has stood the test of time.We’ll consider three important modern algorithms: DES, RSA, andAES.
CS329E Slideset 5: 56
Cryptography I
−^1 }Kk S
then either key can be used to encrypt and the other to decrypt.In a system with this property, the same pair of public/private keyscan be used for both confidentiality and authenticity. RSA is theonly known public key algorithm with this property.If the system does not have this property, then two pairs of keysare needed: one pair for confidentiality and one for authentication(signing).
CS329E Slideset 5: 61
Cryptography I
n^ users needing pairwise
communication,
n(n^ −
1)/2 keys are required.
An asymmetric system provides a means for
anyone
to
communicate with an individual securely. The receiver maintains a private key
to be used for decryption, and publicizes a
public key
that can be used by anyone to encrypt. Thus, each individualrequires two keys. For
n^ individuals, 2
n^ keys are required in the
system.
CS329E Slideset 5: 62
Cryptography I
shared secret
that can be used
for^ authentication
The receipt of an encrypted message that correctly decrypts withthe key is
de facto
proof that the sender shares the key. This
authenticates the identity of the sender, assuming that the keydistribution and management practices are secure. Does it provideconfidentiality?For an
asymmetric
system, does receipt of a message encrypted
with the user’s public key provide authentication? How about theprivate key? Does either provide confidentiality?
Note that not all
public key systems allow encryption with the private key. RSAdoes, but most others do not.
CS329E Slideset 5: 63
Cryptography I
convert one symbol of plaintext directly into asymbol of ciphertext.
Block ciphers
encrypts a group of plaintext symbols as one block. Simple substitution is an example of a stream cipher. Columnartransposition is a block cipher. Most modern symmetric encryptionalgorithms are block ciphers.
Can stream ciphers ever excel in
diffusion?
CS329E Slideset 5: 64
Cryptography I
Speed of transformation:
since symbols are encrypted
individually, the algorithms are linear (in time). Low error propogation:
an error in encrypting one symbol
likely will not affect subsequent symbols. Disadvantages: Low diffusion:
all information of a plaintext symbol is contained in a single ciphertext symbol. Susceptibility to insertions/ modifications:
an active
interceptor who breaks the algorithm might insert spuriousnew messages that may look authentic.
CS329E Slideset 5: 65
Cryptography I
High diffusion:
information from one plaintext symbol is diffused into several ciphertext symbols. Immunity to tampering:
it is difficult to insert symbols
without detection. Disadvantages: Slowness of encryption:
an entire block must be accumulated
before encryption / decryption can begin. Error propogation:
An error in one symbol may corrupt the
entire block.
CS329E Slideset 5: 66
Cryptography I
malleable
if transformations
on the ciphertext produce meaningful changes in the plaintext.That is, given a plaintext P and the corresponding ciphertext C^ =^
E^ (P), it is possible to generate
f^ (C^ ) so that
D(C^1
=^ f 1
with arbitrary, but known, functions
f^ and
′ f.
An algorithm that is not malleable is called
non-malleable
. Stream
ciphers are often malleable encryption algorithms.
CS329E Slideset 5: 67
Cryptography I
decryption is based on probabilities, distributions, characteristics of the availableciphertext, plus publicly available information. Anyencryption scheme susceptible to this is deemedcompletely insecure. Known plaintext:
attacker has a quantity of ciphertext andcorresponding plaintext.
Chosen plaintext attack:
the attacker has infiltrated the sender’s transmission process and can cause messages of hischoosing to be encrypted.
CS329E Slideset 5: 68
Cryptography I