Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Funciones Hash
4
Estadísticas
5
¿Hay diferencias en la actualidad?
6
Estadísticas por latitud
7
Crimen Perfecto
8
Ataques a funciones hash
9
Funciones hash
10
Código de Redundancia Cíclica
11
Procedimiento
12
Polinomios generadores
13
Compressed files
14
Pasos
15
Step by step
https://crc32.online/
http://www.ghsi.de/pages/subpages/Online%20CRC%20Calcu
lation/indexDetails.php?Polynom=100&Message=1234
http://www.zorc.breitbandkatze.de/crc.html
http://www.sunshine2k.de/coding/javascript/crc/crc_js.html
https://crccalc.com/
16
¿Hay colisiones?
17
Complemento a uno
http://www.arcesio.net/checksum/ch
ecksumIP.html
18
Lan Manager (LM) / NTLM
https://medium.com/@petergombos/lm-ntl
m-net-ntlmv2-oh-my-a9b235c58ed4
19
MD2
● Es una función de hash criptográfica desarrollada por
Ronald Rivest en 1989 definida en la RFC 1319.
● El algoritmo está optimizado para computadoras de 8 bits.
● El valor hash de cualquier mensaje se forma haciendo que
el mensaje sea múltiplo de la longitud de bloque en el
ordenador y añadiendo un checksum.
● La longitud del resumen es de 128 bits.
● En Marzo del 2011, queda obsoleto según la RFC 6149
20
MD4
● Desarrollado en 1990
● La longitud del resumen es de 128 bits.
● El algoritmo está optimizado para computadoras de 32 bits.
● En 1995 se demostró que se podían generar colisiones en
unos pocos segundos.
● En Marzo del 2011, queda obsoleto según la RFC 6150
21
Muerto en vida...
https://www.linuxadictos.com/linux-kernel-4-18-llega-al-final-de-su-ciclo
-actualiza-ahora.html
22
MD5
23
Añadiendo bits
24
Longitud del mensaje
25
Inicializando el buffer
A = 0x01234567
B = 0x89abcdef
C = 0xfedcba98
D = 0x76543210
26
Procesando el mensaje
27
al fin terminamos!!
28
¿y el mono?
29
Efecto Avalancha
30
MD5 en PHP
<?php
$password="hola";
$password = md5 ( $password );
echo $password;
// Imprime 4d186321c1a7f0f354b297e8914ab240
?>
31
¿Es seguro?
https://www.kb.cert.org/vuls/id/836068/
32
Estado actual
● En Diciembre de 2010 se publicó la primera colisión de un
bloque simple (512 bits).
● Al que encuentre una colisión para un mensaje de 64 bytes
diferente a la publicada antes del 1 de Enero de 2013 se le
pagarán US$10.000.
http://eprint.iacr.org/2010/643.pdf
33
Single-block collision for MD5
34
2 Images, one MD5 Hash with HashClash
https://natmchugh.blogspot.com/2015/02/create-your-
own-md5-collisions.html 35
MD5 Collision
36
¿Dónde lo podemos ver aún?
37
¿Qué y cómo calcular?
38
SHA (Secure Hash Algorithm)
39
¿Cómo funciona?
40
¿Alguna diferencia?
41
Cálculo de SHA
42
Inicializando el buffer
A = 0x 67 45 23 01
B = 0x EF CD AB 89
C = 0x 98 BA DC FE
D = 0x 10 32 54 76
E = 0x C3 D2 E1 F0
43
Words
Wt = Mt , para t entre 0 y 15
Wt = (Wt -3 XOR Wt -8 XOR Wt -14 XOR Wt -16) <<< 1, para t
entre 16 y 79.
44
Funciones
45
Constantes
46
Diagrama
47
Efecto Avalancha
48
Better than MD5
49
SHA-1
https://blog.segu-info.com.ar/2019/05/sha-1-
ha-muerto-ataque-de-colision-con.html
50
SHA-1
https://sha-mbles.github.io/
51
LinkedIn’s salted double-hashed
https://securityuncorked.com/2012/06/how-to-
crack-your-own-linkedin-password-hash/
52
RIPEMD-160
https://hash.online-convert.com/es/generador-ripemd160
53
Variaciones SHA-2
● SHA-256:
○ 8 bloques de 32 bits
● SHA-384
○ valor de inicio es diferente
● SHA-512
○ 8 bloques de 64 bits
https://www.iso.org/standard/37416.html
55
New SHA-512 versions (2011)
https://www.schneier.com/blog/archives/201
1/02/nist_defines_ne.html 56
OpenSSL speed
57
python.crypto
¿Dificultad de implementar?
>>> from Crypto.Hash import SHA256
>>> m = SHA256.new()
>>> m.update(’abc’)
>>> m.hexdigest()
’ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad’
58
Benchmark MD5 vs SHA
60
SHA for Intel
https://neosmart.net/blog/2017/will-amds-ryzen-finally-
bring-sha-extensions-to-intels-cpus/ 61
62
List of possible hashes
63
Hashcat online
https://colab.research.google.com/github/someshkar/colab
cat/blob/master/colabcat.ipynb?authuser=1
64
SHA-3
Puntos a considerar:
● Costo de la implementación en hardware
● Velocidad de la implementación
● Energía requerida para generar el hash
65
Seleccionados SHA-3
Final round:
● BLAKE
● Grøstl
● JH
● Keccak
● Skein
66
Benchmark
Prueba se realizada en Ubuntu 10.10 de 64 bits que ejecuta
PHP 5.3.3-1ubuntu9.3 en modo CLI. La CPU es un Intel Core2
Duo T9300 @ 2.50GHz y la máquina tiene 4 GB RAM. Durante
toda la duración de la prueba, el uso de la CPU alcanzó un
máximo del 85% y el uso de la memoria alcanzó un máximo
del 25%.
67
SHA-3
Keccak es el algoritmo ganador y está disponible en
https://github.com/gvanas/KeccakCodePackage
https://www.federalregister.gov/ 68
Hash Generator
https://www.browserling.com/tools/all-hashes
69
Blake3 (2020)
https://en.wikipedia.org/wiki/Comparison_of_cr
yptographic_hash_functions 70
Authentication Protocol Algorithms
https://docs.oracle.com/cd/E19253-01/817-3000/securi
ty-4/index.html
71
Length extension attack
https://github.com/marcelo140/length-extension
https://github.com/iagox86/hash_extender
https://en.wikipedia.org/wiki/Length_extension_attack
72
Demo Extension Attacks
https://es.slideshare.net/exploresecurity/hash-length-extension-attacks
https://slideplayer.com/slide/4168856/
https://www.javacodegeeks.com/2012/07/hash-length-extension-attacks.html
https://d0nut.medium.com/week-17-hash-length-extensions-7f7e02e62fb5
https://seedsecuritylabs.org/Labs_16.04/PDF/Crypto_Hash_Length_Ext.pdf
https://www.synopsys.com/blogs/software-security/forging-sha-1-mac-using-length-extensio
n-attack-python/
https://dzone.com/articles/forging-a-sha-1-mac-using-a-length-extension-attac
73
HMAC vs MAC
74
HMAC (Hash-based message
authentication code)
RFC 2104
75
HMAC-SHA1
ipad es el inner padding (0x363636…3636)
opad es el outer padding (0x5c5c5c…5c5c)
http://www.freeformatter.com/hmac-generator.html 76
HMAC Generator
77
HOTP (HMAC OTP)
RFC 4226
http://en.wikipedia.org/ 78
Challenge-Response Authentication Mechanism
79
CRAM-MD5 Challenge
80
DIGEST-MD5 vs CRAM-MD5
81
Authentication Protocols
● OAuth
● OAuth 2.0
● OpenID
● OpenID Connect
● LDAP Authentication
● Kerberos
● DIGEST-MD5
● GSSAPI
● SASL
● SAML
● Java Authentication and Authorization Service (JAAS)
● NMAS
● FIDO
https://ldapwiki.com/wiki/Authentication%20Protocol
82
CPU vs GPU
83
Blowfish crypt
84
Why slow computer speed is better?
https://hackernoon.com/switching-from-bcrypt-to-sha2
-may-save-your-cpu-and-your-sanity-806733765b27 85
Bcrypt
go get -u github.com/bitnami/bcrypt-cli
echo -n supersecret | bcrypt-cli
86
Sazonando la seguridad
87
Bcrypt acronym
$2a$ https://www.browserling.com/tools/bcrypt
$2y$ (2011) https://bcrypt-generator.com/
$2b$ (2014) https://passwordhashing.com/BCrypt?plainText=supersecret
https://stackoverflow.com/questions/15733196/whe
re-2x-prefix-are-used-in-bcrypt 88
Bcrypt + salt generator
89
Bcrypt in PHP
http://sandbox.onlinephpfunctions.com/code/d4d
06122ca9c328a83b43b3c0e51736e347d54db 90
Cómputo exponencial
91
*-crypt algorithms
http://man7.org/linux/man-pages/man3/crypt.3.html
92
Key Derivation Function
93
Key Derivation Functions
94
How to crack bcrypt efficiently
http://arstechnica.com/
https://blog.cynosureprime.com/2015/09/how-we-c
racked-millions-of-ashley.html
95
History
96
Scrypt
97
Bcrypt vs Argon2
https://synkre.com/how-secure-is-bcrypt/
98
Argon2
99
PBKDF2 año 2000 vs 2017
● RFC 2898
● RFC 8018
https://en.wikipedia.org/wiki/PBKDF2
100
Lista de implementaciones
101
NPM Trends
102
PBKDF2
103
Hashing Passwords
104
105
Argon2
https://argon2.online/
106
Hash for IoT
https://www.cryptolux.org/index.php/Lightweight_Hash_Functions
107
Infraestructura
108
Light Weight Cryptography environment
https://medium.com/asecuritysite-when-bob-met-alice/shake
-stirs-up-crypto-7d87f3cf39f4 109
Shake
110
Security strengths
111
Lookup table / rainbow table
https://www.slideshare.net/gonalv
mar/rainbow-tables
112
¿Cómo funciona?
https://es.wikipedia.org/wiki/Tabla_arco
%C3%ADris 113
OPHcrack LiveCD
http://ophcrack.sourceforge.net/
114
OPHcrack tables
http://ophcrack.sourceforge.net/tables.php
115
Pre-computed Hash Table
https://a.ndronic.us/pre-co
mputed-hash-table-v-1-0/ 116
ISO/IEC 10118-3:2018
https://www.iso.org/standard/67116.html
117
Extremely fast Hash algorithm
https://github.com/Cyan4973/xxHash
118
Fuzzy hashing
119
Child Sexual Abuse Material (CSAM) detection
https://github.com/KhaosT/nhcalc
120
NeuralHash collisions
https://gist.github.com/unrealwill/c480371c3
a4bf3abb29856c29197c0be 121
Subresource Integrity (SRI) Hash
123
FIN