Lecture17

586 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
586
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Lecture17

  1. 1. Server-side Web Programming Lecture 17: SSL and HTTPS for Secure Communication
  2. 2. Security Problems <ul><li>Major concerns: </li></ul><ul><li>Encryption of sensitive data sent between client and server </li></ul><ul><li>Authentication of server </li></ul><ul><ul><li>How does client know who they are dealing with? </li></ul></ul><ul><li>Information integrity </li></ul><ul><ul><li>How do we know third party has not altered data en route? </li></ul></ul>Change so item shipped to Darth Address information Bob’s web site Alice thinks she is at Bob’s site, but Darth is spoofing it Bob’s web site
  3. 3. Security Protocols <ul><li>Encryption algorithms </li></ul><ul><li>Symmetric key: DES, AES, RC4, etc. </li></ul><ul><ul><li>Fast </li></ul></ul><ul><ul><li>Requires both parties to know same secret key </li></ul></ul><ul><ul><ul><li>Impossible in paractice </li></ul></ul></ul><ul><li>Public key: RSA, etc. </li></ul><ul><ul><li>Sender uses public key of recipient to encrypt data </li></ul></ul><ul><ul><li>Recipient uses their private key to decrypt </li></ul></ul><ul><ul><ul><li>Darth cannot recreate private key from public key </li></ul></ul></ul><ul><ul><li>Slow </li></ul></ul><ul><ul><ul><li>Not practical to encrypt/decrypt large blocks of data </li></ul></ul></ul>
  4. 4. Security Protocols <ul><li>Use public key encryption to securely send symmetric key </li></ul><ul><li>Use a much faster symmetric key algorithm (like DES) to securely transmit the rest of the message </li></ul>E K s D E(K S , K PU ) P K s E D P E(P, K S )
  5. 5. Security Protocols <ul><li>Information Integrity </li></ul><ul><li>Hashing function H(M) creates “ fingerprint ” of message M </li></ul><ul><li>Hashing applied to message by sender and recipient </li></ul><ul><li>Darth cannot create own fingerprint of altered message without key </li></ul><ul><li>If no match , message has been tampered with </li></ul>H M H M + H(M) H(M) M H(M) H(M) compare
  6. 6. Certificates <ul><li>Authentication: public key certificates created by certification authority </li></ul><ul><ul><li>Trusted third party (Verisign, Geotrust, Equifax, etc.) </li></ul></ul><ul><ul><li>Well known public key </li></ul></ul><ul><li>Certificate contains user’s name, signed with CA’s private key </li></ul><ul><ul><li>No one else can create the certificate without the private key </li></ul></ul>
  7. 7. Certificates <ul><li>Browser can validate certificate using CA’s public key </li></ul><ul><ul><li>Use indicated hash algorithm to create digest from all fields in certificate </li></ul></ul><ul><ul><li>Use CA’s public key to decrypt signature and get enclosed digest </li></ul></ul><ul><ul><li>If the two match, certificate is valid and has not been tampered with </li></ul></ul><ul><ul><li>Can then check user’s name to make sure matches </li></ul></ul>
  8. 8. Certificates <ul><li>Public keys stored in browser </li></ul>
  9. 9. SSL Protocol <ul><li>Secure Socket Layer protocol for web communication </li></ul><ul><ul><li>Latest upgrade: Transport Layer Security (TLS) </li></ul></ul><ul><ul><li>Same structure as SSL, somewhat more secure </li></ul></ul>
  10. 10. SSL Protocol <ul><li>Phase 1: Information exchange </li></ul><ul><li>Problem: Large number of encryption algorithms in use </li></ul><ul><ul><li>How do client and server agree on which to use? </li></ul></ul><ul><li>Client passes preferred algorithms to server </li></ul><ul><ul><ul><li>Public key encryption algorithms </li></ul></ul></ul><ul><ul><ul><li>Private key encryption algorithms </li></ul></ul></ul><ul><ul><ul><li>Hash algorithms </li></ul></ul></ul><ul><li>Server replies with algorithms that will be used </li></ul>
  11. 11. SSL Protocol <ul><li>Phase 2: Server Identification and Key Exchange </li></ul><ul><li>Server passes their certificates to client </li></ul><ul><ul><li>Client uses issuer public key to verify identity </li></ul></ul><ul><ul><li>May pass many certificates (one for each known issuer key) </li></ul></ul><ul><ul><li>Also passes public key </li></ul></ul>
  12. 12. SSL Protocol <ul><li>Phase 3: Client Identification and Key Exchange </li></ul><ul><li>Server may request certificate from client in some cases </li></ul><ul><ul><li>Online banking, etc. </li></ul></ul><ul><li>Client sends certificate and public key </li></ul><ul><ul><li>If certificate not requested, browser generates new public key </li></ul></ul>
  13. 13. Obtaining Certificates <ul><li>Must obtain from known public key authority </li></ul><ul><ul><li>Not free! </li></ul></ul><ul><ul><li>Expense depends on strength </li></ul></ul><ul><ul><ul><li>56 bits: inexpensive, but crackable </li></ul></ul></ul><ul><ul><ul><li>128 bits: expensive but secure </li></ul></ul></ul><ul><li>Can create “ temporary ” key for testing </li></ul><ul><ul><li>Keytool utility in Java </li></ul></ul><ul><ul><li>See page 520 in text </li></ul></ul>
  14. 14. Creating Certificates Password must be “changeit” for Tomcat Will automatically generate keys using RSA
  15. 15. Https Protocol <ul><li>When started, requests secure session from server </li></ul><ul><ul><li>Uses separate port in Tomcat </li></ul></ul><ul><li>Invokes SSL protocol </li></ul>
  16. 16. Https Protocol <ul><li>Need to edit server.xml file in conf directory to enable https: on some port </li></ul>
  17. 17. Https Protocol <ul><li>Note that will get warning since certificate not real! </li></ul><ul><li>If accept, get “secure” session </li></ul>
  18. 18. <ul><li>Https protocol is expensive </li></ul><ul><ul><li>Should not do unless necessary </li></ul></ul><ul><li>Once done with secure transactions, should go back to using non-secure channel </li></ul><ul><ul><li>Return to non-secure port </li></ul></ul>Https Protocol

×