I want to encrypt some Core Data columns with the NSValueTransformer class but I’m not quite sure what encryption method to use. Has anyone ever tried to encrypt individual entities while using Core Data and if so, is there any sample code of a working implementation? I would want the encryption to not interfere with any NSPredicates I use later on to get back data from the db
I want to encrypt some Core Data columns with the NSValueTransformer class but I’m
Share
The iPhoneCoreDataRecipes sample code from Apple has an example of using a subclass of
NSValueTransformeralong with a transformable attribute in the model. See the transformable attribute type setting:and the value transformer implementation:
In your case, you would need to provide the encryption and decryption algorithms in the
transformedValueandreverseTransformedValuemethods respectively, along the lines suggest here.