iOS Security
Bruno Rocha
iOS Developer @ Movile
🙂
😡 😡 😡 😡 😡
Bad people
Crypto keys in
NSUserDefaults/Keychain
Secret API Keys in the
Info.plist or hardcoded
CoreData/SQLite with
sensitive data
var isSubscribed: Bool
NSUserDefaults - Documents folder, not encrypted
CoreData - Documents folder, not encrypted
Info.plist - Exposed in your .ipa/.app
Keychain - Encrypted, but exploitable
NSKeyedArchiver - A plist in hex format
var isSubscribed: Bool {
let subscription = getSubscription()
return subscription.isExpired == false
}
var swizzled__isSubscribed: Bool {
return true
}
Demo 1: Insecure Data Storages
Protecting apps from Storage Attacks
• Encrypt/Encode data before saving/
hardcoding (Careful! This will not
prevent attacks, only slow them down.)
• Treat critical data (like secret API keys)
server-side if possible
• Open Source “String obfuscation" libs:
Hackers have Google too.
Demo 2: Runtime Manipulation
Protecting apps from Runtime Manipulation
Important logic should be treated/
checked server-side! (eg: API Tokens)
Protecting apps from Runtime Manipulation
Protecting apps from Runtime Manipulation
What about the real world?

iOS Security