Custom String Encryption
You can configure PreEmptive Protection™ DashO™ for Android & Java to use your own encryption algorithms to deal with the strings found during the String Encryption phase. The implementation can be as simple or complex as you desire. Please keep in mind however, that a long running decryption method will ultimately slow down your application.
There are two parts to this process: Encryption and Decryption. The encryption method is used when DashO processes the project. The encryption class and method need to be packaged in a separate jar and configured to be used by the project. The decryption method is packaged with the application. The decryption class and method need to be part of the inputs of the project and be configured to be used by the project.
Encryption
The encryption algorithm must be in a public static method that takes a single string, the plaintext, as an argument and returns an array of two non-null strings, the key and the ciphertext.
public static String[] encrypt (String plainText) {
String key = {however you want to determine it};
String cipherText = {however you want to create it};
return new String[]{key,cipherText};//The order is important!
}
Decryption
The decryption algorithm must be in a public static method that takes two strings, the key and ciphertext, as arguments and returns a single non-null string, the plaintext. It must be able to properly decrypt the ciphertext created by the encryption method.
public static String decrypt (String key, String cipherText) {
String plainText = {however you want to determine it};
return plainText;
}
Note:
The decryption class can still be renamed, and obfuscated, but it will be excluded from Custom String Encryption. If your decryption class uses other classes in your input, you may need to manually exclude them from String Encryption to avoid an infinite recursive call at runtime.
Inclusions
You can use the Custom Encryption - Include page of the DashO GUI to control which parts of your application will be protected with Custom String Encryption. You can define rules to select methods, classes, and/or packages for this purpose. Classes and methods that are excluded from String Encryption will not be protected with Custom String Encryption. Note that if nothing is explicitly included on this page then Custom String Encryption will not actually be used.