Introduction To PKI Technology

5,916 views

Published on

Formation HES Yverdon 2003

Published in: Technology, Education

Introduction To PKI Technology

  1. 1. Introduction to PKI Technology Sylvain Maret Février 2002 Version 2.01
  2. 2. Course Map Day One <ul><li>Introduction </li></ul><ul><li>Key Terms </li></ul><ul><ul><li>Cryptosystems </li></ul></ul><ul><ul><li>Services, Mechanisms, Algorithms </li></ul></ul><ul><li>Cryptography in History </li></ul><ul><li>Cryptanalysis </li></ul>
  3. 3. Course Map Day One <ul><li>Secret-Key Cryptography </li></ul><ul><ul><li>AES </li></ul></ul><ul><li>Public-Key Cryptography </li></ul><ul><ul><li>RSA </li></ul></ul><ul><ul><li>Diffie-Hellman </li></ul></ul><ul><li>Message Digests </li></ul><ul><li>Random Numbers </li></ul><ul><li>Key Length </li></ul>
  4. 4. Course Map Day One <ul><li>Message Authentication Code (MAC, HMAC) </li></ul><ul><li>Digital Signature </li></ul><ul><ul><li>RSA, DSS / DSA, ElGamal </li></ul></ul><ul><li>Hybrid Cryptosystems </li></ul><ul><ul><li>RSA Key Wrapping </li></ul></ul><ul><ul><li>Diffie-Hellman </li></ul></ul><ul><li>PKCS Standard </li></ul><ul><li>Smart Card </li></ul><ul><li>End of day one </li></ul>
  5. 5. Course Map Day Two <ul><li>Questions to day one ? </li></ul><ul><li>Revision quiz ! </li></ul><ul><li>PKI introduction </li></ul><ul><ul><li>Digital certificates </li></ul></ul><ul><ul><li>X.509 certificates (Demo) </li></ul></ul><ul><ul><li>Certificate Revocation (Demo) </li></ul></ul><ul><ul><li>Certification Authorities </li></ul></ul><ul><ul><li>RA, LRA </li></ul></ul><ul><ul><li>Data Repositories (LDAP) </li></ul></ul>
  6. 6. Course Map Day two <ul><li>S/MIME: How it works ? </li></ul><ul><li>SSL: How it works ? </li></ul><ul><li>IPSEC: How it works ? </li></ul><ul><li>Open discussion </li></ul><ul><li>Encryption references site s </li></ul>
  7. 7. Course Objectives <ul><li>Understand cryptographic fundamentals and how cryptographic technology is applied in a Public Key Infrastructure </li></ul><ul><li>Know the elements of Public Key Infrastructure and how they interact with each other </li></ul><ul><li>Understand and be able to describe some of the practical applications of PKI </li></ul><ul><li>Understand why PKI is an attractive technology to enable e-commerce and enhance security </li></ul>
  8. 8. PKI, WHY? <ul><li>The rise of public data networks. </li></ul><ul><li>Internet is a new platform for business relationships: E-business </li></ul><ul><li>Business rules need to be “translated” into this new “language”. </li></ul><ul><li>Hope behind PKI: to preserve classical business rules in this new virtual world. </li></ul>
  9. 9. Drawbacks for E- business <ul><li>Let’s say you have an electronic contract which you need to distribute to another party over the Internet… </li></ul><ul><li>With existing Internet tools like www and e-mail you lose a lot compared to paper </li></ul><ul><ul><li>No assurance that the contract has been signed </li></ul></ul><ul><ul><li>No guarantee that the contract is authentic </li></ul></ul><ul><ul><li>No assurance of the contract’s source </li></ul></ul><ul><li>Basically, it is worth than the paper where everything is printed on! </li></ul>
  10. 10. About needs... <ul><li>You need to know who you are dealing with (Authentication) </li></ul><ul><li>You need to keep private things private (Confidentiality) </li></ul><ul><li>You need to make sure that people do not cheat (Non-Repudiation) </li></ul><ul><li>You need to be sure that information has not been altered (Integrity) </li></ul>
  11. 11. If PKI is the answer then… What is the question? On the Internet no one knows you're a dog!
  12. 12. Key Terms <ul><li>A message will be defined as plaintext or cleartext </li></ul><ul><li>The process of disguising a message to hide its substance is encryption </li></ul><ul><li>The encrypted message is referred to as ciphertext </li></ul><ul><li>Decryption is the process turning ciphertext back into plaintext </li></ul>
  13. 13. Key Terms <ul><li>Cryptography is the science allowing messages to be kept secure </li></ul><ul><li>Cryptoanalysis is the art and science of breaking ciphertext </li></ul><ul><li>Cryptology is the mathematics field </li></ul><ul><li>Cryptologist are theoretical mathematicians </li></ul>
  14. 14. Cryptosystems <ul><li>A cryptosystem is a collection of cryptographic algorithms, cryptographic keys, and all possible plaintexts and their corresponding ciphertexts. </li></ul>
  15. 15. Security Services <ul><li>Authentication : Provides the assurance of someone’s identity </li></ul><ul><li>Confidentiality : Protects against disclosure to unauthorized identities </li></ul><ul><li>Non-Repudiation : Protects against communications originator to later deny it </li></ul><ul><li>Integrity : Protects from unauthorized data alteration </li></ul>
  16. 16. Security Mechanisms <ul><li>Three basic building blocks are used: </li></ul><ul><ul><li>Encryption is used to provide confidentiality and integrity protection </li></ul></ul><ul><ul><li>Digital Signatures are used to provide authentication, integrity protection and non-repudiation </li></ul></ul><ul><ul><li>Checksums / hash algorithms are used to provide integrity protection and can provide authentication </li></ul></ul>
  17. 17. Cryptography Algorithms <ul><li>All Cryptosystems are based on only three algorithms: </li></ul><ul><ul><li>1 - Secret-Key algorithms </li></ul></ul><ul><ul><li>2 - Public-Key algorithms </li></ul></ul><ul><ul><li>3 - Message-Digest algorithms </li></ul></ul>
  18. 18. Services, Mechanisms, Algorithms A typical security protocol provides one or more services Services Mechanisms Algorithms Services are built from Mechanisms Mechanisms are implemented using Algorithms SSL, IPSEC, TLS, SSH, etc... Signatures Encryption Hashing DSA RSA RSA DES SHA MD5
  19. 19. Security Protocol Layers The further down you go, the more transparent it is The further up you go, the easier it is to deploy Application Presentation Session Transport DataLink Physical Application Presentation Session Transport Network DataLink Physical Network S/MIME, PGP SSL, TLS, SSH IPSEC Hardware link encryption
  20. 20. Cryptography in History <ul><li>2000 B.C. Hieroglyphics </li></ul><ul><ul><li>Cryptography as an Art </li></ul></ul><ul><li>Ancient Chinese </li></ul><ul><ul><li>First to transform messages in Ideographs for privacy </li></ul></ul><ul><li>India </li></ul><ul><ul><li>First “Networks spies” using phonetics encryption (Javanese or reverse speaking) </li></ul></ul><ul><li>Mesopotamia </li></ul><ul><ul><li>Numbers associate to letters (cuneiform table) </li></ul></ul>
  21. 21. Cryptography in History <ul><li>ATBASH cipher: In the Bible </li></ul><ul><ul><li>ABCDEFGH… (clear) </li></ul></ul><ul><ul><li>ZYXWVU…(encrypted) </li></ul></ul><ul><li>Skytale Cipher (Greek) </li></ul><ul><ul><li>key: stick </li></ul></ul><ul><ul><li>papyrus enrolled </li></ul></ul><ul><li>Polybius square (Greek) </li></ul>
  22. 22. Cryptography in History <ul><li>Runiques Stones by Vikings (Arts) </li></ul>
  23. 23. Cryptography in History <ul><li>World War II: </li></ul><ul><ul><li>Electromechanical cryptography </li></ul></ul><ul><ul><li>Rotor based machine transforming plaintext into ciphertext, using electrical signals as encryption key </li></ul></ul><ul><ul><ul><li>Example: Enigma machine used by Germans </li></ul></ul></ul><ul><ul><ul><li>Ciphers were not new, but their processing was… </li></ul></ul></ul><ul><li>1970-today: </li></ul><ul><ul><li>New ciphers: based on numbers properties issued from Mathematical theories </li></ul></ul><ul><ul><ul><li>RSA: Prime numbers factorization </li></ul></ul></ul><ul><ul><ul><li>Diffie-Hellman: discrete logarithm </li></ul></ul></ul><ul><ul><ul><li>ECDSA: Elliptic curve cryptography </li></ul></ul></ul>
  24. 24. Cryptanalysis <ul><li>Two categories of security levels </li></ul><ul><ul><li>Computationally secure: </li></ul></ul><ul><ul><ul><li>Question of time and money (Brute force attack) </li></ul></ul></ul><ul><ul><ul><li>(Most of the cryptosystems: DES, 3DES, IDEA, RSA, DH etc.) </li></ul></ul></ul><ul><ul><li>Unconditionally secure: </li></ul></ul><ul><ul><ul><li>Can “never” be broken independently of the resources </li></ul></ul></ul><ul><ul><ul><li>One-time pads </li></ul></ul></ul>
  25. 25. Several Cryptanalytic Attacks <ul><li>Ciphertext only </li></ul><ul><ul><li>Brute force attack and dictionary attacks on keys </li></ul></ul><ul><li>Chosen ciphertext </li></ul><ul><ul><li>Start from a known ciphertext and try to appear as someone else to get information from others behavior </li></ul></ul><ul><li>Known Plain ciphertext </li></ul><ul><ul><li>Derive the key from knowledge of both plain and ciphertext </li></ul></ul>
  26. 26. Secret-Key Cryptography
  27. 27. Secret-Key Cryptography <ul><li>Use a secret key to encrypt a message into a ciphertext </li></ul><ul><li>Use the same key to decrypt the ciphertext into the original message </li></ul><ul><li>Secret-key cryptography is referred also as symmetric cryptography or conventional cryptography </li></ul><ul><li>The secret key is also known as session key or bulk encryption key </li></ul>
  28. 28. Secret-Key Cryptography <ul><li>Let us imagine Alice and Bob who use Secret-Key to protect their messages </li></ul>Plaintext Ciphertext Secret-Key
  29. 29. Secret-Key Cryptography <ul><li>How to share the Secret-Key ? </li></ul><ul><ul><li>Alice and Bob can use the phone, fax, a meeting point, etc. </li></ul></ul><ul><li>But!?: </li></ul><ul><ul><li>Could someone steal the key? </li></ul></ul><ul><ul><li>How to proceed without partner knowledge? </li></ul></ul>
  30. 30. Secret-Key Cryptography <ul><li>The Advantages </li></ul><ul><ul><li>Implementation is efficient to encrypt large volume of data (100 to 1’000 faster than Public-Key Cryptography) </li></ul></ul><ul><ul><li>Simple to implement in either software or hardware </li></ul></ul><ul><ul><li>Most of the algorithms are well know and secure </li></ul></ul><ul><ul><li>Seem to be safe to brute force attack </li></ul></ul><ul><ul><li>Widely used </li></ul></ul>
  31. 31. Secret-Key Cryptography <ul><li>The Disadvantages </li></ul><ul><ul><li>Hard to share Secret-Keys </li></ul></ul><ul><ul><li>Large number of keys </li></ul></ul><ul><ul><li>No non-repudiation (Signature) </li></ul></ul><ul><ul><li>Subject to interception (Secret-Key) </li></ul></ul>
  32. 32. Secret-Key Cryptography <ul><li>Number of needed keys </li></ul><ul><ul><li>Suppose Alice, Bob and Chris want to use Secret-Key Cryptography! </li></ul></ul><ul><ul><ul><li>They need only 3 keys </li></ul></ul></ul>
  33. 33. Secret-Key Cryptography <ul><li>Increase of keys number </li></ul><ul><ul><li>Suppose they want to add Dawn and Eric </li></ul></ul><ul><ul><ul><li>Now they need ten keys </li></ul></ul></ul>
  34. 34. Secret-Key Cryptography <ul><li>If n persons want to communicates we have this formula: </li></ul><ul><ul><li>Key’s number = ((n)*(n-1)) / 2 </li></ul></ul><ul><li>As example: A company of 60’000 people = 1’799’970’000 keys! </li></ul>
  35. 35. Secret-Key Cryptography <ul><li>Block cipher: Encrypts data in predefined block size </li></ul><ul><ul><li>Most well-known ciphers are block ciphers </li></ul></ul><ul><li>Stream cipher: Encrypts data stream, one-bit at the time </li></ul><ul><ul><li>Only few algorithms use it </li></ul></ul>
  36. 36. Secret-Key Cryptography <ul><li>Common Secret-Key Ciphers </li></ul><ul><ul><li>DES </li></ul></ul><ul><ul><li>Triple DES (3DES) </li></ul></ul><ul><ul><li>RC2 </li></ul></ul><ul><ul><li>IDEA </li></ul></ul><ul><ul><li>Blowfish </li></ul></ul><ul><ul><li>CAST-128 </li></ul></ul><ul><ul><li>Skipjack </li></ul></ul><ul><ul><li>RC4 (Stream cipher) </li></ul></ul><ul><ul><li>etc. </li></ul></ul>
  37. 37. Secret-Key Cryptography <ul><li>DES </li></ul><ul><ul><li>Data Encryption Standard (1973) by IBM </li></ul></ul><ul><ul><li>World Standard for 20 years </li></ul></ul><ul><ul><li>DES was broken in 22 hours (DES challenge III, January 18th, 1999) </li></ul></ul><ul><ul><li>Key size = 56 bits </li></ul></ul><ul><ul><li>Block cipher </li></ul></ul><ul><li>Recommendation: should be replaced by 3DES for high confidentiality requirements ! </li></ul>
  38. 38. Secret-Key Cryptography <ul><li>Triple DES (3DES) </li></ul><ul><ul><li>Block cipher </li></ul></ul><ul><ul><li>Encrypt + decrypt + encrypt with 2 (112 bits) or 3 (168 bits) DES keys </li></ul></ul><ul><ul><li>DES’s replacement for Banking (1998) </li></ul></ul><ul><li>Recommendation: Use it for high confidentiality! </li></ul>
  39. 39. Secret-Key Cryptography <ul><li>RC2 </li></ul><ul><ul><li>Designed by Ron Rivest from RSA </li></ul></ul><ul><ul><li>Block cipher </li></ul></ul><ul><ul><li>Key size = up to 2048 </li></ul></ul><ul><ul><li>Encryption speed: independent from the key size </li></ul></ul><ul><ul><li>Trade secret from RSA, posted on the net in 1996 </li></ul></ul><ul><ul><li>Designed as a DES’ replacement </li></ul></ul><ul><ul><li>Faster than DES </li></ul></ul><ul><li>Recommendation: like DES but faster! </li></ul>
  40. 40. Secret-Key Cryptography <ul><li>CAST-128 </li></ul><ul><ul><li>Designed by C.Adams and S. Tavares (1993) </li></ul></ul><ul><ul><li>Block cipher </li></ul></ul><ul><ul><li>Key size = 128 bits </li></ul></ul><ul><ul><li>Used in PGP 5.x </li></ul></ul><ul><li>Recommendation: unknown </li></ul>
  41. 41. Secret-Key Cryptography <ul><li>IDEA </li></ul><ul><ul><li>International Data Encryption Algorithm </li></ul></ul><ul><ul><li>Designed by X.Lai and J. Massey (ETH Zurich) in 1990 </li></ul></ul><ul><ul><li>Block cipher </li></ul></ul><ul><ul><li>Key size = 128 bits </li></ul></ul><ul><ul><li>More efficient than DES for software implementation </li></ul></ul><ul><ul><li>Used in PGP </li></ul></ul><ul><li>Recommendation: Better than DES </li></ul>
  42. 42. Secret-Key Cryptography <ul><li>Blowfish </li></ul><ul><ul><li>Designed by B. Schneier in 1993 </li></ul></ul><ul><ul><li>Optimized for high-speed execution on 32-bit processors </li></ul></ul><ul><ul><li>Block cipher </li></ul></ul><ul><ul><li>Key size = up to 448 bits key </li></ul></ul><ul><li>Recommendation: Use for fast performances and with a maximum key size </li></ul>
  43. 43. Secret-Key Cryptography <ul><li>Skipjack </li></ul><ul><ul><li>Designed by NSA (National Security Agency) </li></ul></ul><ul><ul><li>Block cipher </li></ul></ul><ul><ul><li>Key size = 80 bits </li></ul></ul><ul><li>Recommendation: Inadequate for long term security (key size too short) </li></ul>
  44. 44. Secret-Key Cryptography <ul><li>GOST </li></ul><ul><ul><li>Acronym for “GOsudarstvennyi STandard” </li></ul></ul><ul><ul><li>Russian answer to DES </li></ul></ul><ul><ul><li>Key size = 256 bits </li></ul></ul><ul><li>Recommendation: Incompletely specified to give an answer... </li></ul>
  45. 45. Secret-Key Cryptography <ul><li>RC4 </li></ul><ul><ul><li>Designed by Ron Rivest from RSA </li></ul></ul><ul><ul><li>Stream cipher </li></ul></ul><ul><ul><li>Key size = up to 2048 bits </li></ul></ul><ul><ul><li>Optimized for fast software implementation </li></ul></ul><ul><ul><li>Trade secret from RSA, posted on the net in 1994 </li></ul></ul><ul><ul><li>Very fast </li></ul></ul><ul><ul><li>Used in SSL, Lotus Note, Windows password encryption, Oracle etc. </li></ul></ul><ul><li>Recommendation: Highly recommended for long keys (>40 bits) </li></ul>
  46. 46. Secret-Key Cryptography <ul><li>Many, many others </li></ul><ul><ul><li>There is no good reason not to use one of above proven algorithms! </li></ul></ul>
  47. 47. Secret-Key Relative Performance <ul><li>RC4 </li></ul><ul><li>Blowfish, CAST-128 </li></ul><ul><li>Skipjack </li></ul><ul><li>DES, IDEA, RC2 </li></ul><ul><li>3DES, GOST </li></ul>FAST SLOW
  48. 48. AES <ul><li>National Institute of Standard and Technology expressed a formal call for algorithm on 09.1997 </li></ul><ul><li>The aim is to define the “next century’s” symmetric encryption standard or Advanced Encryption Standard </li></ul><ul><li>AES1 conf. (08.98): 15 potential candidates </li></ul><ul><li>AES2 conf. (03.99): 5 retained candidates </li></ul><ul><li>Final choice expected for summer 2001 </li></ul>
  49. 49. AES candidates <ul><li>MARS (IBM) </li></ul><ul><li>RC6 (RSA Laboratories) </li></ul><ul><li>Rijndael (J. Daemen, V. Rijmen) </li></ul><ul><li>Serpent (R. Anderson, E. Biham, L. Knudsen) </li></ul><ul><li>Twofish (B. Schneier - Counterpane) </li></ul>
  50. 50. AES requirements <ul><li>Block cipher of minimum 128 bits </li></ul><ul><li>Must implement symmetric keys of 128, 192, 256 bits </li></ul><ul><li>Must be efficient on software and hardware basis (high speed encryption) </li></ul>
  51. 51. Public Key Cryptography
  52. 52. Public-Key Cryptography <ul><li>Use two distinct keys, one public and one private </li></ul><ul><li>The private is kept secret </li></ul><ul><li>The public can be freely shared </li></ul><ul><li>Referred as asymmetric cryptography </li></ul><ul><li>A public-key and its corresponding key are mathematically related </li></ul><ul><li>A public-key and its associated private-key are called a key-pair </li></ul>
  53. 53. Public-Key Cryptography <ul><li>A message encrypted with a public-key can be only decrypted by the private-key </li></ul><ul><li>A message encrypted with a private-key can be only decrypted by the public-key (Signature) </li></ul>
  54. 54. Public-Key Cryptography <ul><li>Suppose Alice wants to send a message to Bob using Public-Key Cryptography </li></ul>Plaintext Plaintext Ciphertext Bob’s public key Bob’s private key
  55. 55. Public-Key Cryptography <ul><li>How to obtain the public-key ? </li></ul><ul><ul><li>Any publishing way can be used to get the public-key (Directory servers, Phone, Web server, Newspapers etc.) </li></ul></ul><ul><ul><li>No more confidentiality issues in key distribution </li></ul></ul>
  56. 56. Public-Key Cryptography <ul><li>Advantages </li></ul><ul><ul><li>No secret sharing </li></ul></ul><ul><ul><li>Fewer keys </li></ul></ul><ul><ul><li>No prior relationship needed </li></ul></ul><ul><ul><li>Easier to administrate </li></ul></ul><ul><ul><li>Offers useful mechanisms like digital signature (offering non repudiation) </li></ul></ul>
  57. 57. Public-Key Cryptography <ul><li>Disadvantages </li></ul><ul><ul><li>Not efficient (slow) to encrypt large volume of data </li></ul></ul><ul><ul><li>Keys need to be much longer than with secret-key encryption </li></ul></ul><ul><ul><li>Impossible to encrypt a plaintext with size > key </li></ul></ul>
  58. 58. Types of public-key algorithm <ul><li>A public-key algorithm is reversible if encryption and decryption can be processed with either a private or a public-key </li></ul><ul><li>A public-key algorithm is irreversible if a private-key is mandatory for encryption </li></ul><ul><li>Key exchange algorithm: neither used for encryption nor decryption (Diffie-Hellman) </li></ul>
  59. 59. RS A <ul><li>Inventors: Rivest, Shamir, Adleman in 1977 </li></ul><ul><li>Most popular </li></ul><ul><li>Provide confidentiality, digital signature and key exchange </li></ul><ul><li>Key length up to 4096 </li></ul><ul><li>Plaintext length < Key length </li></ul><ul><li>Ciphertext size = Key size </li></ul>
  60. 60. RSA <ul><li>RSA is protected by a patent. Patent expires on 20th September 2000 </li></ul><ul><li>Relies on irreversible mathematics functions (Prime numbers) </li></ul>
  61. 61. Diffie-Hellman <ul><li>Published in 1976 by W. Diffie and M. Hellman </li></ul><ul><li>Oldest known public-key cryptosystem </li></ul><ul><li>Key agreement algorithm </li></ul><ul><ul><li>Enables secret-key exchange without prior knowledge </li></ul></ul><ul><ul><li>Agrees on shared secret used in conjunction with a secret-key Cryptosystem (DES, 3DES, IDEA, etc.) </li></ul></ul>
  62. 62. Diffie-Hellman: How it works ? Alice’s private key Bob’s private key Alice’s public key Bob’s public key = Share Secret Key Share Secret Key
  63. 63. DSA <ul><li>Compliant to D igital S ignature S tandard (DSS) </li></ul><ul><li>Published in 1994 </li></ul><ul><li>Irreversible algorithm (encryption with private key only) </li></ul><ul><li>Used in Digital signature only </li></ul><ul><li>Performance tuned for smart cards </li></ul>
  64. 64. Comparative Public-Key table
  65. 65. Message-Digest Algorithms
  66. 66. Message-Digest Algorithms <ul><li>Take a variable-length message and produce a fixed-length digest as output </li></ul><ul><li>The fixed-length output is called the message digest, a digest or a hash </li></ul><ul><li>A message-digest algorithm is also called a one-way hash algorithm or a hash algorithm </li></ul>
  67. 67. Message-Digest Algorithms Input Message Fixed-length Digest Hash Function
  68. 68. Message-Digest Algorithms <ul><li>Message-Digest Algorithms properties required to be cryptographically secure </li></ul><ul><ul><li>It must not be feasible to determine the input message based on its digest </li></ul></ul><ul><ul><li>It must not be possible to find an arbitrary message that has a particular, desired digest </li></ul></ul><ul><ul><li>It should be impossible to find two messages that have the same digest (collision) </li></ul></ul><ul><ul><li>It should be very sensitive to input message changes </li></ul></ul>
  69. 69. Message-Digest Algorithms <ul><li>Some Common Message-Digest Algorithms </li></ul><ul><ul><li>MD2: 128-bit-output, deprecated, by Ronald Rivest </li></ul></ul><ul><ul><li>MD4: 128-bit-output, broken, by Ronald Rivest </li></ul></ul><ul><ul><li>MD5: 128-bit-output, weaknesses, by Ronald Rivest </li></ul></ul><ul><ul><li>SHA-1: 160-bit-output, NSA-Designed </li></ul></ul><ul><ul><li>RIPEMD-160: 160-bit-output </li></ul></ul><ul><ul><li>Haval: 128 to 256 bit-output (3 to 5 Passes) </li></ul></ul><ul><ul><li>CRC-32: 32-bit-output </li></ul></ul><ul><li>Recommendation: Use SHA-1 </li></ul>
  70. 70. Message-Digest Algorithms <ul><li>Message-Digest at work </li></ul><ul><ul><li>Creation of digital signatures </li></ul></ul><ul><ul><li>Creation of MAC, HMAC </li></ul></ul><ul><ul><li>Creation of secret-key with a passphrase </li></ul></ul><ul><ul><li>File checksum (FTP server, Patches, etc.) </li></ul></ul><ul><ul><li>FIA (File Integrity Assessment like Tripwire) </li></ul></ul>
  71. 71. Random Numbers <ul><li>Random numbers are usually required to generate cryptographic keys or challenge. </li></ul><ul><li>Two main categories </li></ul><ul><ul><li>(PRNG) Pseudo Random Number Generator uses a deterministic algorithm to generate a pseudo random number based on a seed (mouse, keyboard, etc..) </li></ul></ul><ul><ul><li>A random number generator generates truly unpredictable numbers. Based generally on special hardware (white noise, radioactive-decay, etc…) </li></ul></ul>
  72. 72. Random Numbers
  73. 73. Random Numbers <ul><li>A very secure cryptosystem can be broken if it relies on random numbers that can be guessed </li></ul><ul><ul><li>Netscape browser using SSL broken! </li></ul></ul><ul><li>Some PRNG </li></ul><ul><ul><li>Yarrow from B. Schneier </li></ul></ul><ul><ul><li>CryptPack </li></ul></ul><ul><ul><li>etc. </li></ul></ul>
  74. 74. Keys Length <ul><li>To break a secret-key cryptosystem with “no weakness”, an attacker must try each possible key. This is called a brute force attack </li></ul><ul><li>To break a public-key cryptosystem an attacker should use “smarter” brute force attack based on mathematics </li></ul><ul><li>Key space dimension = 2n (n:keylength) </li></ul>
  75. 75. Keys Length
  76. 76. What is the right key size ? <ul><li>The goals of cryptography are to make the value of encrypted information less than the money spent to decrypt it ! </li></ul><ul><li>the value of information usually decreases over tim e </li></ul>
  77. 77. RSA’s Challenge on DES (III) <ul><li>Method: splitting the Key space for distributed Brute Force Attack (space dimension = 2n , where n is the key-length) </li></ul><ul><li>Starting date: 18.01.99. Ending: 22h15 min. later… </li></ul><ul><li>Brute Force Attack frequency: 245 Billions keys/sec. </li></ul><ul><li>Platforms: Cray/Sun/SGI/Pentium etc.. </li></ul>
  78. 78. RSA’s Challenge on RSA-155 <ul><li>Key-length: 512 bits = 155 digits </li></ul><ul><li>Method: Prime number factorization </li></ul><ul><li>Starting Date: August 99. Ending: 5 months later </li></ul><ul><li>Time: 35.7 CPU years </li></ul><ul><li>Platforms: SGI/Sun/Pentium etc. </li></ul><ul><ul><li>292 computers </li></ul></ul>
  79. 79. Keys’ time of life <ul><li>Most of the time, session keys are changing (IPSec, etc.) </li></ul><ul><ul><li>to enforce security </li></ul></ul><ul><li>Can be triggered by time or by encrypted data quantity </li></ul>
  80. 80. Public-Key vs Secret-key
  81. 81. Message Authentication Code
  82. 82. Message Authentication Code <ul><li>MAC is a fixed-length data item that is send together with a message to prove integrity and origin </li></ul><ul><li>Provide authentication and integrity without confidentiality </li></ul><ul><li>Also referred as message integrity code (MIC) </li></ul><ul><li>Most common form is HMAC ( Hashed Mac) </li></ul><ul><li>Example: HMAC-MD5 </li></ul>
  83. 83. Message Authentication Code + Input Message HMAC Secret-Key Hash Function
  84. 84. Digital Signature
  85. 85. Digital Signature <ul><li>Digital signature is a data item that guarantees the origin and integrity of a message </li></ul><ul><li>The signer of the message uses a signing key </li></ul><ul><li>The recipient uses a verification key to verify the origin and integrity </li></ul><ul><li>Signing key = private-key </li></ul><ul><li>Verification key = public-key </li></ul>
  86. 86. Digital Signature <ul><li>By using his own private key, the signer can not repudiate the fact he has signed the message </li></ul><ul><li>This mechanism provide non-repudiation </li></ul><ul><li>Think about the difference with MAC … </li></ul>
  87. 87. Digital Signature: Basics Plaintext Simple signature using PRIVATE-key Plaintext Ciphertext (Signature) Alice’s private key Alice’s public key
  88. 88. Digital Signature: How it works? Alice’s private key Signature Alice’s Public key Signature Plaintext MD1 = MD2 ??? Plaintext Digest
  89. 89. Digital Signature <ul><li>Why signing a message involves Hashing ? </li></ul><ul><ul><li>Signature (data item) is too big </li></ul></ul><ul><ul><li>Performance (public-key is very slow) </li></ul></ul><ul><ul><li>Possible attack (known plaintext attack) </li></ul></ul>
  90. 90. Common Signature Algorithms <ul><li>RSA </li></ul><ul><ul><li>Well known </li></ul></ul><ul><ul><li>Export limitation </li></ul></ul><ul><li>DSA </li></ul><ul><ul><li>Similar to RSA (algebraic properties of numbers) </li></ul></ul><ul><ul><li>Non-reversible algorithm, suitable for digital signature only </li></ul></ul><ul><li>ElGamal </li></ul><ul><ul><li>Another cipher for digital signature only </li></ul></ul>
  91. 91. Hybrid Cryptosystems
  92. 92. Hybrid Cryptosystems <ul><li>A Hybrid Cryptosystem combines the best features of both Secret-Key and Public-Key cryptography </li></ul><ul><li>Used to exchange session key to initiate a symmetric encryption </li></ul><ul><li>Example: PGP, SSL, IPSEC using Diffie-Hellman or RSA </li></ul>
  93. 93. Example: Diffie-Hellman and Secret-Key cryptosystem = Share Secret Key Share Secret Key Plaintext Plaintext Ciphertext Asymmetric Symmetric
  94. 94. RSA Key wrapping encryption <ul><li>Suppose Alice wants to send an encrypted text to Bob across the Internet , using RSA key wrapping </li></ul>
  95. 95. RSA Key wrapping encryption <ul><li>How it works ? </li></ul><ul><ul><li>Alice creates a session key, which is a one-time-only secret-key </li></ul></ul><ul><ul><li>Alice encrypts the data with the session key </li></ul></ul><ul><ul><li>Alice encrypts the session key with Bob’s public-key </li></ul></ul><ul><ul><li>Alice sends the ciphertext + the encrypted session key to Bob </li></ul></ul>
  96. 96. RSA Key wrapping encryption
  97. 97. RSA Key wrapping decryption <ul><li>How it works ? </li></ul><ul><ul><li>Bob receives the message from Alice </li></ul></ul><ul><ul><li>Bob uses his private-key to recover the temporary session key </li></ul></ul><ul><ul><li>Bob uses the session key to decrypt the ciphertext </li></ul></ul>
  98. 98. RSA Key wrapping decryption
  99. 99. RSA Key wrapping question ? How sure can Alice be about Bob’s presumed public-key ?
  100. 100. Man in the Middle Attack!
  101. 101. SSH: How it works ?
  102. 102. SSH <ul><li>SSH = Secure Sh ell </li></ul><ul><li>Originally developed in 1995 as a secure replacement for rsh, rlogin,rcp, ftp, telnet </li></ul><ul><li>Originally implemented in Finland </li></ul><ul><li>Available worldwide </li></ul><ul><li>About 3’000’000 users around the world </li></ul>
  103. 103. SSH <ul><li>Also allows port forwarding (tunneling over SSH) </li></ul><ul><li>X11 connection forwarding </li></ul><ul><li>SSH v2 submitted to IETF </li></ul><ul><li>Can be run and used in a short space of time </li></ul><ul><li>Many SSH clients available </li></ul><ul><ul><li>Secure CRT </li></ul></ul><ul><ul><li>F-Secure </li></ul></ul><ul><ul><li>Java Client </li></ul></ul><ul><ul><li>etc. </li></ul></ul>
  104. 104. SSH: Why ? Attacker with sniffer Network Original TCP Packet Login: rome Password: abc123 Unix Host Telnet to Unix Host
  105. 105. SSH-1 Protocol (Hybrid Crypto) TCP Auth request SSH Client Server DATA Client performs TCP handshake with the server at port 22 for SSH standard port Start authentication process. Client send authentication request Server decrypt the session key with the two private keys. Begin bulk encrypted data exchange. Client encrypts Server decrypts request, encrypts and sends response S S 22 Session The server responds with two keys. Host key 1024 bit RSA and a Server key 768 bit RSA (Generated hourly) Client verify host key and generate a secret key that is used for bulk encryption then encrypt this secret key twice with Host and Server public keys and send it to the server SSH Symmetric Encrypted data SSH Handshake Public Key
  106. 106. SSH Ciphers <ul><li>SSH v1 </li></ul><ul><ul><li>RSA </li></ul></ul><ul><ul><li>DES, 3DES, Blowfish, IDEA </li></ul></ul><ul><li>SSH v2 </li></ul><ul><ul><li>Diffie-Hellman for key exchange algorithm </li></ul></ul><ul><ul><li>DSA, RSA </li></ul></ul><ul><ul><li>3DES, Blowfish, IDEA, Twofish, Arcfour, Cast-128 </li></ul></ul>
  107. 107. SSH Authentication <ul><li>Multiple Authentication mechanisms </li></ul><ul><ul><li>Static password (protected by SSH encryption) </li></ul></ul><ul><ul><li>RSA or DSA authentication (client decrypts challenge from server) </li></ul></ul><ul><ul><li>Plug-in authentication (Securid, Radius, ldap, PAM *) </li></ul></ul><ul><ul><li>“ .rhosts or /etc/hosts.equiv” (Based on IP address) </li></ul></ul>
  108. 108. SSH Authentication (RSA/DSA) <ul><li>Client decrypts “challenge” from server </li></ul><ul><li>Provides “strong” authentication (client uses his private-key plus a PIN code) </li></ul>Server sends encrypted challenge with client’s public key Client decrypts challenge and sends it to the server The challenge is chosen randomly
  109. 109. SSH Tunneling mode SSH Server HTTP 127.0.0.1 1999 Encrypted SSH tunnel Clear text Web server DMZ Corporate Net SSH Client
  110. 110. PKCS
  111. 111. PKCS <ul><li>Public Key Cryptographic Standard (PKCS) </li></ul><ul><ul><li>Standardization of public-key algorithmic, in order to maintain interoperability </li></ul></ul><ul><ul><li>Developed by RSA Laboratories, a consortium of information technology vendors and academic institutions. </li></ul></ul><ul><ul><ul><li>Apple </li></ul></ul></ul><ul><ul><ul><li>Microsoft </li></ul></ul></ul><ul><ul><ul><li>Compaq </li></ul></ul></ul><ul><ul><ul><li>Lotus </li></ul></ul></ul><ul><ul><ul><li>Sun </li></ul></ul></ul><ul><ul><ul><li>MIT etc. </li></ul></ul></ul>
  112. 112. PKCS list <ul><li>#1: Encrypting and signing using RSA public key cryptosystem </li></ul><ul><li>#3: Key agreement with Diffie-Hellman key exchange </li></ul><ul><li>#5: Encrypting with a secret key derived from a password </li></ul><ul><li>#7: Syntax for message with digital signature </li></ul><ul><li>#8: Format for private key information </li></ul><ul><li>#9: Attribute type for use in other PKCS standard </li></ul><ul><li>#10: Syntax for certification request </li></ul><ul><li>#11: Define a cryptoki programming interface (API for smart cards) </li></ul><ul><li>#12: Portable format for storing and transporting private keys </li></ul><ul><li>#13: Encrypting and signing data using elliptic curves cryptography </li></ul><ul><li>#14: Standard for pseudo number generation </li></ul><ul><li>#15: Standard to store credentials on tokens </li></ul>
  113. 113. Smart Card
  114. 114. Smart Card <ul><li>Smart Cards consist of a chip (processor or/and memory), a contact plate and a piece of plastic (ISO 7810 - 54x85x0.8 mm) </li></ul><ul><li>Smart Cards are used for multi-applications </li></ul><ul><ul><li>GSM, Banking, Medical, E-Commerce, Pay TV, etc . </li></ul></ul>
  115. 115. Smart Card and PKI <ul><li>Storing the private-key and/or X.509 certificate on the Smart Card </li></ul><ul><li>Provide Strong Authentication </li></ul><ul><ul><li>Something you have, Something you know </li></ul></ul><ul><ul><li>Access protected by a PIN (like credit card) </li></ul></ul><ul><li>Types of Smart Card </li></ul><ul><ul><li>Memory Cards </li></ul></ul><ul><ul><li>PKI smart cards using Crypto-processor (RSA, etc.) </li></ul></ul><ul><li>Some Smart Card are “brute force” protected </li></ul>
  116. 116. Smart Card Standard (interface) <ul><li>PKCS #11 also call Cryptoki </li></ul><ul><ul><li>Interface for the communication to Smart Card </li></ul></ul><ul><ul><li>Netscape, RSA </li></ul></ul><ul><li>PC/SC and their Crypto API </li></ul><ul><ul><li>http://www.pcscworkgroup.com/ </li></ul></ul><ul><ul><li>Bull, Gemplus, HP, Intel, Microsoft, Schlumberger Siemens, SUN, Toshiba </li></ul></ul>
  117. 117. Smart Card Reader <ul><li>Keyboard </li></ul><ul><li>USB </li></ul><ul><li>Serial </li></ul><ul><li>PCMCIA </li></ul><ul><li>Diskette reader </li></ul><ul><li>SCSI </li></ul>
  118. 118. Today’s Smart Card Drawbacks <ul><li>Hardware... </li></ul><ul><li>Multi-Services rarely used </li></ul><ul><ul><li>Users leave Smart Card on the reader </li></ul></ul>
  119. 119. Quiz !
  120. 120. Quiz! <ul><li>Describe Secret-Key ? </li></ul><ul><ul><li>Advantages / Disadvantages </li></ul></ul><ul><li>Describe Public-Key ? </li></ul><ul><ul><li>Advantages / Disadvantages </li></ul></ul><ul><li>Describe Messages Digest ? </li></ul><ul><li>Describe Digital Signature and verification ? </li></ul><ul><li>Differences between MAC and signature? </li></ul><ul><li>Describe two Hybrid Cryptosystems ? </li></ul><ul><li>Describe a challenge response based authentication? </li></ul>
  121. 121. PKI Introduction
  122. 122. PKI introduction <ul><li>The aim of PKI is to integrate all the previous mechanisms and algorithms into a coherent and efficient structure. </li></ul><ul><li>It will answer the following fundamental security needs: </li></ul><ul><ul><li>Authentication </li></ul></ul><ul><ul><li>Confidentiality </li></ul></ul><ul><ul><li>Non-Repudiation </li></ul></ul><ul><ul><li>Integrity </li></ul></ul><ul><li>The basis of PKI relies on the concept of certificates </li></ul>
  123. 123. PKI basis function <ul><li>PKI will include at least: </li></ul><ul><ul><li>One Certificate Authority who delivers certificates </li></ul></ul><ul><ul><li>One Directory who stores active Certificates and/or Revoked Certificates </li></ul></ul><ul><ul><li>One Registration Authority who allows certificates’ enrollment </li></ul></ul><ul><ul><li>One centralized Management </li></ul></ul>
  124. 124. Remember Alice, Bob and Charlie... Bob has no proof of the “link” between Alice’s public-keys and her identities So What ?
  125. 125. Third Trusted Party No more Charly Implicit Trust Trusted Authority Direct Trust Direct Trust
  126. 126. Digital Certificates <ul><li>A public-key certificate is a bond between n an entity’s public-key and one entity </li></ul><ul><li>The entity can be: </li></ul><ul><ul><li>A person </li></ul></ul><ul><ul><li>A role (Manager Director) </li></ul></ul><ul><ul><li>An organization </li></ul></ul><ul><ul><li>A piece of hardware (Router, Server, IPSEC, SSL, etc.) </li></ul></ul><ul><ul><li>A software process (JAVA Applet) </li></ul></ul><ul><ul><li>A file (Image, Databases, etc.) </li></ul></ul><ul><ul><li>etc. </li></ul></ul>
  127. 127. Digital Certificates <ul><li>A Public-key certificate provides assurance that the public-key belongs to the identified entity </li></ul><ul><li>A Public-key certificate is also called a digital certificate, digital ID or certificate </li></ul><ul><li>The entity identified is referred to as the certificate subject </li></ul><ul><li>If the certificate subject is a person, it is referred to as a subscriber </li></ul>
  128. 128. Digital Certificates <ul><li>A certificate is like a passport ... </li></ul>
  129. 129. How to obtain a certificate <ul><li>As with passports, you give proof of your identity to an official (or trusted) authority. </li></ul><ul><li>The authority checks this proof. </li></ul><ul><li>The authority delivers a signed passport . </li></ul><ul><li>This procedure is defined as an “enrollment” </li></ul><ul><li>Instead of “enrolling” for a passport we’ll enroll for digital certificate. </li></ul>
  130. 130. Digital Certificates <ul><li>Graphical representation of a certificate </li></ul>
  131. 131. Demo: certificate view
  132. 132. X.509 Certificate Standard <ul><li>X.509 is a standard for digital certificate by International Telecommunications Union (ITU) </li></ul><ul><li>First published in 1988 (V1.0) </li></ul><ul><li>Version 2.0 (1993) adds two new fields </li></ul><ul><li>Current version is v3.0 (1996) and allows additional extension fields </li></ul>
  133. 133. X.509 Basic Certificate Fields <ul><li>Version: X509 version 1,2 and 3 </li></ul><ul><li>Certificate serial number: Integer assigned by the CA (unique) </li></ul><ul><li>Signature algorithm identifier: RSA/MD5 etc. </li></ul><ul><li>Issuer name: name of CA having signed and issued the certificate </li></ul><ul><li>Validity period: time interval </li></ul><ul><li>Subject name: the entity name (this name must be unique = distinguished name (DN) ) </li></ul>
  134. 134. X.509 Basic Certificate Fields <ul><li>Subject public-key information: contains the public-key plus the parameters </li></ul><ul><li>Issuer unique identifier: optional field </li></ul><ul><li>Subject unique identifier: optional field </li></ul><ul><li>Extensions: may provide additional data for specific applications. </li></ul>
  135. 135. How to build a Certificate X.509 Certificate CA’s Signature X.509 Fields Public key Identity etc. Digital Signature Process CA
  136. 136. How to verify a certificate ? <ul><li>Obtain the Signer’s (CA) public-key </li></ul><ul><li>Pass the X.509 fields into the message digest algorithm and keep the digest (= your digest 1) </li></ul><ul><li>Decrypt the Certificate signature with the Signer’s (CA) public-key. The decrypting plaintext will be the digest (= your digest 2) </li></ul><ul><li>Compare the digest 1 with the digest 2 </li></ul><ul><li>Does this match together? </li></ul>
  137. 137. Verifying a certificate? MD1 = MD2 ??? CA’s public key CA’s Signature X.509 Fields Public key Identity etc.
  138. 138. A few words about CAs <ul><li>Entities that issue and manage digital certificates including </li></ul><ul><ul><li>maintaining </li></ul></ul><ul><ul><li>revoking </li></ul></ul><ul><ul><li>publishing status information </li></ul></ul><ul><li>CAs’ security policy defined in CPS (Certification Practice Statement) </li></ul><ul><ul><li>Security measures to guarantee CA’s integrity </li></ul></ul><ul><ul><li>Security measures to check enrollment’s identity </li></ul></ul><ul><li>Trust level relies upon CPS and not technology </li></ul>
  139. 139. Few words about CAs <ul><li>PKI security relies on CA’s private-key secrecy </li></ul><ul><ul><li>Should never be acceded </li></ul></ul><ul><ul><li>Should be backed-up </li></ul></ul><ul><ul><li>Solution: store it inside dedicated tamperproof hardware </li></ul></ul>
  140. 140. Type of CAs <ul><li>Private CAs: </li></ul><ul><ul><li>Hold by a private entity (Company, Administration, the Military) </li></ul></ul><ul><li>Public CAs: </li></ul><ul><ul><li>Verisign, Swisskey, GTE, Thawte, Global-sign, Certplus, etc. </li></ul></ul>
  141. 141. Registration Authority (RA) <ul><li>A Registration Authority is the entity receiving the certification requests and managing them before sending them to the CA. RA acts as a front end. </li></ul><ul><li>As in hybrid CAs, the registration authority can be separate from the CA itself. In this case we talk about Local Registration Authority (LRA) </li></ul><ul><ul><li>Multiple sites for big companies </li></ul></ul><ul><ul><li>Distributed environment </li></ul></ul>
  142. 142. LDAP <ul><li>X.500 Directories required more effort and complexity than most companies were prepared to invest </li></ul><ul><li>L ightweight D irectory A ccess P rotocol was proposed by the Internet community </li></ul><ul><li>LDAP uses the X.500 naming conventions but simplifies the way you interact with a directory </li></ul>
  143. 143. LDAP <ul><li>LDAP is a “front end” that is used to implement simple directory services </li></ul><ul><li>An LDAP Server may be implemented over: </li></ul><ul><ul><li>a full X.500 Directory </li></ul></ul><ul><ul><li>a database </li></ul></ul><ul><ul><li>a flat file </li></ul></ul><ul><ul><li>Most of structured data set </li></ul></ul><ul><li>CA will use LDAP to publish certificates and CRLs </li></ul>
  144. 144. Certificate Revocation <ul><li>Certificate Revocation: </li></ul><ul><ul><li>Mechanism used by the CA to publish and disseminate revoked certificates </li></ul></ul><ul><li>Revocation is triggered in the following cases: </li></ul><ul><ul><li>Key compromise </li></ul></ul><ul><ul><li>CA compromise </li></ul></ul><ul><ul><li>Cessation of operation </li></ul></ul><ul><ul><li>Affiliation change </li></ul></ul><ul><ul><li>etc... </li></ul></ul>
  145. 145. Certificate Revocation <ul><li>Several data structures exist to publish revocation </li></ul><ul><ul><li>CRL (Certificate Revocation List) </li></ul></ul><ul><ul><li>ARL (Authority Revocation List) </li></ul></ul><ul><ul><li>CRT (Certificate Revocation Trees) by Valicert </li></ul></ul><ul><li>Also Online query mechanisms </li></ul><ul><ul><li>OCSP (Online Certificate Status Protocol) </li></ul></ul>
  146. 146. CRL’s publication and retrieval <ul><li>Certificate-using applications must be aware of revoked certificates </li></ul><ul><ul><li>Get CRL via ldap </li></ul></ul><ul><ul><li>Get CRL via FTP, Http, Https, etc. </li></ul></ul><ul><ul><li>Check certificate status via OCSP </li></ul></ul><ul><ul><li>Etc. </li></ul></ul><ul><li>Problem to solve: Revocation delay ! </li></ul><ul><li>Not yet fully standardized (Delta CRLs, OCSP etc.) </li></ul>
  147. 147. OSCP LDAP OCSP FTP, http others OCSP over http PKI enable Applications Pushing Revocation OCSP Responder CA Backend
  148. 148. Trust <ul><li>Because a CA has a certificate itself and represents the highest possible trust level, the CA has its self-signed certificate </li></ul><ul><li>A self-signed certificate is a Root Certificate or Meta-Introducer </li></ul><ul><li>A certificate-using application (any X.509 holders) must trust the Root certificate </li></ul><ul><li>Importing a Root certificate into such an application is called Bootstrapping a CA </li></ul>
  149. 149. Trusted Root certificates <ul><li>Many applications (as http browsers) have already embedded root certificates </li></ul>
  150. 150. Let’s be practical! User enrolls for certificate http://www... User mailed retrieval PIN User retrieves certificate http://www... Admin Approves request http://www... User mailed acknowledgement Admin mailed notification RA CA User Security Officer LDAP Certificate installed
  151. 151. PKI Standards <ul><li>Some standard organizations: </li></ul><ul><ul><li>IETF PKI Working Group (PKIX) </li></ul></ul><ul><ul><li>ITU </li></ul></ul><ul><ul><li>SPKI </li></ul></ul><ul><ul><li>RSA with PKCS </li></ul></ul>
  152. 152. PKI Summary <ul><li>Based on Certificates (X.509) </li></ul><ul><li>Trusted third party (CA) </li></ul><ul><li>(L)RA </li></ul><ul><li>CRL </li></ul><ul><li>Data repositories </li></ul><ul><li>Mechanisms and protocols between all these elements </li></ul>
  153. 153. S/MIME
  154. 154. S/MIME <ul><li>S ecure M ultipurpose I nternet M ail E xchange </li></ul><ul><li>Developed by RSA, Microsoft, Lotus, Banyan, and Connectsoft in 1995 </li></ul><ul><li>Implemented at application layer </li></ul><ul><li>Build on top of PKCS #7 and PKCS #10 </li></ul><ul><li>Very strong commercial vendor acceptance </li></ul><ul><ul><li>Netscape, Microsoft, Lotus, etc. </li></ul></ul><ul><li>IETF developed S/MIME v3 (last version) </li></ul><ul><li>Use X.509 certificates </li></ul>
  155. 155. S/MIME <ul><li>S/MIME provides four services: </li></ul>
  156. 156. S/MIME Ciphers <ul><li>Symmetric encryption </li></ul><ul><ul><li>3DES 168 bit </li></ul></ul><ul><ul><li>DES 56 bit </li></ul></ul><ul><ul><li>RC2 128, 64 and 40 bit </li></ul></ul><ul><li>Public-Key </li></ul><ul><ul><li>RSA 512 to 1024 bit </li></ul></ul>
  157. 157. S/MIME dual Key ? <ul><li>Dual Key Pair </li></ul><ul><ul><li>One key pair for encryption </li></ul></ul><ul><ul><li>One key pair for signature and non repudiation </li></ul></ul><ul><li>CA must support key backup and recovery </li></ul><ul><li>Key pair for encryption generated on the CA itself ! </li></ul><ul><li>Draw back: </li></ul><ul><ul><li>Not all Email client support Dual Key Pair </li></ul></ul>
  158. 158. SSL / TLS
  159. 159. SSL <ul><li>S ecure S ockets L ayer TCP/IP socket encryption </li></ul><ul><li>Provides end-to-end protection of communications sections </li></ul><ul><li>Confidentiality protection via encryption </li></ul><ul><li>Integrity protection with MAC’s </li></ul><ul><li>Usually authenticates server using a digital signature (option) </li></ul><ul><li>Can authenticate client (option) </li></ul>
  160. 160. SSL History <ul><li>SSL v1 designed by Netscape in 1994 </li></ul><ul><ul><li>Netscape internal usage </li></ul></ul><ul><li>SSL v2 shipped with Navigator 1.0 and 2.0 </li></ul><ul><ul><li>Microsoft proposed PCT (Private Communications Technology), which overcame some SSL v2 shortcomings </li></ul></ul><ul><li>SSL v3 latest version </li></ul><ul><ul><li>The progresses of PCT were echoed in SSL v3 </li></ul></ul><ul><li>TLS v1 developed by IETF </li></ul>
  161. 161. SSL Protocol <ul><li>The SSL protocol runs above TCP/IP </li></ul><ul><li>The SSL protocol runs below higher-level protocols such as HTTP or IMAP </li></ul>
  162. 162. SSL Ports from IANA <ul><li>nsiiops 261/tcp # IIOP Name Service over TLS/SSL </li></ul><ul><li>https 443/tcp # http protocol over TLS/SSL </li></ul><ul><li>smtps 465/tcp # smtp protocol over TLS/SSL (was ssmtp) </li></ul><ul><li>nntps 563/tcp # nntp protocol over TLS/SSL (was snntp) </li></ul><ul><li>imap4-ssl 585/tcp # IMAP4+SSL (use 993 instead) </li></ul><ul><li>sshell 614/tcp # SSLshell </li></ul><ul><li>ldaps 636/tcp # ldap protocol over TLS/SSL (was sldap) </li></ul><ul><li>ftps-data 989/tcp # ftp protocol, data, over TLS/SSL </li></ul><ul><li>ftps 990/tcp # ftp protocol, control, over TLS/SSL </li></ul><ul><li>telnets 992/tcp # telnet protocol over TLS/SSL </li></ul><ul><li>imaps 993/tcp # imap4 protocol over TLS/SSL </li></ul><ul><li>ircs 994/tcp # irc protocol over TLS/SSL </li></ul><ul><li>pop3s 995/tcp # pop3 protocol over TLS/SSL (was spop3) </li></ul><ul><li>msft-gc-ssl 3269/tcp # Microsoft Global Catalog with LDAP </li></ul>
  163. 163. SSL Ciphers <ul><li>The SSL protocol supports the use of a variety of different cryptographic algorithms or ciphers </li></ul><ul><ul><li>DES (56) </li></ul></ul><ul><ul><li>3DES (168) </li></ul></ul><ul><ul><li>RC4 (40 or 128) </li></ul></ul><ul><ul><li>RC2 (40) </li></ul></ul><ul><ul><li>Fortezza (96) </li></ul></ul><ul><ul><li>IDEA (128) </li></ul></ul><ul><ul><li>SHA-1, MD5 </li></ul></ul><ul><ul><li>DSA </li></ul></ul><ul><ul><li>RSA (Key exchange) </li></ul></ul>
  164. 164. SSL Handshake <ul><li>Negotiate the cipher suite </li></ul><ul><li>Establish a shared session key </li></ul><ul><li>Authenticate the server (Optional) </li></ul><ul><li>Authenticate the client (Optional) </li></ul>
  165. 165. SSL Handshake TCP Hello GET URL Client Server DATA Client performs TCP handshake with the server at port 443 for HTTPS which is HTTP in SSL Start Cipher negotiation. Client sends SSL HELLO containing ciphers supported by the client and a random number. Start pass secret. Server sends it’s CERTIFICATE. Client and Server exchange CHANGE CIPHER SPEC and FINISH messages. Begin bulk encrypted data exchange. Client encrypts and sends HTTP GET. Server decrypts request, encrypts and sends response Server sends FINISH and closes with TCP handshake S A SSL connection consists of an SSL handshake followed by bulk encrypted protocol S 443 Cert The server responds with a HELLO containing the ciphers to use and a random number. Note the server selects the ciphers to be used. RSA, RC4 and MD5 are most common. Client uses certificate to encrypt the pre-master Secret and sends to Server. Both compute bulk encryption KEYS from secret and random numbers. Bulk Encrypted HTTP Protocol Symmetric SSL Handshake Asymmetric 0.2 - 4 KB
  166. 166. Client authenticate server <ul><li>Is today's date within the validity period? </li></ul><ul><li>Is the issuing CA a trusted CA? </li></ul><ul><li>Does the issuing CA's public-key validate the issuer's digital signature? </li></ul><ul><li>Does the domain name in the server's certificate match the domain name of the server itself? </li></ul>
  167. 167. Demo: Wrong URL !
  168. 168. Server authenticate client <ul><li>Does the client's public-key validate its digital signature ? (challenge) </li></ul><ul><li>Is today's date within the validity period? </li></ul><ul><li>Is the issuing CA a trusted CA? </li></ul><ul><li>Does the issuing CA's public-key validate the issuer's digital signature? </li></ul><ul><li>Is the user's certificate listed in a CRL? </li></ul>
  169. 169. SSL Tunneling <ul><li>SSL can provide tunneling to transport TCP port over an encrypted channel </li></ul><ul><li>Some tunneling software can use client and server authentication using Certificates X.509 </li></ul><ul><li>Some tunneling programs </li></ul><ul><ul><li>Webtop (Sun/Netscape) </li></ul></ul><ul><ul><li>Stunnel </li></ul></ul><ul><ul><li>bjorb, Jonama </li></ul></ul><ul><ul><li>SSLProxy </li></ul></ul><ul><ul><li>Celo Communicationss (SSR) </li></ul></ul>
  170. 170. SSL Hardware accelerator <ul><li>RSA key exchange is very CPU Intensive </li></ul><ul><ul><li>200 Mhz NT box allows about a dozen concurrent SSL handshakes </li></ul></ul><ul><ul><ul><li>Use Multiple server </li></ul></ul></ul><ul><ul><ul><li>Use Hardware encryption (Intel-IPIVOT, Ncipher, Rainbow, etc.) </li></ul></ul></ul>
  171. 171. SGC <ul><li>Server Gated Cryptography </li></ul><ul><li>Allows strong encryption on a server basis </li></ul><ul><li>Originally available only to “qualified financial institutions” </li></ul><ul><li>Requires a special SGC server certificate from: </li></ul><ul><ul><li>Verisign Global-ID </li></ul></ul><ul><ul><li>Thawte SuperCert </li></ul></ul><ul><ul><li>GlobalSign HyperSign128 </li></ul></ul><ul><ul><li>Etc. </li></ul></ul>
  172. 172. SGC <ul><li>Enables strong encryption for export’s browser </li></ul><ul><li>Procedure: </li></ul><ul><ul><li>Browser is export version: 40 bit cipher only ! </li></ul></ul><ul><ul><li>Browser connect to SGC-enabled server with 40 bits cipher </li></ul></ul><ul><ul><li>Server send his SGC-tagged certificate to browser </li></ul></ul><ul><ul><li>Browser verifies server certificate and detect that is issued by a CA root certificate which is tagged to enable SGC </li></ul></ul><ul><ul><li>Browser enabled 128 bit ciphers and force a SSL/TLS renegotiation with the stronger cipher suite. </li></ul></ul>
  173. 173. TLS <ul><li>T ransport L ayer S ecurity </li></ul><ul><li>IETF standardized evolution of SSL v3 </li></ul><ul><ul><li>Update Mac layer to HMAC </li></ul></ul><ul><ul><li>Updated for newer algorithms </li></ul></ul><ul><li>Substantially similar to SSL v3 </li></ul><ul><ul><li>Cleanup of SSL v3 </li></ul></ul><ul><ul><li>Aka SSL v3.1 </li></ul></ul><ul><li>Standardized by RFC 2246 (Jan 1999) </li></ul>
  174. 174. Installing a SSL Web Server <ul><li>Create the key-pair: Public and Private-Keys </li></ul><ul><ul><li>Each server includes programs to generate these </li></ul></ul><ul><li>Generate a CSR (Certificate Signing Request) </li></ul><ul><ul><li>This adds Information about your server and yourself </li></ul></ul><ul><li>Send the CSR to a CA (Certificate Authority) and wait for your Certificate </li></ul><ul><ul><li>For instance Verisign, or a internal CA </li></ul></ul><ul><li>Install the Certificate </li></ul>
  175. 175. Demo: unknown certificate
  176. 176. IPSEC
  177. 177. IPSec introduction <ul><li>Stands for IP Security </li></ul><ul><li>Provide site-to-site and/or host-to-site encryption and/or authentication </li></ul><ul><li>Driven by the IETF </li></ul><ul><li>Mandatory for IPv6, optional for IPv4 </li></ul>
  178. 178. IPSec: two main ”Blocks” <ul><li>IPSec deals with two main “blocks” </li></ul><ul><ul><li>IPSec - Encryption and Authentication </li></ul></ul><ul><ul><ul><li>ESP - Encapsulating Security Payload </li></ul></ul></ul><ul><ul><ul><li>AH - Authentication Header </li></ul></ul></ul><ul><ul><ul><li>Two modes: Tunnel and transport </li></ul></ul></ul><ul><ul><li>IPSec - Key management </li></ul></ul><ul><ul><ul><li>IKE, Skip, Manual IPSEC </li></ul></ul></ul>
  179. 179. IPSec: ESP and AH <ul><li>The AH (Authentication Header) is a protocol providing authentication only </li></ul><ul><li>The ESP (Encapsulation Protocol) is an IPSEC protocol for packet encryption and encapsulation. </li></ul><ul><li>Both protocols offer integrity check with authentication </li></ul>
  180. 180. IPSec Tunnel mode <ul><li>Each datagram is captured by the security gateway, encapsulated inside an IPSEC packet and sent to a remote security gateway, which “decapsulates” it, and sends the original datagram to its original destination </li></ul><ul><li>The two security gateways create a ‘tunnel’ through which data is passed </li></ul><ul><li>The two hosts (and their applications) are unaware of the encapsulation process </li></ul>
  181. 181. IPSec Tunnel mode IP TCP Application UDP IP TCP Application UDP IP AH/ESP Protected Data IP AH/ESP Protected Data Protected Traffic Hosts IPSec gateway
  182. 182. IPSec Transport mode <ul><li>In transport mode, the two hosts serve as a security gateway and encrypt their own data </li></ul><ul><li>In this case, there is no need for a tunnel, nor for the double IP header </li></ul><ul><li>The two hosts are aware of the encapsulation (since they perform it) </li></ul>
  183. 183. Transport mode Protected Traffic IP TCP Application UDP IP TCP Application UDP
  184. 184. Security Associations (SA) <ul><li>The SA is shared by the two communicating parties - it provides indications on the algorithms, the keys, the lifetimes and other algorithm dependant information </li></ul><ul><li>The SPI (Security Parameter Index) is a number and serves as an index to the SA </li></ul><ul><li>Each SA has two SPIs: incoming & outgoing </li></ul>
  185. 185. SPI and SA (Basics) SPI: 0x1234567 Encryption (ESP): DES Authentication (AH): SHA-1 DES Key: 0x1615613651365365326536 SHA-1: 0x32676362736347672672644 SPI: 0x1234567 SA
  186. 186. IPSec Key management <ul><li>In order to create the SA, the two parties need to exchange all the security parameters, as well as the keys. </li></ul><ul><li>Several methods of key management: </li></ul><ul><ul><li>Manual keying or manual IPSec (statically defining SPI and SA). </li></ul></ul><ul><ul><li>SKIP (Simple Key Interchange Protocol by SUN Microsystems) </li></ul></ul><ul><ul><li>ISAKMP/OAKLEY or IKE: automatic key management using DH </li></ul></ul><ul><ul><li>Photuris alternative to IKE using DH </li></ul></ul>
  187. 187. Manual IPSec <ul><li>On each gateway a specific SA is defined (according S/WAN) for each remote gateway (SPI, Cipher, Keys, Hash etc.) </li></ul><ul><li>Drawback: </li></ul><ul><ul><li>Very heavy management </li></ul></ul><ul><ul><li>Static keys: less security </li></ul></ul><ul><li>Often used between different IPSec vendors </li></ul><ul><ul><li>Cisco to Check Point for instance </li></ul></ul>
  188. 188. Manual IPSec SA SPI SA SPI
  189. 189. IKE Key management <ul><li>IKE is widely used (OSPF, IPSec etc..) </li></ul><ul><li>SA proposal and negotiation is done using IKE </li></ul><ul><li>Peers may be authenticated using X.509 certificate </li></ul><ul><ul><li>Each IPSec gateway holds a X.509 certificate </li></ul></ul><ul><ul><li>SA negotiation starts after cross authentication </li></ul></ul><ul><li>Alternate method for authentication: </li></ul><ul><ul><li>Authentication is provided by pre-shared secrets </li></ul></ul><ul><ul><li>Drawback: heavy key management etc. </li></ul></ul>
  190. 190. IKE Key management using PKI SA SPI SA SPI Negotiation with Automatic Key Management X509 X509
  191. 191. Questions?
  192. 192. Pour plus d’informations e-Xpert Solutions SA Sylvain Maret Route de Pré-Marais 29 CH-1233 Bernex / Genève +41 22 727 05 55 [email_address]

×