Documente Academic
Documente Profesional
Documente Cultură
TEMA 2
TCNICAS CRIPTOGRFICAS BSICAS
(Y SERVICIOS DE SEGURIDAD ASOCIADOS)
Algoritmos simtricos
Fundamentos
Algoritmo DES
Algoritmo triple-DES
Algoritmo AES
Otros algoritmos simtricos
Modos de operacin para algoritmos simtricos
Ventajas y desventajas de los algoritmos simtricos
SEGURIDAD DE LA INFORMACIN - Tema 2: Tcnicas Criptogrficas Bsicas
Referencias bibliogrficas
D (C) = M
Se cumple que:
D (E (M)) = M
SEGURIDAD DE LA INFORMACIN - Tema 2: Tcnicas Criptogrficas Bsicas
a
b
c
d
e
...
Ejemplo:
01
94
03
31
76
24
...
10
Mensaje cifrado:
ELNEATNADSAOLNULCAISAMEOLNMTUALHAASCMEANSYAELLTVAES
11
Cifrado Producto
Combinan sustitucin y transposicin
Se pueden considerar como la aplicacin sucesiva de varios cifrados Ei
E = E1 . E2 . . Er
E (M) = E1 (E2 ( (Er (M))
La composicin de funciones de descifrado Di se realiza en orden
inverso
D = Dr Dr-1 D1
M = D(C) = Dr (Dr-1 (... (D1 (C)))
Es un esquema utilizado para obtener un alto grado de seguridad con
sistemas relativamente sencillos aplicados reiterativamente
Dan lugar a sistemas de cifrado complejos, seguros, difciles de atacar,
fcilmente trasladables a un ordenador
SEGURIDAD DE LA INFORMACIN - Tema 2: Tcnicas Criptogrficas Bsicas
12
Cifrado Vernam
Variante del cifrado llamado one-time pad (OTP)
Un one-time pad es un conjunto infinito y
no repetitivo de letras aleatorias
Cada letra del pad se usa para cifrar una
nica letra del texto en claro, en mdulo n (longitud del alfabeto)
Texto : T H I S I S S E C R E T
OTP: XVH E UW NO P G D Z
----------------------------------------Cifrado : QCPW CO FS R X H S
One-Mme
pad
booklet
and
microdot
reader,concealed
in
a
toy
truck
and
used
by
an
illegal
agent
that
operated
in
Canada.
Canadian
Security
Intelligence
Service
13
Otro ejemplo
Aqu se observan grupos de tres filas, que se corresponden con criptograma, clave, y
texto en claro (en decimal)
Fuente: http://www.caslab.cl/che.php
14
15
Algoritmos simtricos
16
Fundamentos
En la mayora de los ejemplos de la seccin anterior la
comunicacin entre los usuarios puede representarse como sigue:
Alice
Bob
17
E3
E2
SEGURIDAD DE LA INFORMACIN - Tema 2: Tcnicas Criptogrficas Bsicas
en direccin a Bob
en
direccin
a
Carol
18
K1
M
K3
en
direccin
a
Dave
M
M
E
K2
en direccin a Bob
en direccin a Carol
19
E
K1
K1*
Bob
Alice
21
A partir de la expresin
E (M) = C
se podra pensar que el algoritmo de cifrado procesa todo el
mensaje de una sola vez
Sin embargo, por cuestiones de diseo, es raro que ocurra eso
22
23
24
25
Red de Feistel
26
27
28
29
63
40
39
38
37
36
35
34
33
Cajas S
55
58
60
62
64
57
59
61
63
40
39
38
37
36
35
34
33
8
7
6
5
4
3
2
1
47 (a) Initial
39 Permutation
31
23
(IP)
50
42 Initial
34 Permutation
26
18(IP1)10
(b) Inverse
52
44
36
28
20
12
54
30
22
1464
4846
1638
56
24
56
32
24
1663
4748
1540
55
23
49
25
17
9
4641
1433
54
22
62
51
43
35
27
19
11
45
13
53
21
61
53
45
37
29
21
13
4447
1239
52
20
55
31
23
1560
43
8
7
6
5
4
3
2
1
32
4
8
12
16
20
24 32
28 4
13
16
1
2
19
11
51
19
10 Permutation
50
18
(b)42
Inverse Initial
(IP1)
8
12
16
7 20
15 24
8 28
16
1
2
19
15
7
15
8
13
41
49
17
59
58
57
48
16
56
24
47
15
55
23
(c) Expansion
Permutation
(E)
46
14
54
22
45
13
53
21
1
2
3
4
44
12
52
20
5 43
611
7
8
51
19
9 42
1010
11
12
50
18
1341
149
15
16
49
17
64
63
62
61
5
60
9
59
5813
5717
17
18
19
20
(c) Expansion Permutation (E)
21
22
23
24
25 1
262
27
3
428
29 5
306
31
7
832
21
25
5 29
91
10
11
12
(d) 13
Permutation
Function
(P)
14
15
16
17
18
19
20
23
24
2021
2122
29
12
27
28
2325
2626
5
18
31
32
2429
1430
32
27
30(d) Permutation
6
22
11
Function (P)
20
23
24
30
21
26
14
6
29
5
32
22
12
18
27
11
7
2
4
6
8
1
3
5
7
32
31
30
29
28
27
26
25
13
17
21
2528
2931
13
17
10
9
25
4
28
31
3
4
32
31
30
29
28
27
26
25
17
10
9
25
30
PC1
Nmero
de
desplazamientos
PC2
31
32
33
Sin embargo,
se puede suponer que el criptoanalista va a disponer
Table 2.2 Average Time Required for Exhaustive Key Search
de capacidad de descrifado con microprocesadores en paralelo y,
por lo tanto, la situacin cambia drsticamente:
Number of alternative
keys
32
2.15 milliseconds
56
128
168
26 characters
(permutation)
26! = 4 1026
10.01 hours
Algoritmo Triple-DES
Para aprovechar las ventajas del DES, y a la vez contrarrestar su
escasa longitud de clave, los organismos de estandarizacin han
adoptado el criptosistema Triple-DES ( 3DES)
Consiste en usar una
secuencia de tres
operaciones DES,
con 3 claves distintas
35
Existe una variante en la que se utilizan slo dos claves, pero este
esquema ha sido objeto de ataques
36
37
La figura muestra el
proceso de cifrado en
AES para 128 bits de
clave (10 etapas)
Otras posibilidades:
192 bits (12 etapas)
256 bits (14 etapas)
38
k0
k4
k8 k12
k1
k5
k9 k13
k2
k6 k10 k14
w0 w1
N0 N1
k3
k7 k11 k15
N1 N0
w0 w1 w2 w3
w2 w3
N1' N0'
xi+2
w4 w5 w6 w7
w4 w5
.
.
.
(a) Overall algorithm
w'
(b) Function g
Funcin g
39
40
41
Operacin de cifrado
Operacin de descifrado
42
Kasumi
Requiere una clave de 128 bits de longitud, y la longitud de los bloque de datos es de 64 bits
Se usa en UMTS (con el nombre UIA1) y en GSM (con el nombre A5/3)
Presenta una serie de problemas que no afectan a su uso prctico en esas apllicaciones
sin embargo, no se recomienda para aplicaciones futuras
Camellia
Requiere una clave de 128 bits, pero tambin da soporte a claves de 192 y 256 bits
Las versiones con 192 o 256 bits de clave son un 33% ms lentas que la de 128 bits
43
Recomendaciones generales:
En general, la longitud mnima de clave para un cifrado simtrico en bloque
debera ser 128 bits
El tamao mnimo de los bloques de datos depender de la aplicacin
especfica en la que se use el algoritmo, pero en la mayora de ocasiones el
mnimo deberia ser 128 bits
La cantidad mxima de informacin a cifrar con una misma clave debera
limitarse a 2n/2, donde n es el tamao del bloque de datos
44
45
46
47
48
defined as follows:
CBC Encryption:
CBC Decryption:
C1 = CIPHK(P1 IV);
Cj = CIPHK(Pj Cj-1)
-1
ENCRYPT
PLAINTEXT 2
PLAINTEXT n
INPUT BLOCK 1
INPUT BLOCK 2
INPUT BLOCK n
CIPHK
CIPHK
CIPHK
OUTPUT BLOCK 1
OUTPUT BLOCK 2
OUTPUT BLOCK n
CIPHERTEXT 1
CIPHERTEXT 2
CIPHERTEXT n
CIPHERTEXT 1
CIPHERTEXT 2
CIPHERTEXT n
INPUT BLOCK 1
INPUT BLOCK 2
INPUT BLOCK n
CIPH-1K
CIPH-1K
CIPH-1K
OUTPUT BLOCK 1
OUTPUT BLOCK 2
OUTPUT BLOCK n
DECRYPT
PLAINTEXT 1
INITIALIZATION
VECTOR
for j = 2 n.
INITIALIZATION
VECTOR
for j = 2 n.
PLAINTEXT 1
PLAINTEXT 2
PLAINTEXT n
49
from every plaintext segment. In general, each successive input block is enciphered to produce
an output block. The s most significant bits of each output block are exclusive-ORed with the
corresponding plaintext segment to form a ciphertext segment. Each ciphertext segment (except
the last one) is fed back into the previous input block, as described above, to form a new input
block. The feedback can be described in terms of the individual bits in the strings as follows: if
th
i1i2ib is the jth input block, and c1c2cs is the jth ciphertext segment, then the (j+1) input block
is is+1is+2ib c1c2cs.
ENCRYPT
INITIALIZATION
VECTOR
PLAINTEXT 1
s Bits
INPUT BLOCK 1
INPUT BLOCK 2
(b-s) Bits s Bits
CIPHK
CIPHK
CIPHK
OUTPUT BLOCK 1
Select Discard
s Bits
(b-s) Bits
OUTPUT BLOCK 2
Select Discard
s Bits
(b-s) Bits
OUTPUT BLOCK n
Select Discard
s Bits
(b-s) Bits
PLAINTEXT 2
s Bits
INPUT BLOCK n
(b-s) Bits s Bits
PLAINTEXT n
s Bits
CIPHERTEXT 2
s Bits
CIPHERTEXT 1
s Bits
CIPHERTEXT n
s Bits
INITIALIZATION
VECTOR
INPUT BLOCK 2
(b-s) Bits s Bits
INPUT BLOCK 1
DECRYPT
CIPHK
CIPHK
PLAINTEXT 1
s Bits
CIPHK
OUTPUT BLOCK 2
Select Discard
s Bits
(b-s) Bits
OUTPUT BLOCK 1
Select Discard
s Bits
(b-s) Bits
CIPHERTEXT 1
s Bits
INPUT BLOCK n
(b-s) Bits s Bits
CIPHERTEXT 2
s Bits
PLAINTEXT 2
s Bits
OUTPUT BLOCK n
Select Discard
s Bits
(b-s) Bits
CIPHERTEXT n
s Bits
PLAINTEXT n
s Bits
In CFB decryption, the IV is the first input block, and each successive input block is formed as in
50
also transformed by the forward cipher function to produce the third output block. Thus, the
successive output blocks are produced from applying the forward cipher function to the previous
output blocks, and the output blocks are exclusive-ORed with the corresponding ciphertext
blocks to recover the plaintext blocks. For the last block, which may be a partial block of u bits,
the most significant u bits of the last output block are used for the exclusive-OR operation; the
remaining b-u bits of the last output block are discarded.
ENCRYPT
INITIALIZATION
VECTOR
INPUT BLOCK 1
INPUT BLOCK 2
INPUT BLOCK n
CIPHK
CIPHK
CIPHK
OUTPUT BLOCK 2
OUTPUT BLOCK 1
PLAINTEXT 1
PLAINTEXT 2
OUTPUT BLOCK n
PLAINTEXT n
CIPHERTEXT 2
CIPHERTEXT 1
CIPHERTEXT n
DECRYPT
INITIALIZATION
VECTOR
CIPHERTEXT 1
INPUT BLOCK 1
INPUT BLOCK 2
INPUT BLOCK n
CIPHK
CIPHK
CIPHK
OUTPUT BLOCK 1
OUTPUT BLOCK 2
OUTPUT BLOCK n
CIPHERTEXT 2
PLAINTEXT 1
PLAINTEXT 2
CIPHERTEXT n
PLAINTEXT n
51
ENCRYPT
Counter (CTR)
PLAINTEXT 1
COUNTER 1
COUNTER 2
COUNTER n
INPUT BLOCK 1
INPUT BLOCK 2
INPUT BLOCK n
CIPHK
CIPHK
OUTPUT BLOCK 1
OUTPUT BLOCK 2
PLAINTEXT 2
DECRYPT
CIPHERTEXT 1
. . . . .
CIPHK
OUTPUT BLOCK n
PLAINTEXT n
CIPHERTEXT n
CIPHERTEXT 2
COUNTER 1
COUNTER 2
COUNTER n
INPUT BLOCK 1
INPUT BLOCK 2
INPUT BLOCK n
CIPHK
CIPHK
OUTPUT BLOCK 1
OUTPUT BLOCK 2
CIPHERTEXT 1
CIPHERTEXT 2
PLAINTEXT 1
. . . . .
PLAINTEXT 2
CIPHK
OUTPUT BLOCK n
CIPHERTEXT n
PLAINTEXT n
52
Description
Each block of 64 plaintext bits is
encoded independently using the
same key.
Typical Application
Secure transmission of
single values (e.g., an
encryption key)
General-purpose blockoriented transmission
Authentication
Counter (CTR)
Stream-oriented
transmission over noisy
channel (e.g., satellite
communication)
53
54
Desventajas:
En una comunicacin entre dos usuarios, estos han de acordar, a priori, la clave
K con la que cifrarn/descifrarn sus comunicaciones
la clave ha de permanecer estrictamente en secreto, por lo que slo la han conocer esos dos
usuarios que se comunican
Si los dos usuarios estn fsicamente lejanos entre s, acordar la clave puede
convertirse en una tarea difcil
qu medio suficientemente seguro habrn de utilizar si no es posible una reunin presencial
entre ambos?
adems, a efectos de seguridad, es recomendable que la clave K entre dos usuarios se cambie
con cierta frecuencia, lo que complica el problema
En una red grande (de muchos usuarios) habr demasiadas claves que
administrar
Para una comunidad de n usuarios, el nmero de claves en el sistema ser de (n * (n-1)) / 2
Ej: 100 usuarios 4950 claves
Probablemente har falta una tercera parte confiable para ayudar a los usuarios en las tareas de
administracin de claves
55