SlideShare a Scribd company logo
1 of 61
Download to read offline
iCloud Keychain 
and 
iOS 7 Data Protection 
Andrey Belenko 
Sr. Security Engineer @ viaForensics 
! 
Alexey Troshichev 
@hackappcom founder
What is iCloud?
Whatโ€™s inside? 
โ€ข Documents 
โ€ข Photos 
โ€ข Backups (SMS, application data, etc) 
โ€ข Keychain
Hackerโ€™s view
Bruteforce protection?
Bruteforce protection?
Bruteforce protection?
Find My iPhone
Brought to you by 
hackapp.com 
! 
github.com/hackappcom/ibrute 
@hackappcom
iCloud Keychain 
Image: Apple Inc.
Motivation 
http://support.apple.com/kb/HT4865
Intercepting SSL 
SSL Proxy 
(Burp, Charles, โ€ฆ) 
Root CA cert 
Proxy settings
Authentication 
GET /authenticate 
AppleID, Password 
DsID, mmeAuthToken, fmipAuthToken 
icloud.com
/getAccountSettings
/getAccountSettings
Setup Options
The Big Picture 
*.keyvalueservice.icloud.com 
*.escrowproxy.icloud.com 
Keychain items (encrypted) 
Keybag (encrypted) 
Some Secret
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 
โ€ข Syncing between devices 
โ€ข com.apple.sbd3 (securebackupd3) 
โ€ข Copy to restore if no other devices
Escrow Proxy 
โ€ข New; Designed to store precious secrets 
โ€ข Need to know iCSC to recover escrowed data 
โ€ข Need to receive SMS challenge 
โ€ข Must successfully complete SRP auth 
โ€ข User-Agent: com.apple.lakitu (iOS/OS X) 
Image: mariowiki.com
Key-Value Store 
com.apple.security.cloudkeychainproxy3 
S(usrPwd, D2_pub) 
S(D2_priv, (D1_pub, D2_pub)) 
S(D1_priv, D1_pub) 
S(userPwd, D1_pub) 
S(D1_priv, (D1_pub, D2_pub)) 
S(userPwd, (D1_pub, D2_pub))
Key-Value Store 
com.apple.sbd3 
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
4-digit iCSC [Default]
4-digit iCSC [Default] 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
4-digit iCSC [Default] 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit
4-digit iCSC [Default] 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit 
AES-Wrap Keys 
RFC 3394
4-digit iCSC [Default] 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit 
AES-Wrap Keys 
RFC 3394 
*.keyvalueservice.icloud.com
4-digit iCSC [Default] 
iCloud Security Code 
1234 PBKDF2 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
SHA-256 x 10โ€™000 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit 
AES-Wrap Keys 
RFC 3394 
*.keyvalueservice.icloud.com
4-digit iCSC [Default] 
iCloud Security Code 
1234 PBKDF2 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
SHA-256 x 10โ€™000 
AES-CBC 
256 bit 
*.escrowproxy.icloud.com 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit 
AES-Wrap Keys 
RFC 3394 
*.keyvalueservice.icloud.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
Key Negotiation 
a โ† random, A โ† g^a 
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) 
(Aborts if M is invalid) 
ID, A 
SALT, B 
M 
H(A, M, K) 
Password verifier: 
! 
SALT โ† random 
x โ† H(SALT,Password) 
v โ† g^x 
Agreed-upon parameters: 
! 
H โ€“ one-way hash function 
N, g โ€“ group parameters 
k โ† H(N, g)
Key Negotiation 
a โ† random, A โ† g^a 
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) 
(Aborts if M is invalid) 
ID, A, SMS CODE 
SALT, B 
M, SMS CODE 
H(A, M, K) 
Password verifier: 
! 
SALT โ† random 
x โ† H(SALT,Password) 
v โ† g^x 
Agreed-upon parameters: 
! 
H โ€“ SHA-256 
N, g โ€“ RFC 5054 w. 2048-bit group 
k โ† H(N, g)
Escrowed Data Recovery 
*Display purposes only
Escrowed Data Recovery 
/get_records 
List of escrowed records 
*Display purposes only
Escrowed Data Recovery 
/get_records 
List of escrowed records 
/get_sms_targets 
List of phone numbers* 
*Display purposes only
Escrowed Data Recovery 
/get_records 
List of escrowed records 
/get_sms_targets 
List of phone numbers* 
/generate_sms_challenge 
OK 
*Display purposes only
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] 
*Display purposes only
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 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
SHA-256 x 10โ€™000 
AES-CBC 
256 bit 
*.escrowproxy.icloud.com 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
AES-Wrap Keys 
RFC 3394 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit 
*.keyvalueservice.icloud.com
Escrow Record 
iCloud Security Code 
1234 PBKDF2 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
SHA-256 x 10โ€™000 
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)
Escrow Record 
Key โ† PBKDF2-SHA256(iCSC, 10โ€™000) 
EscrowRecord โ† AES-CBC(Key, RandomPassword) 
โ€ข This is stored by Apple
Escrow Record 
Key โ† PBKDF2-SHA256(iCSC, 10โ€™000) 
EscrowRecord โ† AES-CBC(Key, RandomPassword) 
โ€ข This is stored by Apple 
โ€ข iCSC is 4 digits by default
Escrow Record 
Key โ† PBKDF2-SHA256(iCSC, 10โ€™000) 
EscrowRecord โ† AES-CBC(Key, RandomPassword) 
โ€ข This is stored by Apple 
โ€ข iCSC is 4 digits by default
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 
access to stored data, can near-instantly 
decrypt โ€œmasterโ€ 
password and read synced iCloud 
Keychain records 
! 
(for default settings)
Setup Options
Complex iCSC 
correct horse battery staple PBKDF2 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
iCloud Security Code 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
SHA-256 x 10โ€™000 
AES-CBC 
256 bit 
Backup Keybag 
Key 1 
Key 2 
Key 3 
*.escrowproxy.icloud.com 
AES-Wrap Keys 
RFC 3394 
AES-GCM 
256 bit 
*.keyvalueservice.icloud.com
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 Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
AES-Wrap Keys 
RFC 3394 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit 
*.keyvalueservice.icloud.com 
iCloud Security Code 
correct horse battery staple PBKDF2 
SHA-256 x 10โ€™000 
AES-CBC 
256 bit 
*.escrowproxy.icloud.com 
Random iCSC
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
AES-Wrap Keys 
RFC 3394 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit 
*.keyvalueservice.icloud.com 
iCloud Security Code 
correct horse battery staple PBKDF2 
SHA-256 x 10โ€™000 
AES-CBC 
256 bit 
*.escrowproxy.icloud.com 
Random iCSC
Random iCSC 
Random Password 
BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 
Keychain Passwords 
yMa9ohCJ 
tzzcVhE7 
sDVoCnb 
AES-Wrap Keys 
RFC 3394 
Backup Keybag 
Key 1 
Key 2 
Key 3 
AES-GCM 
256 bit 
*.keyvalueservice.icloud.com
Random iCSC 
โ€ข Escrow Proxy is not used 
โ€ข Random iCSC (or derived key) stored on the device 
[havenโ€™t verified]
Setup Options 
iCloud 
Keychain 
Keychain 
Sync 
Keychain 
Backup 
Master 
Password 
Escrow 
No iCloud Security Code 
Random iCloud Security Code 
Complex iCloud Security Code 
Simple iCloud Security Code
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 @hackappcom

More Related Content

What's hot

Adventures in Femtoland: 350 Yuan for Invaluable Fun
Adventures in Femtoland: 350 Yuan for Invaluable FunAdventures in Femtoland: 350 Yuan for Invaluable Fun
Adventures in Femtoland: 350 Yuan for Invaluable Fun
arbitrarycode
ย 
ใชใœOpenID ConnectใŒๅฟ…่ฆใจใชใฃใŸใฎใ‹ใ€ใใฎๆญดๅฒ็š„่ƒŒๆ™ฏ
ใชใœOpenID ConnectใŒๅฟ…่ฆใจใชใฃใŸใฎใ‹ใ€ใใฎๆญดๅฒ็š„่ƒŒๆ™ฏใชใœOpenID ConnectใŒๅฟ…่ฆใจใชใฃใŸใฎใ‹ใ€ใใฎๆญดๅฒ็š„่ƒŒๆ™ฏ
ใชใœOpenID ConnectใŒๅฟ…่ฆใจใชใฃใŸใฎใ‹ใ€ใใฎๆญดๅฒ็š„่ƒŒๆ™ฏ
Tatsuo Kudo
ย 

What's hot (20)

ใ‚จใƒณใ‚ฟใƒผใƒ—ใƒฉใ‚คใ‚บIT็’ฐๅขƒใงใฎ OpenID Connect / SCIM ใฎๅ…ทไฝ“็š„ๅฎŸ่ฃ…ๆ–นๆณ• idit2014
ใ‚จใƒณใ‚ฟใƒผใƒ—ใƒฉใ‚คใ‚บIT็’ฐๅขƒใงใฎ OpenID Connect / SCIM ใฎๅ…ทไฝ“็š„ๅฎŸ่ฃ…ๆ–นๆณ• idit2014ใ‚จใƒณใ‚ฟใƒผใƒ—ใƒฉใ‚คใ‚บIT็’ฐๅขƒใงใฎ OpenID Connect / SCIM ใฎๅ…ทไฝ“็š„ๅฎŸ่ฃ…ๆ–นๆณ• idit2014
ใ‚จใƒณใ‚ฟใƒผใƒ—ใƒฉใ‚คใ‚บIT็’ฐๅขƒใงใฎ OpenID Connect / SCIM ใฎๅ…ทไฝ“็š„ๅฎŸ่ฃ…ๆ–นๆณ• idit2014
ย 
One Key to Rule Them All: Detecting the Skeleton Key Malware
One Key to Rule Them All: Detecting the Skeleton Key MalwareOne Key to Rule Them All: Detecting the Skeleton Key Malware
One Key to Rule Them All: Detecting the Skeleton Key Malware
ย 
้˜ฒๆฏ’ๆ“‹ไธไฝ๏ผŸๅ‹’็ดข็—…ๆฏ’็Œ–็—่ˆ‡ๅฏฆไฝœ
้˜ฒๆฏ’ๆ“‹ไธไฝ๏ผŸๅ‹’็ดข็—…ๆฏ’็Œ–็—่ˆ‡ๅฏฆไฝœ้˜ฒๆฏ’ๆ“‹ไธไฝ๏ผŸๅ‹’็ดข็—…ๆฏ’็Œ–็—่ˆ‡ๅฏฆไฝœ
้˜ฒๆฏ’ๆ“‹ไธไฝ๏ผŸๅ‹’็ดข็—…ๆฏ’็Œ–็—่ˆ‡ๅฏฆไฝœ
ย 
Modern Authentication -- FIDO2 Web Authentication (WebAuthn) ใ‚’ๅญฆใตใ‚™ --
Modern Authentication -- FIDO2 Web Authentication (WebAuthn) ใ‚’ๅญฆใตใ‚™ --Modern Authentication -- FIDO2 Web Authentication (WebAuthn) ใ‚’ๅญฆใตใ‚™ --
Modern Authentication -- FIDO2 Web Authentication (WebAuthn) ใ‚’ๅญฆใตใ‚™ --
ย 
Active Directory ไพตๅฎณใจๆŽจๅฅจๅฏพ็ญ–
Active Directory ไพตๅฎณใจๆŽจๅฅจๅฏพ็ญ–Active Directory ไพตๅฎณใจๆŽจๅฅจๅฏพ็ญ–
Active Directory ไพตๅฎณใจๆŽจๅฅจๅฏพ็ญ–
ย 
OpenID Connect ใฎใƒ“ใ‚ธใƒใ‚นใƒใƒฃใƒณใ‚น
OpenID Connect ใฎใƒ“ใ‚ธใƒใ‚นใƒใƒฃใƒณใ‚นOpenID Connect ใฎใƒ“ใ‚ธใƒใ‚นใƒใƒฃใƒณใ‚น
OpenID Connect ใฎใƒ“ใ‚ธใƒใ‚นใƒใƒฃใƒณใ‚น
ย 
Adventures in Femtoland: 350 Yuan for Invaluable Fun
Adventures in Femtoland: 350 Yuan for Invaluable FunAdventures in Femtoland: 350 Yuan for Invaluable Fun
Adventures in Femtoland: 350 Yuan for Invaluable Fun
ย 
Wireless security using wpa2
Wireless security using wpa2Wireless security using wpa2
Wireless security using wpa2
ย 
ไป–็คพ่ฃฝๅ“ใจๆฏ”่ผƒใ—ใŸ้š›ใฎAuth0ใฎใ„ใ„ใจใ“ใ‚
ไป–็คพ่ฃฝๅ“ใจๆฏ”่ผƒใ—ใŸ้š›ใฎAuth0ใฎใ„ใ„ใจใ“ใ‚ไป–็คพ่ฃฝๅ“ใจๆฏ”่ผƒใ—ใŸ้š›ใฎAuth0ใฎใ„ใ„ใจใ“ใ‚
ไป–็คพ่ฃฝๅ“ใจๆฏ”่ผƒใ—ใŸ้š›ใฎAuth0ใฎใ„ใ„ใจใ“ใ‚
ย 
Protecting your phone verification flow from fraud & abuse
Protecting your phone verification flow from fraud & abuseProtecting your phone verification flow from fraud & abuse
Protecting your phone verification flow from fraud & abuse
ย 
#idcon vol.29 - #fidcon WebAuthn, Next Stage
#idcon vol.29 - #fidcon WebAuthn, Next Stage#idcon vol.29 - #fidcon WebAuthn, Next Stage
#idcon vol.29 - #fidcon WebAuthn, Next Stage
ย 
HSM่ถ…ๅ…ฅ้–€่ฌ›ๅบง
HSM่ถ…ๅ…ฅ้–€่ฌ›ๅบงHSM่ถ…ๅ…ฅ้–€่ฌ›ๅบง
HSM่ถ…ๅ…ฅ้–€่ฌ›ๅบง
ย 
Azure AD ใซใ‚ˆใ‚‹ Web API ใฎ ไฟ่ญท
Azure AD ใซใ‚ˆใ‚‹ Web API ใฎ ไฟ่ญท Azure AD ใซใ‚ˆใ‚‹ Web API ใฎ ไฟ่ญท
Azure AD ใซใ‚ˆใ‚‹ Web API ใฎ ไฟ่ญท
ย 
FIDO Alliance: Welcome and FIDO Update.pptx
FIDO Alliance: Welcome and FIDO Update.pptxFIDO Alliance: Welcome and FIDO Update.pptx
FIDO Alliance: Welcome and FIDO Update.pptx
ย 
OWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling PicklesOWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling Pickles
ย 
OWASP API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World
ย 
JSON Web Token
JSON Web TokenJSON Web Token
JSON Web Token
ย 
FIDO2 ๏ฝž ใƒ‘ใ‚นใƒฏใƒผใƒ‰ใฎใ„ใ‚‰ใชใ„ไธ–็•Œใธ
FIDO2 ๏ฝž ใƒ‘ใ‚นใƒฏใƒผใƒ‰ใฎใ„ใ‚‰ใชใ„ไธ–็•ŒใธFIDO2 ๏ฝž ใƒ‘ใ‚นใƒฏใƒผใƒ‰ใฎใ„ใ‚‰ใชใ„ไธ–็•Œใธ
FIDO2 ๏ฝž ใƒ‘ใ‚นใƒฏใƒผใƒ‰ใฎใ„ใ‚‰ใชใ„ไธ–็•Œใธ
ย 
ใชใœOpenID ConnectใŒๅฟ…่ฆใจใชใฃใŸใฎใ‹ใ€ใใฎๆญดๅฒ็š„่ƒŒๆ™ฏ
ใชใœOpenID ConnectใŒๅฟ…่ฆใจใชใฃใŸใฎใ‹ใ€ใใฎๆญดๅฒ็š„่ƒŒๆ™ฏใชใœOpenID ConnectใŒๅฟ…่ฆใจใชใฃใŸใฎใ‹ใ€ใใฎๆญดๅฒ็š„่ƒŒๆ™ฏ
ใชใœOpenID ConnectใŒๅฟ…่ฆใจใชใฃใŸใฎใ‹ใ€ใใฎๆญดๅฒ็š„่ƒŒๆ™ฏ
ย 
React(TypeScript) + Go + Auth0 ใงๅฎŸ็พใ™ใ‚‹็ฎก็†็”ป้ข
React(TypeScript) + Go + Auth0 ใงๅฎŸ็พใ™ใ‚‹็ฎก็†็”ป้ขReact(TypeScript) + Go + Auth0 ใงๅฎŸ็พใ™ใ‚‹็ฎก็†็”ป้ข
React(TypeScript) + Go + Auth0 ใงๅฎŸ็พใ™ใ‚‹็ฎก็†็”ป้ข
ย 

Viewers also liked

Icloud seminar report
Icloud seminar reportIcloud seminar report
Icloud seminar report
Richa Dewani
ย 
iCloud by Apple
iCloud by AppleiCloud by Apple
iCloud by Apple
Richa Dewani
ย 
iPhone forensics on iOS5
iPhone forensics on iOS5iPhone forensics on iOS5
iPhone forensics on iOS5
Satish b
ย 
soft-computing
 soft-computing soft-computing
soft-computing
student
ย 

Viewers also liked (17)

Icloud seminar report
Icloud seminar reportIcloud seminar report
Icloud seminar report
ย 
iCloud - Apple Technology
iCloud - Apple TechnologyiCloud - Apple Technology
iCloud - Apple Technology
ย 
iCloud by Apple
iCloud by AppleiCloud by Apple
iCloud by Apple
ย 
Applied cryptanalysis - everything else
Applied cryptanalysis - everything elseApplied cryptanalysis - everything else
Applied cryptanalysis - everything else
ย 
How apple can read your i messages
How apple can read your i messagesHow apple can read your i messages
How apple can read your i messages
ย 
SkyDrive vs. SkyDrive Pro - Hans Brender
SkyDrive vs. SkyDrive Pro - Hans Brender SkyDrive vs. SkyDrive Pro - Hans Brender
SkyDrive vs. SkyDrive Pro - Hans Brender
ย 
Icloud
IcloudIcloud
Icloud
ย 
iPhone forensics on iOS5
iPhone forensics on iOS5iPhone forensics on iOS5
iPhone forensics on iOS5
ย 
iCloud
iCloudiCloud
iCloud
ย 
How Android and iOS Security Enhancements Complicate Threat Detection
How Android and iOS Security Enhancements Complicate Threat DetectionHow Android and iOS Security Enhancements Complicate Threat Detection
How Android and iOS Security Enhancements Complicate Threat Detection
ย 
Icloud keynote2
Icloud keynote2Icloud keynote2
Icloud keynote2
ย 
Bio-Molecular Engineering is the Future of Molecular Biology
Bio-Molecular Engineering is the Future of Molecular BiologyBio-Molecular Engineering is the Future of Molecular Biology
Bio-Molecular Engineering is the Future of Molecular Biology
ย 
icloud
icloudicloud
icloud
ย 
Apple iCloud
Apple iCloudApple iCloud
Apple iCloud
ย 
soft-computing
 soft-computing soft-computing
soft-computing
ย 
SkyDrive
SkyDriveSkyDrive
SkyDrive
ย 
Bluejacking
BluejackingBluejacking
Bluejacking
ย 

Similar to iCloud keychain

6.1. iCloud keychain and iOS 7 data protection
6.1. iCloud keychain and iOS 7 data protection6.1. iCloud keychain and iOS 7 data protection
6.1. iCloud keychain and iOS 7 data protection
defconmoscow
ย 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
Erik LaBianca
ย 
Securing the Web without site-specific passwords
Securing the Web without site-specific passwordsSecuring the Web without site-specific passwords
Securing the Web without site-specific passwords
Francois Marier
ย 
12 symmetric key cryptography
12   symmetric key cryptography12   symmetric key cryptography
12 symmetric key cryptography
drewz lin
ย 

Similar to iCloud keychain (20)

Via forensics icloud-keychain_passwords_13
Via forensics icloud-keychain_passwords_13Via forensics icloud-keychain_passwords_13
Via forensics icloud-keychain_passwords_13
ย 
7.3. iCloud keychain-2
7.3. iCloud keychain-27.3. iCloud keychain-2
7.3. iCloud keychain-2
ย 
6.1. iCloud keychain and iOS 7 data protection
6.1. iCloud keychain and iOS 7 data protection6.1. iCloud keychain and iOS 7 data protection
6.1. iCloud keychain and iOS 7 data protection
ย 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
ย 
Protect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada KeystoreProtect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada Keystore
ย 
Dodging WebCrypto API Landmines
Dodging WebCrypto API LandminesDodging WebCrypto API Landmines
Dodging WebCrypto API Landmines
ย 
Adventures in Underland: Is encryption solid as a rock or a handful of dust?
Adventures in Underland: Is encryption solid as a rock or a handful of dust?Adventures in Underland: Is encryption solid as a rock or a handful of dust?
Adventures in Underland: Is encryption solid as a rock or a handful of dust?
ย 
Cryptography for Smalltalkers 2
Cryptography for Smalltalkers 2Cryptography for Smalltalkers 2
Cryptography for Smalltalkers 2
ย 
Encryption Boot Camp at ร˜redev
Encryption Boot Camp at ร˜redevEncryption Boot Camp at ร˜redev
Encryption Boot Camp at ร˜redev
ย 
Cryptography and SSL in Smalltalk - StS 2003
Cryptography and SSL in Smalltalk - StS 2003Cryptography and SSL in Smalltalk - StS 2003
Cryptography and SSL in Smalltalk - StS 2003
ย 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
ย 
Securing the Web without site-specific passwords
Securing the Web without site-specific passwordsSecuring the Web without site-specific passwords
Securing the Web without site-specific passwords
ย 
Security and Encryption on iOS
Security and Encryption on iOSSecurity and Encryption on iOS
Security and Encryption on iOS
ย 
12 symmetric key cryptography
12   symmetric key cryptography12   symmetric key cryptography
12 symmetric key cryptography
ย 
Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developers
ย 
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyPEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot Securely
ย 
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyPEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot Securely
ย 
Hadoop Security Now and Future
Hadoop Security Now and FutureHadoop Security Now and Future
Hadoop Security Now and Future
ย 
Overview and evolution of password-based authentication schemes
Overview and evolution of password-based authentication schemesOverview and evolution of password-based authentication schemes
Overview and evolution of password-based authentication schemes
ย 
Cryptography for Smalltalkers
Cryptography for SmalltalkersCryptography for Smalltalkers
Cryptography for Smalltalkers
ย 

Recently uploaded

Dwarka Sector 26 Call Girls | Delhi | 9999965857 ๐Ÿซฆ Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 ๐Ÿซฆ Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 ๐Ÿซฆ Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 ๐Ÿซฆ Vanshika Verma More Our Se...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
ย 
Call Girls In Model Towh Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
Call Girls In Model Towh Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”Call Girls In Model Towh Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
Call Girls In Model Towh Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
soniya singh
ย 
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
SUHANI PANDEY
ย 
Call Girls In Sukhdev Vihar Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
Call Girls In Sukhdev Vihar Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”Call Girls In Sukhdev Vihar Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
Call Girls In Sukhdev Vihar Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
soniya singh
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
SUHANI PANDEY
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
SUHANI PANDEY
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
SUHANI PANDEY
ย 

Recently uploaded (20)

Dwarka Sector 26 Call Girls | Delhi | 9999965857 ๐Ÿซฆ Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 ๐Ÿซฆ Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 ๐Ÿซฆ Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 ๐Ÿซฆ Vanshika Verma More Our Se...
ย 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
ย 
Call Girls In Model Towh Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
Call Girls In Model Towh Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”Call Girls In Model Towh Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
Call Girls In Model Towh Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
ย 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
ย 
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
ย 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
ย 
Hot Call Girls |Delhi |Hauz Khas โ˜Ž 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas โ˜Ž 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas โ˜Ž 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas โ˜Ž 9711199171 Book Your One night Stand
ย 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
ย 
Enjoy NightโšกCall Girls Dlf City Phase 3 Gurgaon >เผ’8448380779 Escort Service
Enjoy NightโšกCall Girls Dlf City Phase 3 Gurgaon >เผ’8448380779 Escort ServiceEnjoy NightโšกCall Girls Dlf City Phase 3 Gurgaon >เผ’8448380779 Escort Service
Enjoy NightโšกCall Girls Dlf City Phase 3 Gurgaon >เผ’8448380779 Escort Service
ย 
Call Girls In Sukhdev Vihar Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
Call Girls In Sukhdev Vihar Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”Call Girls In Sukhdev Vihar Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
Call Girls In Sukhdev Vihar Delhi ๐Ÿ’ฏCall Us ๐Ÿ”8264348440๐Ÿ”
ย 
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now โ˜Ž 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
ย 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
ย 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
ย 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
ย 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
ย 
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
ย 

iCloud keychain

  • 1. iCloud Keychain and iOS 7 Data Protection Andrey Belenko Sr. Security Engineer @ viaForensics ! Alexey Troshichev @hackappcom founder
  • 3. Whatโ€™s inside? โ€ข Documents โ€ข Photos โ€ข Backups (SMS, application data, etc) โ€ข Keychain
  • 9. Brought to you by hackapp.com ! github.com/hackappcom/ibrute @hackappcom
  • 12. Intercepting SSL SSL Proxy (Burp, Charles, โ€ฆ) Root CA cert Proxy settings
  • 13. Authentication GET /authenticate AppleID, Password DsID, mmeAuthToken, fmipAuthToken icloud.com
  • 16.
  • 17.
  • 19. The Big Picture *.keyvalueservice.icloud.com *.escrowproxy.icloud.com Keychain items (encrypted) Keybag (encrypted) Some Secret
  • 20. 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 โ€ข Syncing between devices โ€ข com.apple.sbd3 (securebackupd3) โ€ข Copy to restore if no other devices
  • 21. Escrow Proxy โ€ข New; Designed to store precious secrets โ€ข Need to know iCSC to recover escrowed data โ€ข Need to receive SMS challenge โ€ข Must successfully complete SRP auth โ€ข User-Agent: com.apple.lakitu (iOS/OS X) Image: mariowiki.com
  • 22. Key-Value Store com.apple.security.cloudkeychainproxy3 S(usrPwd, D2_pub) S(D2_priv, (D1_pub, D2_pub)) S(D1_priv, D1_pub) S(userPwd, D1_pub) S(D1_priv, (D1_pub, D2_pub)) S(userPwd, (D1_pub, D2_pub))
  • 23. Key-Value Store com.apple.sbd3 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
  • 25. 4-digit iCSC [Default] Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4
  • 26. 4-digit iCSC [Default] Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit
  • 27. 4-digit iCSC [Default] Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit AES-Wrap Keys RFC 3394
  • 28. 4-digit iCSC [Default] Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit AES-Wrap Keys RFC 3394 *.keyvalueservice.icloud.com
  • 29. 4-digit iCSC [Default] iCloud Security Code 1234 PBKDF2 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 SHA-256 x 10โ€™000 Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit AES-Wrap Keys RFC 3394 *.keyvalueservice.icloud.com
  • 30. 4-digit iCSC [Default] iCloud Security Code 1234 PBKDF2 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 SHA-256 x 10โ€™000 AES-CBC 256 bit *.escrowproxy.icloud.com Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit AES-Wrap Keys RFC 3394 *.keyvalueservice.icloud.com
  • 31. 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
  • 32. Key Negotiation a โ† random, A โ† g^a 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) (Aborts if M is invalid) ID, A SALT, B M H(A, M, K) Password verifier: ! SALT โ† random x โ† H(SALT,Password) v โ† g^x Agreed-upon parameters: ! H โ€“ one-way hash function N, g โ€“ group parameters k โ† H(N, g)
  • 33. Key Negotiation a โ† random, A โ† g^a 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) (Aborts if M is invalid) ID, A, SMS CODE SALT, B M, SMS CODE H(A, M, K) Password verifier: ! SALT โ† random x โ† H(SALT,Password) v โ† g^x Agreed-upon parameters: ! H โ€“ SHA-256 N, g โ€“ RFC 5054 w. 2048-bit group k โ† H(N, g)
  • 34. Escrowed Data Recovery *Display purposes only
  • 35. Escrowed Data Recovery /get_records List of escrowed records *Display purposes only
  • 36. Escrowed Data Recovery /get_records List of escrowed records /get_sms_targets List of phone numbers* *Display purposes only
  • 37. Escrowed Data Recovery /get_records List of escrowed records /get_sms_targets List of phone numbers* /generate_sms_challenge OK *Display purposes only
  • 38. 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] *Display purposes only
  • 39. 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
  • 40. 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
  • 41. Escrow Record iCloud Security Code 1234 PBKDF2 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 SHA-256 x 10โ€™000 AES-CBC 256 bit *.escrowproxy.icloud.com Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com
  • 42. Escrow Record iCloud Security Code 1234 PBKDF2 Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 SHA-256 x 10โ€™000 AES-CBC 256 bit *.escrowproxy.icloud.com Key โ† PBKDF2-SHA256(iCSC, 10โ€™000) EscrowRecord โ† AES-CBC(Key, RandomPassword)
  • 43. Escrow Record Key โ† PBKDF2-SHA256(iCSC, 10โ€™000) EscrowRecord โ† AES-CBC(Key, RandomPassword)
  • 44. Escrow Record Key โ† PBKDF2-SHA256(iCSC, 10โ€™000) EscrowRecord โ† AES-CBC(Key, RandomPassword) โ€ข This is stored by Apple
  • 45. Escrow Record Key โ† PBKDF2-SHA256(iCSC, 10โ€™000) EscrowRecord โ† AES-CBC(Key, RandomPassword) โ€ข This is stored by Apple โ€ข iCSC is 4 digits by default
  • 46. Escrow Record Key โ† PBKDF2-SHA256(iCSC, 10โ€™000) EscrowRecord โ† AES-CBC(Key, RandomPassword) โ€ข This is stored by Apple โ€ข iCSC is 4 digits by default
  • 47. 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?
  • 48. 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
  • 49. Apple, or other adversary with access to stored data, can near-instantly decrypt โ€œmasterโ€ password and read synced iCloud Keychain records ! (for default settings)
  • 51. Complex iCSC correct horse battery staple PBKDF2 Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb iCloud Security Code Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 SHA-256 x 10โ€™000 AES-CBC 256 bit Backup Keybag Key 1 Key 2 Key 3 *.escrowproxy.icloud.com AES-Wrap Keys RFC 3394 AES-GCM 256 bit *.keyvalueservice.icloud.com
  • 52. Complex iCSC โ€ข Mechanics are the same as with simple iCSC โ€ข Offline password recovery attack is still possible, although pointless if password is complex enough
  • 54. Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com iCloud Security Code correct horse battery staple PBKDF2 SHA-256 x 10โ€™000 AES-CBC 256 bit *.escrowproxy.icloud.com Random iCSC
  • 55. Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com iCloud Security Code correct horse battery staple PBKDF2 SHA-256 x 10โ€™000 AES-CBC 256 bit *.escrowproxy.icloud.com Random iCSC
  • 56. Random iCSC Random Password BL7Z-EBTJ-UBKD-X7NM-4W6D-J2N4 Keychain Passwords yMa9ohCJ tzzcVhE7 sDVoCnb AES-Wrap Keys RFC 3394 Backup Keybag Key 1 Key 2 Key 3 AES-GCM 256 bit *.keyvalueservice.icloud.com
  • 57. Random iCSC โ€ข Escrow Proxy is not used โ€ข Random iCSC (or derived key) stored on the device [havenโ€™t verified]
  • 58. Setup Options iCloud Keychain Keychain Sync Keychain Backup Master Password Escrow No iCloud Security Code Random iCloud Security Code Complex iCloud Security Code Simple iCloud Security Code
  • 60. 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
  • 61. Thank You! Questions are welcome :-) ! ! @abelenko @hackappcom