Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

Teoría de la

Información

Ing. Diego Veloz Ch. MSc.


Objetivo de estudio

Entender la Teoría de la Información de Shannon para entender los


principios de la Seguridad informática y su influencia en el campo de la
Encriptación
INFORMATION

Ing. Diego Veloz Ch. MSc.


Entropy

◉Uncertainty of information

Ing. Diego Veloz Ch. MSc.


Entropy

◉Weekdays
◉Lottery

◉Uncertainty of information

Information + entropy = 100%


I+H=1
If there is a X message:

Then: X = x1 + x2 + x3 + … + xi + … + xn

Ing. Diego Veloz Ch. MSc.


Entropy

If
X = x1 + x2 + x3 + … + xi + … + xn
Then:
p(x) = p(x1)+p(x2)+p(x3)+…+p(xi)+…+p(xn)

Then:

Ing. Diego Veloz Ch. MSc.


Ing. Diego Veloz Ch. MSc.

Entropy
Entropy

Amount of Information:

Ci = - log2(pi)

https://es.wikipedia.org/wiki/Logaritmo#/media/Archivo:
Logarithms.svg

Ing. Diego Veloz Ch. MSc.


Amount of information

Ing. Diego Veloz Ch. MSc.


Coding

Ing. Diego Veloz Ch. MSc.


Huffman Coding

Ing. Diego Veloz Ch. MSc.


Huffman Coding

Ing. Diego Veloz Ch. MSc.


Conditional Entropy

Si una variable influye sobre la información, entonces


tendríamos:

entonces:

La influencia de una segunda variable aporta orden y reduce


la incertidumbre. Por lo tanto la entropía se reduce

Ing. Diego Veloz Ch. MSc.


Conditional Entropy

Ciphertext only (c,k)


Known Plaintext (c, p)
Chosen plaintext (c, p)
Chosen ciphertext (p, c)
Chosen text (c or p)

STRENGTH!
Ing. Diego Veloz Ch. MSc.
Language Rate

Number of information bits of each character for n-length


messages:
r = H(X) / N

If there is an equal probability in the language, so:

R = H(X)

For Spanish LAnguage?

Ing. Diego Veloz Ch. MSc.


Language Rate

Ratio language is not that true because of the letter frequency

1,2 < r < 1,5


Hence, there is redundancy

D=R–r
Therefore:
3,25 < D < 3,55
What is the D/R rate?
Ing. Diego Veloz Ch. MSc.
Conditional entropy

Ing. Diego Veloz Ch. MSc.


Perfect security

What is a perfect secret?


https://www.youtube.com/watch?v=vKRMWewGE9A&frags=pl%2Cwn

Ing. Diego Veloz Ch. MSc.


Perfect security

Ing. Diego Veloz Ch. MSc.


Perfect Secret

◉For any M value is accomplished a C probability with


a key K is the same that a C cryptogram as a result of
a M’ diferent encrypted message wih another K.

◉If a cyphered message does not reveal any


information about the message

Ing. Diego Veloz Ch. MSc.


Claude Shannon
◉Claude Shannon, known as “the father
of information theory”
In 1949, introduced the idea of ciphers based
on substitution-permutation (S-P ciphers)
The idea forms the basis of modern block
ciphers
◉S-P cipher is based on the two primitive
operations we have seen before:
Substitution (S-box)
Permutation (P-box)
◉S-P cipher provides confusion & Claude E. Shannon
diffusion of message (1916-2001)

Ing. Diego Veloz Ch. MSc.


Confusion and Diffusion

◉Shannon’s ideas:
Confusion – makes relationship between the ciphertext and key as
complex as possible
Diffusion – dissipates statistical structure of plaintext over bulk of
ciphertext
◉Combining S and P elements to obtain confusion
and diffusion

Ing. Diego Veloz Ch. MSc.


Feistel Cipher

◉Most symmetric block ciphers use a similar


structure as the Feistel Cipher
Devised by Horst Feistel
Block cipher
Block length: 64 bits
It is basically a product cipher,
and implements Shannon’s concept
Encryption / decryption are
very efficient
Horst Feistel
(1915 –1990)

Ing. Diego Veloz Ch. MSc.


Feistel Cipher Structure

◉Partition data into blocks


◉Each block has two halves
A substitution on the left half, based on a function of the right half (&
a sub-key)
Then have permutation swapping halves
◉Process data by multiple rounds

Ing. Diego Veloz Ch. MSc.


Ing. Diego Veloz Ch. MSc.

Feistel Cipher Structure


Feistel Cipher Design Principles

◉Block size
increasing block size provides greater security, but reduces speed of
encryption and decryption
◉Key size
increasing key size improves security, makes exhaustive key
searching harder, but may slow cipher
◉Number of rounds
increasing number improves security, but makes the cipher less
efficient. A typical size is 16 rounds
◉Sub-key generation
greater complexity can make analysis harder, but slows cipher
◉Round function
greater complexity can make analysis harder, but slows cipher
◉Fast software en/decryption and ease of analysis
are more recent concerns for practical use and testing

Ing. Diego Veloz Ch. MSc.


Data Encryption Standard (DES)

◉Most widely used encryption standard based on


block ciphers
◉Useful in commercial applications
◉Adopted in 1977 by the NBS (National Bureau of
Standard, USA)
now NIST (National Institute of Standards and Technology) after 1988
◉Encrypts 64-bit data using 56-bit key

Ing. Diego Veloz Ch. MSc.


DES History

◉IBM developed a cipher (called Lucifer cipher)


By a team led by Feistel in late 60’s
Encrypting 64-bit data blocks with 128-bit key
◉Then re-developed as a commercial cipher with
input from NSA (National Security Agency) and
others, with a reduced key size of 56 bits
◉In 1973 NBS issued request for proposals for a
national cipher standard
◉IBM submitted their revised version which was
eventually accepted as the DES

Ing. Diego Veloz Ch. MSc.


(Stallings – Figure 3.6) Single Round of DES

Key Schedule

Data

Ing. Diego Veloz Ch. MSc.


DES Decryption

◉With Feistel design, decryption steps will use


sub-keys in the reverse order (SK16 … SK1)
The first decryption round undoes the 16th encrypt round,
using the key SK16
……

The 16th decryption round undoes the 1st encrypt round,


using SK1

Ing. Diego Veloz Ch. MSc.


Strength of DES

◉56-bit keys have 256 = 7.2 x 1016 values


◉Brute force search looks hard, but
◉Recent advances have shown that effective
attacks are possible

In 1998 on dedicated h/w, an attack took a few days


In 1999, an attack took 22 hrs!
……

Ing. Diego Veloz Ch. MSc.


Origins of AES

◉Replacement for DES was needed, due to the


attacks
◉An option is to use Triple-DES (3DES)
But it is slow
◉NIST issued call for new ciphers in 1997
◉15 candidates accepted in Jun 1998
◉5 were short listed in August 1999
◉Rijndael was selected as the AES algorithm in
October 2000
◉AES was issued as a standard in November
2001
Ing. Diego Veloz Ch. MSc.
AES Requirements

◉Symmetric key block cipher


◉128-bit data, 128/192/256-bit keys
◉Must be stronger & faster than 3DES
◉Hopefully can be used for 20 years
◉Provide full specification & design details
◉Both C & Java implementations

Ing. Diego Veloz Ch. MSc.


The AES Cipher - Rijndael

◉Designed by Vincent Rijmen & Joan Daemen


from Belgium
◉128/192/256 bit keys,128 bit data
◉Designed to be:
Resistant against known attacks
Speed and code compactness on
many CPUs
Design simplicity
Vincent Rijmen
(born in1970)

Ing. Diego Veloz Ch. MSc.


Rijndael

◉Processes data as 4 groups of 4 bytes (states)


◉Has 9 (or 11, or 13) rounds of encryption, each
round consists of:
Byte substitution (1 S-box used on every byte)
Shift rows (permute bytes between groups/columns)
Mix columns (using matrix multiplication)
Add round key (XOR state with key)
◉All operations can be combined into XOR and
table lookups - hence very fast & efficient.

Ing. Diego Veloz Ch. MSc.


Rijndael Single Round

Ing. Diego Veloz Ch. MSc.


AES – Rijndael Algorithm

◉Processes data as 4 groups of 4 bytes (states)


◉Has 9 (or 11, or 13) rounds of encryption, each
round consists of:
Byte substitution (1 S-box used on every byte)
Shift rows (permute bytes between groups/columns)
Mix columns (using matrix multiplication)
Add round key (XOR state with key)

Ing. Diego Veloz Ch. MSc.


Pre-processing

◉Processes data as 4 groups of 4 bytes


◉In the hexadecimal notation, each of 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, A, B, C, D, E, F represents 4 bits as
follows

0 1 2 3 4 5 6 7

0000 0001 0010 0011 0100 0101 0110 0111

8 9 A B C D E F

1000 1001 1010 1011 1100 1101 1110 1111

Ing. Diego Veloz Ch. MSc.


Pre-processing

◉Then, each block of 128 bits (i.e., 4 groups of 4


bytes) is represented by a 4×4 matrix, for example

Ing. Diego Veloz Ch. MSc.


Byte Substitution

Ing. Diego Veloz Ch. MSc.


Byte Substitution

Ing. Diego Veloz Ch. MSc.


Shifting Rows

Ing. Diego Veloz Ch. MSc.


Mixing Columns

Ing. Diego Veloz Ch. MSc.


Mixing Columns

During this operation, each column is multiplied by a


fixed matrix:

é02 03 01 01ù é2 3 1 1ù
ê 01 02 03 01úú ê1 2 3 1 úú
ê = ê
ê 01 01 02 03ú ê1 1 2 3ú
ê ú ê ú
ë03 01 01 02û ë3 1 1 2û

Ing. Diego Veloz Ch. MSc.


Finite Fields

◉AES uses the finite field GF(28)


b7x7 + b6x6 + b5x5 + b4x4 + b3x3 + b2x2 + b1x + b0
{b7, b6, b5, b4, b3, b2, b1, b0}
◉Byte notation for the element: x6 + x5 + x + 1
{01100011} – binary
{63} – hex
◉Has its own arithmetic operations
Addition
Multiplication

Ing. Diego Veloz Ch. MSc.


Finite Field Arithmetic

◉Addition (XOR)
(x6 + x4 + x2 + x + 1) + (x7 + x + 1) = x7 + x6 + x4 + x2
{01010111} Å {10000011} = {11010100}
{57} Å {83} = {d4}
◉Multiplication is tricky

Ing. Diego Veloz Ch. MSc.


Finite Field Multiplication (•)

(x6 + x4 + x2 + x +1) (x7 + x +1) =


x13 + x11 + x9 + x8 + x7 + x7 + x5 + x3 + x2 + x + x6 + x4 + x2 + x +1
= x13 + x11 + x9 + x8 + x6 + x5 + x4 +
x3 +1
and
These
x13 + x11 + x9 + x8cancel
+ x6 + x5 + x4 + x3 +1 modulo ( x8 + x4 + x3 + x +1)
7 6
= x + x +1.

Irreducible
Polynomial

Ing. Diego Veloz Ch. MSc.


Adding Round Key (XOR)

Ing. Diego Veloz Ch. MSc.


Implementation Aspects

◉Can efficiently implement on 8-bit and/or 32-bit CPU


◉Designers believe the efficient implementation was a
key factor in its selection as the AES cipher

Ing. Diego Veloz Ch. MSc.


Key Distribution

◉Symmetric schemes require both parties to share a


common secret key
◉Issue is how to securely distribute the key
◉Often secure system failure due to a break in the key
distribution scheme

Ing. Diego Veloz Ch. MSc.


Key Distribution

◉ Given parties A and B, have various key


distribution alternatives
A can select key and physically deliver to B
3rd party can select & deliver key to A & B
If A & B have communicated previously can use previous key to
encrypt/decrypt a new key
If A & B have secure communications with a third party C, C can relay
key between A & B

Ing. Diego Veloz Ch. MSc.


Number of Keys

Suppose a symmetric cipher is used.


How many keys are required for a system of n
users?

Answer: n(n-1)/2 ≈ n2

Ing. Diego Veloz Ch. MSc.


Key Hierarchy

◉A KDC (key distribution center) for large


networks, but must trust each other
◉Typically have a hierarchy of keys
◉Session key
temporary key
used for encryption of data between users
for one logical session then discarded
◉Master key
used to encrypt session keys
shared by user & KDC

Ing. Diego Veloz Ch. MSc.


Stream Ciphers

●Process message bit by bit (as a stream)


●Using a random (or pseudo random) keystream
●Usually, based on XOR
●Encryption / Decryption:

Ci = M i Å (i-th Keystream bit)


M i = Ci Å (i-th Keystream bit)

Ing. Diego Veloz Ch. MSc.


Stream Cipher Structure

Ing. Diego Veloz Ch. MSc.


LFSR - An Example of Stream Cipher

st
Å xt yt

Linear-feedback shift register (LFSR)

Ing. Diego Veloz Ch. MSc.


Random Numbers

◉Many uses of random numbers in


cryptography:
Generating session keys
Public key generation
Keystream for a stream cipher
◉In all cases it is critical that these values be
Statistically random with
Uniform distribution
Independence
Unpredictable: cannot infer future sequence on previous
values

Ing. Diego Veloz Ch. MSc.


Pseudorandom Number Generators
(PRNGs)

◉One can use algorithms to create “random


numbers”:
They are “almost random”, but
Not truly random
Called “pseudorandom numbers”
◉An implementation of such an algorithm is called a
pseudorandom number generator (PRNG) – for
example, a LFSR

Ing. Diego Veloz Ch. MSc.


Referencias:
¤ Clases – Conferencias de “Networking and Security” Griffith
University
¤ Stallings, W. (2005). Cryptography and Network Security
(Fourth). Prentice Hall.
¤ Stallings, W. (2004). Fundamentos de seguridad en redes :
aplicaciones y estándares (Second). Madrid: Pearson Prentice
Hall.
¤ García, R. D. M. (). Criptografía clásica y moderna. Septem
Ediciones.https://elibro.net/es/ereader/espoch/102985?pag
e=1
¤ Hernández Encinas, L. (2016). La criptografía. Editorial CSIC
Consejo Superior de Investigaciones Científicas.
https://elibro.net/es/ereader/espoch/41843?page=1

You might also like