Crypto and PKI

1,501 views

Published on

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,501
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
84
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Crypto and PKI

  1. 1. Introducing cryptography and PKI David Galichetmercredi 23 novembre 2011
  2. 2. Cryptography challengesmercredi 23 novembre 2011
  3. 3. Authentication • Application authentication • Single Sign On • One Time Password • Remember me • ...mercredi 23 novembre 2011
  4. 4. Integrity • Data are not corrupted • Data are not intentionally alteredmercredi 23 novembre 2011
  5. 5. Privacy • Protect data transfer • Protect stored datamercredi 23 novembre 2011
  6. 6. Identity • Authentication (user and server side) • Signature (document, application packages ...) • Non repudiation • Trusted Timestamps • Anonymity (electronic vote, alternative currency ...) • ...mercredi 23 novembre 2011
  7. 7. Cryptography basis • Hash functions • Symmetric ciphering • Asymmetric cipheringmercredi 23 novembre 2011
  8. 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 calculationmercredi 23 novembre 2011
  9. 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 calculationmercredi 23 novembre 2011
  10. 10. Hash functions Integrity checking : hash() File 415a15b606eff4d4ba97ef64ecd2e598mercredi 23 novembre 2011
  11. 11. Hash functions Integrity checking : Fingerprint or checksum hash() File 415a15b606eff4d4ba97ef64ecd2e598mercredi 23 novembre 2011
  12. 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
  13. 13. Hash functions Password encryption : hash() password 415a15b606eff4d4ba97ef64ecd2e598mercredi 23 novembre 2011
  14. 14. Hash functions Password encryption : hash() password 415a15b606eff4d4ba97ef64ecd2e598 Hard to calculate password from the hash !mercredi 23 novembre 2011
  15. 15. Hash functions Remember me tokens : username + expiration date + hash(password) hash() 415a15b606eff4d4ba97ef64ecd2e598 Remember me token = hash(...) + username + expiration datemercredi 23 novembre 2011
  16. 16. Password hashing leaks • Brute force • Dictionary • Rainbow tablemercredi 23 novembre 2011
  17. 17. Password hashing leaks • Brute force • Dictionary • Rainbow tablemercredi 23 novembre 2011
  18. 18. Salted hash functions Salted hash password : hash() salt + password hash(salt+password)mercredi 23 novembre 2011
  19. 19. Salted hash functions Salted hash password : hash() salt + password hash(salt+password) secret and / or user dependentmercredi 23 novembre 2011
  20. 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. 21. Hash function algorithms • Message Digest 5 • 128 bits fingerprint size • Secured Hash Algorithm • many version (SHA1, SHA256 ...) • 160 to 512 bits fingerprint sizemercredi 23 novembre 2011
  22. 22. Hash function algorithms • Message Digest 5 @deprecated • 128 bits fingerprint size • Secured Hash Algorithm • many version (SHA1, SHA256 ...) • 160 to 512 bits fingerprint sizemercredi 23 novembre 2011
  23. 23. Symmetric algorithms • Shared secret key algorithm • Same key used to cipher and decipher • Fast algorithmmercredi 23 novembre 2011
  24. 24. Popular symmetric algorithms • Advanced Encryption Standard • Blowfish • Digital Encryption Standard and 3DESmercredi 23 novembre 2011
  25. 25. Popular symmetric algorithms • Advanced Encryption Standard • Blowfish • Digital Encryption Standard and 3DES @deprecatedmercredi 23 novembre 2011
  26. 26. Private message exchangemercredi 23 novembre 2011
  27. 27. Private message exchange Shared secret keymercredi 23 novembre 2011
  28. 28. Private message exchange Shared secret key Ciphering with Ksmercredi 23 novembre 2011
  29. 29. Private message exchange Shared secret key Ciphering Deciphering with Ks with Ksmercredi 23 novembre 2011
  30. 30. Secret key exchange problemmercredi 23 novembre 2011
  31. 31. Secret key exchange problem High number of secret keys to manage !mercredi 23 novembre 2011
  32. 32. Secret key exchange problem High number of secret keys to manage ! How to share the secret key ?mercredi 23 novembre 2011
  33. 33. Asymmetric algorithm • Key pair based algorithm • Shared public key • Protected private key • Key size :1024 to 4096 bits • Slow algorithm • Max encryption size = key sizemercredi 23 novembre 2011
  34. 34. Popular asymmetric algorithm • Rivest, Shamir and Adelman (signing and encryption) • Digital Signature Algorithm (signature only) • Elliptic Curves Cryptographymercredi 23 novembre 2011
  35. 35. Asymmetric ciphering analogymercredi 23 novembre 2011
  36. 36. Asymmetric ciphering analogy Public key Private keymercredi 23 novembre 2011
  37. 37. Asymmetric ciphering analogy Public key Private keymercredi 23 novembre 2011
  38. 38. Asymmetric ciphering analogy Public key Private keymercredi 23 novembre 2011
  39. 39. Asymmetric ciphering analogy Public key Private keymercredi 23 novembre 2011
  40. 40. Asymmetric cipheringmercredi 23 novembre 2011
  41. 41. Asymmetric ciphering Ciphering with Bob Public Keymercredi 23 novembre 2011
  42. 42. Asymmetric ciphering Deciphering Ciphering with Bob Private Key with Bob Public Keymercredi 23 novembre 2011
  43. 43. Digital signaturemercredi 23 novembre 2011
  44. 44. Digital signature dsa(hash(ˮHello.ˮ),PrK.alice Alice sign with Only hash of the her private key message is signedmercredi 23 novembre 2011
  45. 45. Digital signaturemercredi 23 novembre 2011
  46. 46. Digital signature Unchanged hash means unaltered message compare hash("hello.") with : dsa("er2f@!e..", PuK.alice) Bob checks signature with Alice public keymercredi 23 novembre 2011
  47. 47. Diffie-Hellmankey exchange algorithmmercredi 23 novembre 2011
  48. 48. Diffie-Hellmankey exchange algorithmmercredi 23 novembre 2011
  49. 49. Diffie-Hellmankey exchange algorithmmercredi 23 novembre 2011
  50. 50. Diffie-Hellmankey exchange algorithmmercredi 23 novembre 2011
  51. 51. Diffie-Hellmankey exchange algorithmmercredi 23 novembre 2011
  52. 52. Diffie-Hellmankey exchange algorithmmercredi 23 novembre 2011
  53. 53. Diffie-Hellmankey exchange algorithmmercredi 23 novembre 2011
  54. 54. Diffie-Hellmankey exchange algorithmmercredi 23 novembre 2011
  55. 55. Public key sharingmercredi 23 novembre 2011
  56. 56. Public key managementmercredi 23 novembre 2011
  57. 57. Public Key Infrastructure ! • Public key certificate • Certificate managementmercredi 23 novembre 2011
  58. 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. 59. Public key certificate anatomy(TLS certificate)mercredi 23 novembre 2011
  60. 60. Public key certificate anatomy - Issuermercredi 23 novembre 2011
  61. 61. Public key certificate anatomy - Issuer Issuer Distinguished Namemercredi 23 novembre 2011
  62. 62. Public key certificate anatomy - Issuer Issuer Distinguished Name Issuer ≠ Subject : • Not a CA certificate • Not a self signed certificatemercredi 23 novembre 2011
  63. 63. Public key certificate anatomy - Subjectmercredi 23 novembre 2011
  64. 64. Public key certificate anatomy - Subject Certificate validitymercredi 23 novembre 2011
  65. 65. Public key certificate anatomy - Subject Subject Distinguished Name Certificate validitymercredi 23 novembre 2011
  66. 66. Public key certificate anatomy - Subject Subject Distinguished Name Certificate validity Certified URLmercredi 23 novembre 2011
  67. 67. Public key certificate anatomy - Subject Subject Distinguished Name Certificate validity Certified URL Public keymercredi 23 novembre 2011
  68. 68. Public key certificate anatomy - Extensionsmercredi 23 novembre 2011
  69. 69. Public key certificate anatomy - Extensions Not a CA certificatemercredi 23 novembre 2011
  70. 70. Public key certificate anatomy - Extensions Not a CA certificate Revocation Listmercredi 23 novembre 2011
  71. 71. Public key certificate anatomy - Extensions Not a CA certificate Revocation List Certificate usage (TLS)mercredi 23 novembre 2011
  72. 72. Public key certificate anatomy - Extensions Not a CA certificate Revocation List Certificate usage (TLS) Issuer CA certificate locationmercredi 23 novembre 2011
  73. 73. Public key certificate anatomy - Certificate signaturemercredi 23 novembre 2011
  74. 74. Public key certificate anatomy - Certificate signature The certificate SHA1 fingerprint is signed with Issuer private keymercredi 23 novembre 2011
  75. 75. Certificate fingerprint signature • Self signed or signed by CA • Prevents certificate corruption • CA signing proves identity if the CA is trustedmercredi 23 novembre 2011
  76. 76. Certification chain of trust (certification path)mercredi 23 novembre 2011
  77. 77. Certificate managementmercredi 23 novembre 2011
  78. 78. Certificate managementmercredi 23 novembre 2011
  79. 79. Certificate managementmercredi 23 novembre 2011
  80. 80. Certificate managementmercredi 23 novembre 2011
  81. 81. Certificate managementmercredi 23 novembre 2011
  82. 82. Certificate management CR is signed with CA private keymercredi 23 novembre 2011
  83. 83. Certificate management CR is signed with CA private keymercredi 23 novembre 2011
  84. 84. Certificate management CR is signed with CA private keymercredi 23 novembre 2011
  85. 85. Certificate management CR is signed with CA private keymercredi 23 novembre 2011
  86. 86. Certificate management CR is signed with Manage CRL or OCSP CA private keymercredi 23 novembre 2011
  87. 87. Certificate management CR is signed with Manage CRL or OCSP CA private keymercredi 23 novembre 2011
  88. 88. Certificate management CR is signed with Manage CRL or OCSP CA private key Check Bob certificate with CA certificatemercredi 23 novembre 2011
  89. 89. Certificate management CR is signed with Manage CRL or OCSP CA private key Check Bob certificate with CA certificatemercredi 23 novembre 2011
  90. 90. Certificate management CR is signed with Manage CRL or OCSP CA private key Check Bob certificate validity Check Bob certificate with CA certificatemercredi 23 novembre 2011
  91. 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. 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 havemercredi 23 novembre 2011
  93. 93. Certificate revocation • Two protocols : • Certificate Revocation List • Online Certificate Status Protocol • CRL provides a full certificates revocation list • OCSP is request/response protocolmercredi 23 novembre 2011
  94. 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 OTPmercredi 23 novembre 2011
  95. 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

×