lecture3

advertisement
EEC 688/788
Secure and Dependable Computing
Lecture 3
Wenbing Zhao
Department of Electrical and Computer Engineering
Cleveland State University
wenbing@ieee.org
Outline

Introduction to cryptography




Terminology
Basic encryption methods
One time pad
Symmetric-key algorithms

DES, AES, etc
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Cryptography Terminology

Encryption is the process of encoding a message
so that its meaning is not obvious


Decryption is the reverse process, transforming an
encrypted message back into its normal, original
form



Equivalent terms: encode, encipher
Equivalent terms: decode, decipher
Plaintext: message to be encrypted
Ciphertext: encrypted message
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Cryptography Terminology


The cryptosystem involves a set of rules for how to
encrypt the plaintext and how to decrypt the
ciphertext
Why encryption?

It addresses the need for confidentiality of data, also helps
to ensure integrity

It forms the basis of protocols that enable us to provide
security while accomplishing system or network tasks
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Cryptography Terminology



The encryption and decryption rules are called
encryption and decryption algorithms
Encryption/decryptions algorithms often use a
device called a key, denoted by K, so that the
resulting ciphertext depends on the original plaintext
message, the algorithm, and the key value
An encryption scheme that does not require the use
of a key is called a keyless cipher
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Symmetric Encryption




The encryption and decryption keys are the same,
so P = D(K, E(K,P))
D and E are closely related. They are mirror-image
processes
The symmetric systems provide a two-way channel
to their users
The symmetry of this situation is a major advantage
of this type of encryption, but it also leads to a
problem: key distribution
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Symmetric Encryption

DK(EK(P)) = P
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Asymmetric Encryption


Encryption and decryption keys come in pairs.
The decryption key, KD, inverts the encryption
of key KE, so that
P = D(KD, E(KE,P))
Asymmetric encryption systems excel at key
management
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Cryptology


Cryptology is the research into and study of
encryption and decryption; it includes both
cryptography and cryptanalysis
Cryptography – art of devising ciphers


Comes from Greek words for “secret writing”. It refers to the
practice of using encryption to conceal text
Cryptanalysis – art of breaking ciphers

Study of encryption and encrypted messages, hoping to find
the hidden meanings
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Cryptanalysis





Attempt to break a single message
Attempt to recognize patterns in encrypted messages,
to be able to break subsequent ones
Attempt to deduce the key, in order to break
subsequent messages easily
Attempt to find weaknesses in the implementation or
environment of use of encryption
Attempt to find general weaknesses in an encryption
algorithm
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Cryptanalysis

Traffic analysis: attempt to infer some meaning
without even breaking the encryption, e.g.,


Noticing an unusual frequency of communication
Determining something by whether the communication was
short or long
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Cryptanalysis –
Breaking Encryption Schemes



Ciphertext-only: cryptanalyst has a quantity of
ciphertext and no plaintext
Known plaintext: cryptanalyst has some matched
ciphertext and plaintext
Chosen plaintext: cryptanalyst has the ability to
encrypt pieces of plaintext of his own choosing
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Basic Encryption Methods


Substitution ciphers: one letter is exchanged
for another
Transposition ciphers: order of letters is
rearranged
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Substitution Ciphers


Idea: each letter or group of letters is replaced by
another letter or group of letters
Caesar cipher – circularly shift by 3 letters



a -> D, b -> E, … z -> C
More generally, shift by k letters, k is the key
Monoalphabetic cipher – map each letter to some
other letter


A b c def … wx yz
Q W E R T Y … V B N M <= the key
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Cryptanalysis of Substitution Ciphers



Brute force cryptanalysis would have to try 26! permutations of a
particular ciphertext message
Smarter way: use frequencies of letters, pairs of letter etc., or by
guessing a probable word or phrase. Most frequently occurred
 Letters: e, t, o, a, n, …
 Digrams: th, in, er, re, an, …
 Trigrams: the, ing, and, ion, ent
 Words: the, of, and, to, a, in, that, …
When messages are long enough, the frequency distribution
analysis quickly betrays many of the letters of the plaintext
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Transposition Ciphers



Substitution cipher – preserves order of plaintext
symbols but disguises them
Transposition cipher – reorders (rearrange) symbols
but does not disguise them. It is also called
permutation
With transposition, the cryptography aims for


Widely spreading the information from the message or the
key across the ciphertext
Transpositions try to break established patterns
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Columnar Transposition



Plaintext written in rows, number of columns
= key length
Key is used to number the columns
Ciphertext read out by columns, starting with
column whose key letter is lowest
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Columnar Transposition

A transposition cipher example
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
One-Time Pads

One-time pad: construct an unbreakable cipher
Choose a random bit string as the key
 Convert the plaintext into a bit string
 Compute the XOR of these two strings, bit by bit
 The resulting ciphertext cannot be broken, because in a
sufficiently large sample of ciphertext, each letter will occur
equally often, as will every digram, every trigram, and so on
=> There is simply no information in the message because all
possible plaintexts of the given length are equally likely

3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
The Vernam Cipher

The Vernam Cipher is a type of one-time pad devised by Gilbert
Vernam for AT&T
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
The Vernam Cipher


The encryption involves an arbitrarily long
nonrepeating sequence of numbers that are
combined with the plaintext
Assume that the alphabetic letters correspond to
their counterparts in arithmetic notation mod 26


That is, the letters are represented with numbers 0 through
25
To use the Vernam cipher, we sum this numerical
representation with a stream of random two-digit
numbers
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
The Vernam Cipher - Example
Plaintext
Numeric Equivalent
+ Random Number
= Sum
= mod 26
Ciphertext
3/22/2016
V E R N A M C
I
P H E
21 4 17 13 0 12 2
8 15 7
4
R
17
76 48 16 82 44 3 58 11 60 5 47 88
97 52 33 95 44 15 60 19 75 12 51 105
19 0
t
a
7 17 18 15 8 19 23 12 25
1
h
b
r
s
p
EEC688: Secure & Dependable Computing
i
t
x m z
Wenbing Zhao
The Vernam Cipher - Observations


The repeated letter t comes from different plaintext
letters
Duplicate ciphertext letters are generally
unrelated when this encryption algorithm is used
=> there is no information in the message to be
exploited
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
The Vernam Cipher - Decryption

To decrypt: (Ci – Ki) mod 26

Note on rules of mod on negative number: “The
mod function is defined as the amount by which a
number exceeds the largest integer multiple of the
divisor that is not greater than that number”
(http://mathforum.org/library/drmath/view/52343.html)


Modula op always return non-negative number
E.g., (19-76) mod 26 = (-57) mod 26 = (-78+21)
mod 26 = 21
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
The Vernam Cipher - Decryption
Ciphertext
t
a
h
Numeric equivalent
19
0
7 17 18 15 8 19 23 12 25
- One-time pad
76
48 16 82 44 3 58 11 60 5 47 88
= Difference
-57
-48 -9 -65 -26 12 -50
= mod 26
21
4 17 13 0 12 2
8 15 7
4
17
Plaintext
V
E
I
E
R
3/22/2016
R
r
N
s
p
i
A M C
EEC688: Secure & Dependable Computing
t
8
x
-37
P
m
7
H
z
b
1
-22 -87
Wenbing Zhao
One-Time Pads

Disadvantages



The key cannot be memorized, both sender and
receiver must carry a written copy with them
Total amount of data can be transmitted is limited
by the amount of key available
Sensitive to lost or inserted characters
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Symmetric-Key Algorithms




DES – The Data Encryption Standard
AES – The Advanced Encryption Standard
Other Ciphers
Cipher Modes
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Data Encryption Standard





Developed by IBM. US standard for unclassified info (1977)
Same key for encryption as for decryption
Encrypts in 64-bit blocks
Uses 56-bit key
Has 19 stages,
16 parameterized
by different
functions of
the key
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Triple DES

Triple DES – effectively increases the key length. It
uses two keys and three stages



In first stage, the plaintext is encrypted using DES in the
usual way with K1
In second stage, DES is run in decryption mode, using K2 as
the key
In third stage, another DES encryption is done with K1
Triple DES encryption
3/22/2016
Triple DES decryption
EEC688: Secure & Dependable Computing
Wenbing Zhao
AES – The Advanced Encryption Standard

AES is a result of a cryptographic contest


Organized by NIST in 1997
Rules for AES proposals
The algorithm must be a symmetric block cipher
2.
The full design must be public
3.
Key lengths of 128, 192, and 256 bits supported
4.
Both software and hardware implementations required
5.
The algorithm must be public or licensed on nondiscriminatory
terms
Winner: Rijndael (from two Belgian cryptographers: Joan Daemen
and Vincent Rijmen)
1.

3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Other Symmetric-Key Ciphers
3/22/2016
EEC688: Secure & Dependable Computing
Wenbing Zhao
Download