Search code examples
iphoneiosencryptionsalt-cryptography

iOS App for emergency response - how to secure the data without a password?


I have a unique use case here: I need to enhance a stand-alone iPhone app "EmergencyResponse" (name changed for this post) that is used by at-risk patients. Patients/Caregivers setup the app with information about their medications, physician contact info, family contact, info etc.

The app puts up a message on the iPhone lock screen with "Unlock phone and open 'EmergencyResponse' which will guide you on how to assist me"

So if the patient passes out somewhere and a good samaritan comes by, they see the message and proceed to open the app on the phone. Once the app is open - the good samaritan can then see a message "Hi my name is John Smith. If I am in trouble call my wife Jill Smith at 123-456-7890 (Cell)... etc" The good samaritan also gets to see the patients medical condition details, medications being taken etc (all things that would aid the emergency response folks)

The company that's sponsored the app wants to make sure I use encryption without compromising the usage (i.e. users cannot be asked for a password). I was thinking of storing an encryption key within the code. The data elements stored in core data fields could be encrypted with the key and unencrypted when the database needs to be accessed. There's just a limited amount of data and nothing to query so after un-encrypting the data I could keep everything in the Model objects.

Before I roll up my sleeves and begin, I was hoping to get some sound advise on whether this will work, whether it is the best option or if there is something else that will work better (I've heard of SALT lists - but never used those)! Look forward to your responses!


Solution

  • Two thoughts:

    1) just store all the data in a dictionary in the KeyChain - I'm not sure what a reasonable limit is, but I imagine a few thousand bytes isn't going to be a problem.

    2) You could create a encryption key at launch, random and salted etc, then store it in the keychain.

    However, what I don't understand is why you want to encrypt at all. If this person looses the phone, the data can be read off the screen, no? So you just want to protect the data in the file system, but its OK for a random person to read it off the screen?