Professional Documents
Culture Documents
Chapter Two Part Three
Chapter Two Part Three
Elementary Cryptography
Part Three
DES and DES types, AES and RSA
Outline
Review of Encryption
Decryption P = EK-1(C)
system.
The parameter that selects the individual transformation is called the key K,
3
selected from a keyspace K. For a K-bit key the keyspace size is 2 K
Symmetric and Asymmetric Encryption Algorithms
4
Data Encryption Standard (DES) History
The Data Encryption Standard (DES) was developed in the 1970s by the
National Bureau of Standards with the help of the National Security Agency.
Its purpose is to provide a standard method for protecting sensitive
In May 1973, and again in Aug 1974 the NBS (now NIST) called for
design
5
DES - As a Federal Standard
DES uses a 56-bit key. In fact, the 56-bit key is divided into eight 7-
bit blocks and an 8th odd parity bit is added to each block (i.e., a "0"
or "1" is added to the block so that there are an odd number of 1 bits
in each 8-bit block).
By using the 8 parity bits for rudimentary error detection, a DES key
Confusion
A technique that seeks to make the relationship between the
9
plaintext by spreading out the influence of each individual plaintext
DES Structure
Permutation is an operation performed by a function, which moves an
function f, called the cipher function, and a function KS, called the key
Best: changing one input bit results in changes of approx half the
output bits
10
Completeness effect
Feistel Cipher
Invented by Horst Feistel,
The idea is to partition the input block into two halves, l(i-1)
and r(i-1),
13
Fig. General structure of DES
DES Basics
DES uses the two basic techniques of cryptography - confusion and
diffusion.
At the simplest level, diffusion is achieved through numerous
rk
o
tw
Ne
-P
eS
Th
g.
14
Fi
DES - The 16 Rounds
The basic process in
enciphering a 64-bit data
block and a 56-bit key
using the DES consists of:
1. An initial permutation
(IP)
2. 16 rounds of a complex
key dependent calculation
f
3.
15 A final permutation, being
DES Encryption
1. The 64-bit plaintext passes through an initial permutation (IP)
that rearranges the bits to produce the permuted input.
17
Fig. Initial and final permutation steps in DES
DES - Swapping of Left and Right Halves
The 64-bit block being enciphered is broken into two halves.
The right half goes through one DES round, and the result
right halves are not swapped, so that the result of the 16th round
becomes the final right half, and the result of the 15th round
(which became the left half of the 16th round) is the final left
18
half.
Contd.
19
The 16 Rounds of F Consist Of:
20
Initial Permutation Vs. Inverse (Final) Permutation Tables
The Initial permutation and its inverse are defined by tables.
1 58 50 42 34 26 18 10 2 1 40 8 48 16 56 24 64 32
9 60 52 44 36 28 20 12 4 9 39 7 47 15 55 23 63 31
17 62 54 46 38 30 22 14 6 17 38 6 46 14 54 22 62 30
25 64 56 48 40 32 24 16 8 25 37 5 45 13 53 21 61 29
33 57 49 41 33 25 17 9 1 33 36 4 44 12 52 20 60 28
41 59 51 43 35 27 19 11 3 41 35 3 43 11 51 19 59 27
49 61 53 45 37 29 21 13 5 49 34 2 42 10 50 18 58 26
57 63 55 47 39 31 23 15 7 57 33 1 41 9 49 17 57 25
9 13 30 6 22 11 4 25
Expansion
Substitution Boxes (S-Box)
F
The first and last bits of the input to Si form a 2-bit binary number
The decimal value in the cell selected by the row and column is
Example: In S1, for input 011001, the row is 01(row 1) and the
column is 1100(column 12).
[1
]
The Value in row 1 and column 12 is 9, so the
Substitution Boxes (S-Box)
[1
]
DES Key Generation
The key is first subjected to permutation governed by a table labeled as
The resulting 56-key is then treated as two 28-bit quantities labeled as C0 and
D0 .
At each round, Ci-1 and Di-1 are separately subjected to a circular left shift, or
The shifted values serve as input to the next round. They also serve as input to
1 58 50 42 34 26 18
10 2 59 51 43 35 27
14 17 11 24 1 5 3 28
19 11 3 60 52 44 36 15 6 21 10 23 19 12 4
63 55 47 39 31 23 15 26 8 16 7 27 20 13 2
7 62 54 47 38 30 22 41 52 31 37 47 55 30 40
51 45 33 48 44 49 39 56
14 6 61 53 45 37 29
34 53 46 42 50 36 29 32
21 13 5 28 20 12 4
27
DES - Example
Given
Required
28
Double and Triple DES
The simplest form of double DES encryption has two encryption
Using two keys and applying them in three operations adds apparent
strength.
Triple DES procedure is C=EK1 (DK2 (EK1(p))), that is, you encrypt
with one key, decrypt with the second key and encrypt with the first
key again.
used as a single-DES.
K1 K2 K1
A B
P E D E C
3. If K1’ = K1, try the key pair (K1, K2) on another (C’,P’).
Encryption: C = EK3(DK2(EK1(P)))
Rijndael allows various block lengths. But AES allows only one
block size: 128 bits.
36
Overview of Rijndael Algorithm
Ii is a fast algorithm that can be implemented easily on simple
processes.
38
Comparison of DES and AES
DES AES
Date 1976 1999
Hence does not protect sender from receiver forging a message &
But public-key cryptography uses two keys – a public & a private key
41 complements rather than replaces private key crypto
Public-key cryptography was
Contd. designed by Whitfield Diffie
& Martin Hellman at
Stanford University in 1976
The public-key cryptography
involves the use of two keys:
1. Public-key, which may be
known by anybody, and can
be used to encrypt
messages, and verify
signatures
2. Private-key, known only
to the recipient, used to
decrypt messages, and
sign (create) signatures
is asymmetric because those
who encrypt messages or
42 verify signatures cannot
decrypt messages or create
Public-Key Characteristics
Each user has two keys: a public key and a private key.
The two keys operate as inverse, meaning that one key undoes the encryption
More generally the hard problem is known, its just made too hard to
do in practise
Protection of key Must be kept secret One key must be kept secret: the
other can be freely exposed.
46
RSA Encryption
RSA cryptosystems, named after its inventors R. Rivest, S. Shamir and
It may be used to provide both secrecy and digital signatures and its
modulo a prime
numbers.
The two keys used in RSA, d and e, are used for decryption and
encryption.
but, having chosen one, you must keep the other one private.
P=E(D(P))=D(E(P))
note ø(N)=(p-1)(q-1)
50
compute the other
RSA Use
to encrypt a message M the sender:
(block if needed)
51
Prime Numbers
prime numbers only have divisors of 1 and self
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61
67 71 73 79 83 89 97 101 103 107 109 113 127 131
137 139 149 151 157 163 167 173 179 181 191 193
52
197 199
Prime Factorisation
To factor a number n is to write it as a product of other
numbers: n=a × b × c
as a product of primes
53
Relatively Prime Numbers & GCD
Two numbers a, b are relatively prime if have no common
54 hence GCD(18,300)=21×31×50=6
RSA Example
1. Select primes: p=17 & q=11
2. Compute n = pq =17×11=187
3. Compute ø(n)=(p–1)(q-1)=16×10=160
56
RSA Security
Three approaches to attacking RSA:
57
Factoring Problem
mathematical approach takes 3 forms:
find d directly
countermeasures