icloud Keychain and ios 7 Data Protection Andrey Belenko Sr. Security Engineer @ viaforensics



Similar documents
Salesforce1 Mobile Security Guide

SENSE Security overview 2014

Secure Password Managers and Military-Grade Encryption on Smartphones: Oh, Really? Andrey Belenko and Dmitry Sklyarov Elcomsoft Co. Ltd.

DTI / Titolo principale della presentazione IPHONE ENCRYPTION. Litiano Piccin. 11 ottobre 2014

Deploying iphone and ipad Security Overview

Apple ios 8 Security

Online signature API. Terms used in this document. The API in brief. Version 0.20,

Resco Mobile CRM Security

Secure Password Managers and Military-Grade Encryption on Smartphones: Oh, Really?

Deploying iphone and ipad Mobile Device Management

Security for mobile apps

Cracking and Analyzing Apple icloud backups, Find My iphone, Document Storage! REcon 2013! Oleg Afonin, ElcomSoft Co. Ltd.!

High Security Online Backup. A Cyphertite White Paper February, Cloud-Based Backup Storage Threat Models

ipad in Business Security

ios Security Decoded Dave Test Classroom and Lab Computing Penn State ITS Feedback -

Guidance End User Devices Security Guidance: Apple ios 7

Mobile Iron User Guide

IAIK. Motivation 2. Advanced Computer Networks 2015/2016. Johannes Feichtner IAIK

Analyzing the Security Schemes of Various Cloud Storage Services

Forensic analysis of iphone backups

The Security of MDM systems. Hack In Paris 2013 Sebastien Andrivet

CrashPlan Security SECURITY CONTEXT TECHNOLOGY

Asymetrical keys. Alices computer generates a key pair. A public key: XYZ (Used to encrypt) A secret key: ABC98765 (Used to decrypt)

Security Architecture Whitepaper

2-FACTOR AUTHENTICATION FOR MOBILE APPLICATIONS: INTRODUCING DoubleSec

AD Image Encryption. Format Version 1.2

iphone in Business Security Overview

Mobile Device Management ios Policies

Internet Banking Two-Factor Authentication using Smartphones

Chapter 16: Authentication in Distributed System

SELF SERVICE RESET PASSWORD MANAGEMENT ARCHITECTURE GUIDE

Secure Socket Layer (SSL) and Transport Layer Security (TLS)

Cloud Services ADM. Agent Deployment Guide

Analysis of FileVault 2: Apple's full disk encryption. Omar Choudary Felix Grobert Joachim Metz

Ensuring the security of your mobile business intelligence

The Security Behind Sticky Password

The increasing popularity of mobile devices is rapidly changing how and where we

ios Security ios 9.0 or later September 2015

ios Security October 2012

NetIQ Advanced Authentication Framework

Securely Yours LLC We secure your information world. www. SecurelyYoursllc.com

VMware Horizon Workspace Security Features WHITE PAPER

ios How to Back Up from icloud

End User Devices Security Guidance: Apple OS X 10.10

SecureDoc Disk Encryption Cryptographic Engine

ADFS Integration Guidelines

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

Connected from everywhere. Cryptelo completely protects your data. Data transmitted to the server. Data sharing (both files and directory structure)

SECURING MOBILE APPLICATIONS

Two Factor Authentication (TFA; 2FA) is a security process in which two methods of authentication are used to verify who you are.

How To Use Kerberos

HIPAA Privacy & Security White Paper

Architecture and Data Flow Overview. BlackBerry Enterprise Service Version: Quick Reference

Secure Cross Border File Protection & Sharing for Enterprise Product Brief CRYPTOMILL INC

Apache Milagro (incubating) An Introduction ApacheCon North America

Bit Chat: A Peer-to-Peer Instant Messenger

Active Directory Management. Agent Deployment Guide

Guidance End User Devices Security Guidance: Apple OS X 10.9

Key & Data Storage on Mobile Devices

Auditing the Security and Management of Smart Devices. ISACA Dallas Meeting February 13, 2014

How to wipe personal data and from a lost or stolen mobile device

True Key by Intel Security

Strong and Convenient Multi-Factor Authentication on Mobile Devices

Security Technical. Overview. BlackBerry Enterprise Service 10. BlackBerry Device Service Solution Version: 10.2

Pryvate App User Manual

How Secure is Authentication?

A Taste of SANS SEC575 Part I: Invasion of the Mobile Phone Snatchers

CompTIA Mobile App Security+ Certification Exam (ios Edition) Live exam IOS-001 Beta Exam IO1-001

Security Guide. BlackBerry Enterprise Service 12. for ios, Android, and Windows Phone. Version 12.0

Chapter 15 User Authentication

How to configure your mobile devices post migrating to Microsoft Office 365

ios Security The Never-Ending Story of Malicious Profiles Adi Sharabani Yair Amit CEO & Co-Founder Skycure CTO & Co-Founder

Keeper Password Manager & Digital Vault

Securely Yours LLC IT Hot Topics. Sajay Rai, CPA, CISSP, CISM

Smart Ideas for Smartphone Security

Sophos Mobile Control User guide for Apple ios. Product version: 4

Two Factor Zero Knowledge Proof Authentication System

How to Send Stealth Text From Your Cell Phone

Efficient nonce-based authentication scheme for Session Initiation Protocol

Casper Suite. Security Overview

Welcome to ncrypted Cloud!

Efficient Nonce-based Authentication Scheme for. session initiation protocol

SAS Data Set Encryption Options

RSA SecurID Software Token 1.0 for Android Administrator s Guide

Outline. Transport Layer Security (TLS) Security Protocols (bmevihim132)

Dashlane Security Whitepaper

Configuring SIP Support for SRTP

Personal Cloud. Support Guide for Mobile Apple Devices

itunes: About ios backups

Guide for Setting Up Your Multi-Factor Authentication Account and Using Multi-Factor Authentication

Security of Cloud Storage: - Deduplication vs. Privacy

App Distribution Guide

Digital Certificates Demystified

Djigzo S/MIME setup guide

CLOUD STORAGE FORENSICS MATTIA EPIFANI SANS EUROPEAN DIGITAL FORENSICS SUMMIT PRAGUE, 7 OCTOBER 2013

2007 Microsoft Office System Document Encryption

FileCloud Security FAQ

365 Cloud Storage. Security Brief

Transcription:

icloud Keychain and ios 7 Data Protection Andrey Belenko Sr. Security Engineer @ viaforensics

ios Data Protection Keychain encryption since the very beginning Before ios 4: AES-CBC, per-device key ios 4: AES-CBC, per-record key based on desired item accessibility ios 5+: AES-GCM, per-record key, encrypts metadata

ios Data Protection Storage encryption since ios 4 * File-level (much like Windows EFS), so carving is challenging Per-file key based on protection class: NSFileProtectionNone or NSFileProtectionComplete ios 5 adds CompleteUntilFirstUserAuthentication and CompleteUnlessOpen (uses DJB s curve25519)! * Pre-iOS 4 encryption was used to wipe data

ios 7? No visible changes to file encryption (i.e. existing tools work and don t screw things up) Keychain record format has changed ASN.1 BER encoding instead of proprietary Binary Property List encoding Keychain encryption has not changed: AES-GCM with per-record key

ASN.1? Apple switching from something proprietary to something standard? Why? ASN.1 BER is sequential: no need to read TOC from the end of the stream first ASN.1 BER is more compact ASN.1 is cross-platform: will we see Keychain on other platforms?

icloud Keychain Image: Apple Inc.

http://support.apple.com/kb/ht4865 Motivation

Motivation http://support.apple.com/kb/ht4865

icloud

The Big Picture Keychain (encrypted) Keybag (encrypted) HTTPS! *.keyvalueservice.icloud.com NO PINNING Some Secret *.escrowproxy.icloud.com

Setup Options

4-digit icsc [Default] icloud Security Code 1234 PBKDF2 SHA-256 x 10 000 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 AES-CBC 256 bit *.escrowproxy.icloud.com AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com Keychain Passwords yma9ohcj tzzcvhe7 sdvocnb

Key-Value Store Not new Used extensively by many apps e.g. to keep preferences in sync across devices icloud Keychain utilises two stores: com.apple.security.cloudkeychainproxy3 com.apple.sbd3 (securebackupd3)

Key-Value Store Key Description com.apple.securebackup.enabled Is Keychain data saved in KVS? com.apple.securebackup.record Keychain records, encrypted SecureBackupMetadata icsc complexity, timestamp, country BackupKeybag Keybag protecting Keychain records BackupUsesEscrow Is keybag password escrowed? BackupVersion Version, currently @ 1 BackupUUID UUID of the backup

Escrow Proxy Designed to store precious secrets Access to service requires auth token Access to escrowed data requires icsc Need to receive SMS challenge Must successfully complete SRP auth User-Agent: com.apple.lakitu (ios/os X) Image: mariowiki.com

Secure Remote Password Zero-knowledge password proof scheme Combats sniffing/mitm One password guess per connection attempt Password verifier is not sufficient for impersonation Escrow Proxy uses SRP-6a

Agreed-upon parameters:! H one-way hash function N, g group parameters k H(N, g) Password verifier:! SALT random x H(SALT,Password) v g^x a random, A g^a Key Negotiation ID, A SALT, B b random, B kv + g^b u H(A, B) u H(A, B) x H(SALT, Password) S (B - kg^x) ^ (a + ux) K H(S) S (Av^u) ^ b K H(S) Key Verification M H(H(N) H(g), H(ID), SALT, A, B, K) M (Aborts if M is invalid) H(A, M, K)

Agreed-upon parameters:! H SHA-256 N, g RFC 5054 w. 2048-bit group k H(N, g) Password verifier:! SALT random x H(SALT,Password) v g^x a random, A g^a Key Negotiation ID, A, SMS CODE SALT, B b random, B kv + g^b u H(A, B) u H(A, B) x H(SALT, Password) S (B - kg^x) ^ (a + ux) K H(S) S (Av^u) ^ b K H(S) Key Verification M H(H(N) H(g), H(ID), SALT, A, B, K) M, SMS CODE (Aborts if M is invalid) H(A, M, K)

Escrowed Data Recovery /get_records List of escrowed records /get_sms_targets List of phone numbers* /generate_sms_challenge OK /srp_init [DsID, A, SMS CODE] [UUID, DsID, SALT, B] /recover [UUID, DsID, M, SMS CODE] [IV, AES-CBC(KSRP, Escrowed Record)] *Display purposes only

Escrow Proxy Endpoints Endpoint Description get_club_cert [?] Obtain certificate enroll Submit escrow record get_records List escrowed records get_sms_targets List SMS numbers for escrowed records generate_sms_challenge Generate and send challenge code srp_init First step of SRP protocol recover Second step of SRP protocol alter_sms_target Change SMS number

Escrow Record icloud Security Code 1234 PBKDF2 SHA-256 x 10 000 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 AES-CBC 256 bit *.escrowproxy.icloud.com AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com Keychain Passwords yma9ohcj tzzcvhe7 sdvocnb

Escrow Record icloud Security Code 1234 PBKDF2 SHA-256 x 10 000 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 AES-CBC 256 bit *.escrowproxy.icloud.com Key PBKDF2-SHA256(iCSC, 10 000) EscrowRecord AES-CBC(Key, RandomPassword)

Escrow Record Key PBKDF2-SHA256(iCSC, 10 000) EscrowRecord AES-CBC(Key, RandomPassword) This is stored by Apple icsc is 4 digits by default Can you spot the problem yet?

Escrow Record Key PBKDF2-SHA256(iCSC, 10 000) Offline icsc guessing is possible Almost instant recovery [for default settings] icsc decrypts keybag password Keybag password unlocks keybag keys Keybag keys decrypt Keychain items

Apple, or other adversary with similar access level, can near-instantly decrypt master password and read synced icloud Keychain records (for default settings)!

Setup Options

Complex icsc icloud Security Code correct horse battery staple PBKDF2 SHA-256 x 10 000 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 AES-CBC 256 bit *.escrowproxy.icloud.com AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com Keychain Passwords yma9ohcj tzzcvhe7 sdvocnb

Complex icsc Mechanics are the same as with simple icsc Offline password recovery attack is still possible, although pointless if password is complex enough

Setup Options

Random icsc icloud Security Code correct horse battery staple PBKDF2 SHA-256 x 10 000 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 AES-CBC 256 bit *.escrowproxy.icloud.com AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com Keychain Passwords yma9ohcj tzzcvhe7 sdvocnb

Random icsc Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com Keychain Passwords yma9ohcj tzzcvhe7 sdvocnb

Random icsc Escrow Proxy is not used Random icsc (or derived key) stored on the device [haven t verified]

Setup Options

No icsc Work in Progress

Conclusions Image: Apple Inc.

Conclusions Trust your vendor but verify his claims Never ever use simple icloud Security Code Do not think that SMS Apple sends you is a 2FA Yet, ick is reasonably well engineered although not without shortcomings

Thank You! Questions are welcome :-)! @abelenko ABelenko@viaforenscs.com!!