Spring 2010 — INFO 152 (CCN 42504)

2010-04-09

[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/]

- 2Abstract
- 1 Current Events
- 4iPhone OS 4
- 5Multitasking
- 6Multitasking Services
- 7Background Audio
- 8Location Services
- 9Advertising
- 10Social Gaming

- 2 Security 101
- 12Cryptography
- 2.1 Hash Functions
- 14Simple Hash Functions
- 15One-Way Function

- 2.2 Secret-Key Cryptography
- 17Plausible Encryption
- 18Notice the Arrow

- 2.3 Public-Key Cryptography
- 20Implausible Encryption
- 21No Arrow Here …

- 2.4 Cryptographic Protocols
- 23Building Secure Applications
- 24Certificate
- 25Creating a Digital Signature
- 26Verifying a Digital Signature

Erik WildeUC Berkeley School of Information:
Security Mechanisms

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 [7]
- Security 101 [11]

- Audio (e.g., Pandora)
- Voice over IP (e.g., Skype)
- Location (e.g., Loopt, Navigation)
- Push Notifications
- Local Notifications
- Task Completion
- Fast App Switching (
sleep

)

- Current Events [7]
- Security 101 [11]

- Cryptography is structured into different layers
- layering is a well-established principle for
*separation of concerns*

- layering is a well-established principle for
*Cryptographic primitives*implement very basic functionality- changes and advancements in this area are limited to very specialized researchers
- it is easy to make fatal mistakes which then compromise everything built on top if it

*Cryptographic protocols*assemble primitives into application-level solutions- primitives solve very basic security problems (fingerprints, encryption, …)
- protocols combine these into applications (digital signatures, secure communications, …)
*installing trusted applications*is a common mobile security scenario

- Current Events [7]
- Security 101 [11]
- Hash Functions [2]
- Secret-Key Cryptography [2]
- Public-Key Cryptography [2]
- Cryptographic Protocols [4]

- 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 algorithmslength 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

- many technologies (hard drives, networks, …) use

- 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 Function

→e367cdcfd2e16f28e81bbc58c9d3339c

*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 Function

→afd38b77186afba44123093827c2e0f3732726c4

- Current Events [7]
- Security 101 [11]
- Hash Functions [2]
- Secret-Key Cryptography [2]
- Public-Key Cryptography [2]
- Cryptographic Protocols [4]

- 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

- Current Events [7]
- Security 101 [11]
- Hash Functions [2]
- Secret-Key Cryptography [2]
- Public-Key Cryptography [2]
- Cryptographic Protocols [4]

- 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

- Current Events [7]
- Security 101 [11]
- Hash Functions [2]
- Secret-Key Cryptography [2]
- Public-Key Cryptography [2]
- Cryptographic Protocols [4]

*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

- 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

2010-04-09
Mobile Application Design and Development [./]

Spring 2010 — INFO 152 (CCN 42504)

Spring 2010 — INFO 152 (CCN 42504)