We are developing an iOS app that allows users to store/modify Protected Health Information (PHI) and the app needs to allow users to do so without an internet connection for large parts of the process. We will need to encrypt the data but are having a difficult time coming up with a solution on how to properly do so as we don't want to store the key in the code and the data would still need to be able to be accessed without a connection to a server.
Our working idea is to encrypt the data using the user's password (which would not be stored on the device) but we run into an issue where other users may need to modify/access that data on that device via their own login. (In the event one iPad breaks)
The ideas we've tried to work through but don't seem secure are:
- Storing a static key in code
- Storing a dynamic key given by the server in a local sql database
- Storing the dynamic key given by the server in the iOS keychain
We were considering having both users login upon data retrieval and encrypting it with both passwords but we run into user-related issues where the data could be locked if one user isn't on duty or not nearby.
Question: How can we properly protect PHI on iOS so that it can still be accessed by those who are allowed to access it, potentially offline, and doesn't restrict the data to being viewable by only one person - preferably without storing logins (as we don't want user credentials stored)
Follow-up: If this isn't something feasible, what would be the best course of action to take to meet most of the needs above?
Edit:Clarification
Authentication takes place originally when pulling down/submitting data and we need to encrypt the data that's pulled down while keeping it accessible to previously authenticated users without storing the key.