1

Storing sensitive data in keychain is a best practice in iOS. But using a jailbroken device an attacker can dump all the keychain data. (keychain-dumper)

Can anyone help me understand how to protect the data in a keychain, in case of a jailbroken device.

mfaani
  • 33,269
  • 19
  • 164
  • 293
Shree Harsha S
  • 665
  • 7
  • 14
  • 2
    if someone has physical access to the device then you can't protect it, you can only make it a bit harder to get at... – Wain Jan 04 '16 at 10:44
  • Hi, Ya, 100% protection can't be done.. As you mentioned, I would like to know what are the ways to make it harder for attacker – Shree Harsha S Jan 04 '16 at 11:45
  • so you can obfuscate or encrypt the data yourself – Wain Jan 04 '16 at 11:46

2 Answers2

4

It's not possible. If the device is jailbroken all data can be easily accessed.

orkoden
  • 18,946
  • 4
  • 59
  • 50
  • Hi, I'm just wondering like this : Stored data in keychain can be easily viewed using a dumper on a jailbroken device. (Just like storing in a plist or db). So, how is it even different from these ? And also what and all can be done from device side, to make it herder for attacker? – Shree Harsha S Jan 04 '16 at 11:54
  • You can use obfuscation techniques like using hard coded encryption. But that only makes is slightly more difficult for an attacker. – orkoden Jan 04 '16 at 11:59
  • But isn't the data itself beeing encrypted inside the keychain? I do get that you can obtain the dump, but what next? – Ivan Jul 19 '18 at 06:50
  • 2
    @Ivan, you can obtain unencrypted data easily. All the security stems from the fact that each app is signed and has a unique identifier. That way each app can be sandboxed inside keychain. With jailbreak you can write simple command line app signed with special entitlement giving it access to all of the keychain contents through the usual public API. Even without jailbreak a system app can potentially access any app's keychain. The encryption is there only to protect keychain from being accessed outside of iOS. For example, through flash memory dump. – creker Jun 29 '19 at 19:13
0

You can implement your own custom encryption on top of Keychain to enhance security. For example, encrypt passwords with a magic method before storing them in Keychain. (Then try to obfuscate that method to minimize chances of reverse-engineering it.)

Unknown
  • 97
  • 1
  • 2
  • 8