Security Issues

Web Architecture (INFO 290-03)

Erik Wilde, UC Berkeley School of Information
2008-09-11

Creative Commons License

This work is licensed under a CC
Attribution 3.0 Unported License

Abstract

TCP and thus HTTP are clear-text protocols, which make no attempt to hide the data being transmitted. For secure data transfers, it thus is necessary to use additional technologies for providing secure data transfers. This lecture looks briefly into the foundations of cryptographic primitives (such as one-way functions and encryption) and cryptographic protocols. For the Web, the most interesting security feature are secure HTTP interactions, which are provided by HTTP over SSL (HTTPS), a protocol that layers an encryption layer (SSL or TLS) between TCP and HTTP.


Security 101

Outline (Security 101)

  1. Security 101 [8]
    1. One-Way Function [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [3]
  2. Cryptographic Protocols [6]
    1. Digital Signature [4]
    2. Secure Communications [1]
  3. HTTP over SSL (HTTPS) [4]
  4. Conclusions [1]

Cryptography


One-Way Function

Essence of Data

  • Hashes (or message digests) are a well-known principle in computer science
    • fast to compute (the goal is to make data handling more efficient)
    • few collisions (there are always collisions because of the smaller size)
    • checksums and Cyclic Redundancy Check (CRC) are popular hashes
  • One-way functions are cryptographically safe hashes
    • not just for detecting errors, but also for preventing tampering
    • often referred to as cryptographic hash or digital fingerprint
  • One-way functions must satisfy additional criteria
    • it must be very hard to find an input producing a given output
    • it must be very hard to find two inputs producing the same output (collision)

Reducing Data

Hash

Secret-Key Cryptography

Plausible Encryption

  • Secret-Key is was most people think of when thing of encryption
    • symmetric cryptography is another popular term
  • One key for encryption and decryption
  • Losing the key makes encrypted data openly readable
    • there must be a secure channel to transport keys
  • Good for long-term relationships with few partners
    • exchange secret keys as part of the initial setup of a relationships
    • adding partners requires a secure channel for key exchange
    • changing keys requires a secure channel for key exchange
  • Almost impractical in an environment with many ad-hoc partners

Notice the Arrow

Secret-Key Cryptography

Public-Key Cryptography

Implausible Encryption

  • Public-Key intuitively is hard to accept as a concept
    • asymmetric cryptography is another popular term
  • Key pairs of one public and one secret key
    • key generation is the process of generating these key pairs
  • The public key can be made available to the public
    • only the secret key can do the inverse operation of the public key
  • Good for short-term relationships with many partners
    • publish your public key so that it can be used worldwide
    • everybody can encrypt data using the public key
    • only the owner of the secret can can decrypt the message and read it
  • Computationally expensive and not good for a large amounts of data

No Arrow Here …

Public-Key Cryptography (Encrypting with Public Key)

And No Arrow Here …

Public-Key Cryptography (Encrypting with Secret Key)

Cryptographic Protocols

Outline (Cryptographic Protocols)

  1. Security 101 [8]
    1. One-Way Function [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [3]
  2. Cryptographic Protocols [6]
    1. Digital Signature [4]
    2. Secure Communications [1]
  3. HTTP over SSL (HTTPS) [4]
  4. Conclusions [1]

Building Secure Applications


Digital Signature

Encrypted Fingerprints

  • Hashes are used to check data integrity
  • One-Way Functions are used to check data integrity securely
    • it is not possible to reverse engineer data for a given hash
  • Signed hashes can be used to ensure data authenticity
    • if the hash sum is signed, it cannot be changed
    • if the data is changed, its hash will not match the signed hash
  • Digital signatures work as long as the hash can be securely signed
    • there must be a trusted public key for checking the hash signature

Creating a Digital Signature

signature-sign.jpg

Verifying a Digital Signature

signature-verify.jpg

Certificate

  • Certificates are digital signatures issued by a trusted party
    • most digital signatures are created with certified public keys
    • this means the digital signature is created based on a digitally signed key
  • Who can you trust on the Web?
    • trust can only start to grow based on initial trust in something
    • many systems come with pre-installed trust (root certificates)
    • certificates from other issuers will cause browsers to complain
  • Certificates (like domain names) are a very easy way to make money
    • in theory there are different levels of certificates with different levels of identity checking
    • in practice most sites choose the cheapest one that does not give an error message

Secure Communications

Encrypted Keys

  • Public-Key cryptography is computationally expensive
    • it is possible to encrypt all traffic using asymmetric key pairs
    • this generates considerably more load on the server side
  • Combining public- and secret-key cryptography
    1. check the public key for authenticity (using a Certificate)
    2. generate a key for a secret-key encryption scheme
    3. use the public key to securely transmit the secret key
    4. use the secret key for securely transmitting the payload
  • Combines the advantages of both methods
    • the lower complexity of secret-key algorithms
    • the ability of public-key algorithms to work without a secure channel

HTTP over SSL (HTTPS)

Outline (HTTP over SSL (HTTPS))

  1. Security 101 [8]
    1. One-Way Function [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [3]
  2. Cryptographic Protocols [6]
    1. Digital Signature [4]
    2. Secure Communications [1]
  3. HTTP over SSL (HTTPS) [4]
  4. Conclusions [1]

HTTP and Security


HTTPS vs. S-HTTP


HTTP and SSL

HTTP and SSL

TLS vs. IPsec

TLS vs. IPsec

Conclusions

Outline (Conclusions)

  1. Security 101 [8]
    1. One-Way Function [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [3]
  2. Cryptographic Protocols [6]
    1. Digital Signature [4]
    2. Secure Communications [1]
  3. HTTP over SSL (HTTPS) [4]
  4. Conclusions [1]

Internet Security