How to react with iOS Data Protection if a user disables their passcode? -
i have ios 9 app , have directory of sensitive files in trying protect (they proprietary video files). need able protect these files malicious user has jailbroken device , trying read file. ideally, use data protection encrypt file so:
nserror *protectionerror; nsdictionary *protection = @{ nsfileprotectionkey : nsfileprotectioncompleteunlessopen }; bool result = [[nsfilemanager defaultmanager] setattributes:protection ofitematpath:contentdirectory error:&protectionerror];
however, looks jailbroken user have gain access file remove passcode on device, renders data protection useless. there way mark file needing deleted os in case passcode removed? think similar how iphone , apple watch delete apple pay cards when passcode removed device.
i posting answer now..
why not encrypt these files on own using a key , aes256 encryption.
you don't have hardcode key in code, neither have store in sandbox. can generate using method describe in question asked.
random 256bit key using secrandomcopybytes( ) in ios use ios keychain store key.
if worried key can obtained keychain (which highly secure way), best bet decrypt files using password key user have enter , keep video in memory. never store password anywhere, when user wants see video, have enter in order decrypt it.
Comments
Post a Comment