8. Hash algorithms
• Generate a constant size fingerprint whatever
data in entry
• It’s hard to find the message from the given hash
(First Preimage Resistance)
• It’s hard to modify a message without hash
being changed (Second Preimage Resistance)
• It’s hard to find two different messages with the
same hash (Resistance to Collisions)
• Very fast calculation
mercredi 23 novembre 2011
9. Cryptographic
Hash algorithms
• Generate a constant size fingerprint whatever
data in entry
infeasible
• It’s hard to find the message from the given hash
(First Preimage Resistance)
infeasible
• It’s hard to modify a message without hash
being changed (Second Preimage Resistance)
infeasible
• It’s hard to find two different messages with the
same hash (Resistance to Collisions)
• Very fast calculation
mercredi 23 novembre 2011
11. Hash functions
Integrity checking : Fingerprint or checksum
hash()
File 415a15b606eff4d4ba97ef64ecd2e598
mercredi 23 novembre 2011
12. Hash functions
Integrity checking : Fingerprint or checksum
hash()
File 415a15b606eff4d4ba97ef64ecd2e598
Very low probability of collision !
Hard to change file without changing hash !
Fast algorithm !
mercredi 23 novembre 2011
14. Hash functions
Password encryption :
hash()
password 415a15b606eff4d4ba97ef64ecd2e598
Hard to calculate password from the
hash !
mercredi 23 novembre 2011
15. Hash functions
Remember me tokens :
username + expiration date + hash(password)
hash()
415a15b606eff4d4ba97ef64ecd2e598
Remember me token = hash(...) + username + expiration date
mercredi 23 novembre 2011
16. Password hashing leaks
• Brute force
• Dictionary
• Rainbow table
mercredi 23 novembre 2011
17. Password hashing leaks
• Brute force
• Dictionary
• Rainbow table
mercredi 23 novembre 2011
18. Salted hash functions
Salted hash password :
hash()
salt + password hash(salt+password)
mercredi 23 novembre 2011
19. Salted hash functions
Salted hash password :
hash()
salt + password hash(salt+password)
secret and / or
user dependent
mercredi 23 novembre 2011
20. Salted hash functions
Salted hash password :
hash()
salt + password hash(salt+password)
secret and / or
user dependent
Prevents from dictionary and
rainbow table attacks !
mercredi 23 novembre 2011
21. Hash function algorithms
• Message Digest 5
• 128 bits fingerprint size
• Secured Hash Algorithm
• many version (SHA1, SHA256 ...)
• 160 to 512 bits fingerprint size
mercredi 23 novembre 2011
22. Hash function algorithms
• Message Digest 5 @deprecated
• 128 bits fingerprint size
• Secured Hash Algorithm
• many version (SHA1, SHA256 ...)
• 160 to 512 bits fingerprint size
mercredi 23 novembre 2011
23. Symmetric algorithms
• Shared secret key algorithm
• Same key used to cipher and decipher
• Fast algorithm
mercredi 23 novembre 2011
24. Popular symmetric
algorithms
• Advanced Encryption Standard
• Blowfish
• Digital Encryption Standard and 3DES
mercredi 23 novembre 2011
25. Popular symmetric
algorithms
• Advanced Encryption Standard
• Blowfish
• Digital Encryption Standard and 3DES
@deprecated
mercredi 23 novembre 2011
46. Digital signature
Unchanged hash means
unaltered message
compare hash("hello.")
with :
dsa("er2f@!e..", PuK.alice)
Bob checks signature
with Alice public key
mercredi 23 novembre 2011
57. Public Key Infrastructure !
• Public key certificate
• Certificate management
mercredi 23 novembre 2011
58. Public key certificates
• Binds public key with Identity
• Can be used to :
• authenticate a user
• cipher data (email, communications ...)
• prove identity (SSL)
• signing a document
• signing a certificate (CA certificate)
• ...
mercredi 23 novembre 2011
59. Public key
certificate
anatomy
(TLS certificate)
mercredi 23 novembre 2011
61. Public key certificate anatomy -
Issuer
Issuer Distinguished Name
mercredi 23 novembre 2011
62. Public key certificate anatomy -
Issuer
Issuer Distinguished Name
Issuer ≠ Subject :
• Not a CA certificate
• Not a self signed certificate
mercredi 23 novembre 2011
69. Public key certificate anatomy -
Extensions
Not a CA certificate
mercredi 23 novembre 2011
70. Public key certificate anatomy -
Extensions
Not a CA certificate
Revocation List
mercredi 23 novembre 2011
71. Public key certificate anatomy -
Extensions
Not a CA certificate
Revocation List
Certificate usage (TLS)
mercredi 23 novembre 2011
72. Public key certificate anatomy -
Extensions
Not a CA certificate
Revocation List
Certificate usage (TLS)
Issuer CA certificate location
mercredi 23 novembre 2011
74. Public key certificate anatomy -
Certificate signature
The certificate SHA1 fingerprint is signed with Issuer
private key
mercredi 23 novembre 2011
75. Certificate fingerprint
signature
• Self signed or signed by CA
• Prevents certificate corruption
• CA signing proves identity if the CA is
trusted
mercredi 23 novembre 2011
86. Certificate management
CR is signed with Manage CRL or OCSP
CA private key
mercredi 23 novembre 2011
87. Certificate management
CR is signed with Manage CRL or OCSP
CA private key
mercredi 23 novembre 2011
88. Certificate management
CR is signed with Manage CRL or OCSP
CA private key
Check Bob certificate
with CA certificate
mercredi 23 novembre 2011
89. Certificate management
CR is signed with Manage CRL or OCSP
CA private key
Check Bob certificate
with CA certificate
mercredi 23 novembre 2011
90. Certificate management
CR is signed with Manage CRL or OCSP
CA private key
Check Bob
certificate validity
Check Bob certificate
with CA certificate
mercredi 23 novembre 2011
91. Private key storage
• Password protected PKCS12 file
• Cryptographic token :
• password protected
• key pair generation (not possible to take the
private key out)
• process asymmetric algorithms (RSA, DSA,
Diffie-Hellman ...)
mercredi 23 novembre 2011
92. Private key storage
• Password protected PKCS12 file
• Cryptographic token :
• password protected
• key pair generation (not possible to take the
private key out)
• process asymmetric algorithms (RSA, DSA,
Diffie-Hellman ...)
Two Factors Authentication :
protect with something you know and something
you have
mercredi 23 novembre 2011
93. Certificate revocation
• Two protocols :
• Certificate Revocation List
• Online Certificate Status Protocol
• CRL provides a full certificates revocation
list
• OCSP is request/response protocol
mercredi 23 novembre 2011
94. One Time Password
• Token and password (PIN) based
authentication system
• Token uses a clock and a secret algorithm
to generate a OTP
• OTP server use the same algorithm to
validate the OTP
mercredi 23 novembre 2011
95. Conclusion
• What’s going on if you loose your
ciphering private key (or PKCS12
password) ?
• Are the Registration Authority validation
process safe ?
mercredi 23 novembre 2011