Security Mechanisms

Mobile Application Design and Development [./]
Spring 2010 — INFO 152 (CCN 42504)

Erik Wilde, UC Berkeley School of Information
2010-04-09

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents Erik Wilde: Security Mechanisms

Contents

Erik Wilde: Security Mechanisms

(2) Abstract

For the HTTP authentication methods introduced in the last lecture, some fundamental cryptographic methods and protocols already have been taking for granted. In this lecture, we look a bit more systematically at the fundamental cryptographic methods (hash sums, one-way functions, symmetric encryption, asymmetric encryption) and how these are combined into cryptographic protocols.



Current Events

Outline (Current Events)

  1. Current Events [7]
  2. Security 101 [11]
    1. Hash Functions [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [2]
    4. Cryptographic Protocols [4]
Current Events Erik Wilde: Security Mechanisms

(4) iPhone OS 4

iphone-os-4.jpg

Current Events Erik Wilde: Security Mechanisms

(5) Multitasking

Hello, Skype

Current Events Erik Wilde: Security Mechanisms

(6) Multitasking Services

  1. Audio (e.g., Pandora)
  2. Voice over IP (e.g., Skype)
  3. Location (e.g., Loopt, Navigation)
  4. Push Notifications
  5. Local Notifications
  6. Task Completion
  7. Fast App Switching (sleep)


Current Events Erik Wilde: Security Mechanisms

(7) Background Audio

Hello, Pandora

Current Events Erik Wilde: Security Mechanisms

(8) Location Services

Hello, Stalker

Current Events Erik Wilde: Security Mechanisms

(9) Advertising

Location-Based Ads

Current Events Erik Wilde: Security Mechanisms

(10) Social Gaming

Good bye, OpenFeint

Security 101

Outline (Security 101)

  1. Current Events [7]
  2. Security 101 [11]
    1. Hash Functions [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [2]
    4. Cryptographic Protocols [4]
Security 101 Erik Wilde: Security Mechanisms

(12) Cryptography



Hash Functions

Hash Functions Erik Wilde: Security Mechanisms

(14) Simple Hash Functions

  • Hashes (or message digests) are well-known in computer science
  • Hash values are of fixed and short length and make it easier to compare data
  • Collisions are the most problematic case in hash algorithms
    • length in bytes is even/uneven: risk of collision is 50%
    • length in bytes: collisions happen when data is simply replaced
  • Hashing is often done on an ad-hoc basis
    • lengths are a form of hashes
    • time stamps are a form of hashes
  • Hashing is also used for computing error correction codes
    • many technologies (hard drives, networks, …) use Cyclic Redundancy Code (CRC) [http://en.wikipedia.org/wiki/Cyclic_redundancy_check] hashes
    • error correction codes computation has to be done very fast


Hash Functions Erik Wilde: Security Mechanisms

(15) One-Way Function

  • One-way functions are cryptographically safe hashes [Simple Hash Functions (1)] (a.k.a. cryptographic hash)
    • very hard to find an input producing a given output
    • very hard to find two inputs producing the same output (collision)
    • small changes in input should cause entirely different output
  • MD5 [http://en.wikipedia.org/wiki/MD5] has been a very popular cryptographic hash
    • MD5 turns data into a 128bit hash value (often encoded as 32 hex characters)
    • various security flaws have been discovered over the years
    • MD5 Hash Functione367cdcfd2e16f28e81bbc58c9d3339c
  • SHA [http://en.wikipedia.org/wiki/SHA] is the most popular cryptographic hash in use today
    • SHA-1 turns data into a 160bit hash value (often encoded as 40 hex characters)
    • SHA-1 Hash Functionafd38b77186afba44123093827c2e0f3732726c4


Secret-Key Cryptography

Outline (Secret-Key Cryptography)

  1. Current Events [7]
  2. Security 101 [11]
    1. Hash Functions [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [2]
    4. Cryptographic Protocols [4]
Secret-Key Cryptography Erik Wilde: Security Mechanisms

(17) Plausible Encryption

  • Secret-Key is was most people think of when thinking of encryption
    • symmetric cryptography is another popular term
  • One key for encryption and decryption
  • Revealing the key makes encrypted data openly readable
    • there must be a secure channel to transport keys, such as diplomatic pouches [http://en.wikipedia.org/wiki/Diplomatic_bag]
  • 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


Secret-Key Cryptography Erik Wilde: Security Mechanisms

(18) Notice the Arrow

Secret-Key Cryptography

Public-Key Cryptography

Outline (Public-Key Cryptography)

  1. Current Events [7]
  2. Security 101 [11]
    1. Hash Functions [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [2]
    4. Cryptographic Protocols [4]
Public-Key Cryptography Erik Wilde: Security Mechanisms

(20) 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


Public-Key Cryptography Erik Wilde: Security Mechanisms

(21) No Arrow Here …

Public-Key Cryptography (Encrypting with Secret Key)

Cryptographic Protocols

Outline (Cryptographic Protocols)

  1. Current Events [7]
  2. Security 101 [11]
    1. Hash Functions [2]
    2. Secret-Key Cryptography [2]
    3. Public-Key Cryptography [2]
    4. Cryptographic Protocols [4]
Cryptographic Protocols Erik Wilde: Security Mechanisms

(23) Building Secure Applications

  • Cryptographic primitives in most cases are not sufficient
    • they provide basic functionality for fundamental tasks
    • they must by combined to provide solutions for real-world problems
  • Typical problem #1: How to ensure key authenticity
    • with insecure keys, the majority of cryptographic methods is worthless
  • Typical problem #2: How to communicate securely without shared keys
    • many interesting scenarios are based on ad-hoc interactions
    • secret-key does not work, public-key needs to verify the peer
  • Typical problem #3: How to check authenticity and integrity of data
    • integrity can be done with checksums, but these could be forged
    • authenticity needs a cryptographically secure way of combining identity and data


Cryptographic Protocols Erik Wilde: Security Mechanisms

(24) 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 [https://katapultmedia.com/]
  • 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


Cryptographic Protocols Erik Wilde: Security Mechanisms

(25) Creating a Digital Signature

signature-sign.jpg

Cryptographic Protocols Erik Wilde: Security Mechanisms

(26) Verifying a Digital Signature

signature-verify.jpg

2010-04-09 Mobile Application Design and Development [./]
Spring 2010 — INFO 152 (CCN 42504)