IQryptParseObject is derived from ParseObject so it has same properties and methods and transparently encrypts the fields values that were set via IQryptConfigurator.encryptField(...) method. Example:

IQryptParseConfigurator.encryptField("Armor", "myIntField", EncryptionType.OPE, int.class);
IQryptParseConfigurator.encryptField("Armor", "myStringField", EncryptionType.DET, String.class);

//create new object of Class named Armor
IQryptParseObject obj = new IQryptParseObject("Armor");
obj.put("myIntField",30); // 30 value is encrypted with OPE encryption scheme automatically
obj.put("myStringField", "Sensitive_Info"); // the string is encrypted with DET encryption scheme automatically

IQryptParseObject let you mix encrypted fields and non-encrypted fields, so you can encrypt only desired fields. For example the following field value will not be encrypted because it was not set to be encrypted via IQryptParseConfigurator.encryptField(...) method:

obj.put("myPlainTextField", "non_sensitive_info");

Data Types

At this moment there are 3 types of encryption schemes that you can set to encrypt field values. Each encryption scheme allows different data types to be stored.

  • OPE - order preserving encryption - allows you to store following field types: int, float, java.util.Date

  • DET - deterministic encryption - allows you to store any type that can be serialized to JSON, ex: all primitive types(int, float, etc), java.util.Date, Map, ArrayList,etc and POJO/complex types.

  • RND - randomized encryption - allows you to store any type that can be serialized to JSON,ex: all primitive types(int, float, etc), java.util.Date, Map, ArrayList,etc and POJO/complex types.

Example:

public class SensitiveData
{
    public String CreditCard;
    public String HealthRelatedInfo;
}
................

IQryptParseConfigurator.encryptField("Armor", "myIntField", EncryptionType.OPE, int.class);
IQryptParseConfigurator.encryptField("Armor", "myStringField", EncryptionType.DET, String.class);
IQryptParseConfigurator.encryptField("Armor", "myPOJO", EncryptionType.RND, SensitiveData.class);

//create new object of Class named Armor
IQryptParseObject obj = new IQryptParseObject("Armor");
obj.put("myIntField",30); // 30 value is encrypted with OPE encryption scheme automatically
obj.put("myStringField", "Sensitive_Info"); // the string is encrypted with DET encryption scheme automatically
obj.put("myPOJO", new SensitiveData()); // the SensitiveData object will be serialized to JSON and then encrypted

Inside Parse, all encrypted fields are stored in a String field type. You can see encrypted values via Parse Data Browser.