I have the class :
public class Data{
private int time;
private double avgVelocity;
private double avgAcceleration;
private double avgRhythm;
private int ups;
private int [] pressures;
private double [] velocities;
private double [] accelerations;
public Data(int tm, double vel, double acc, double rtm, int up,
int [] press, double [] vels, double [] accs){
time = tm;
avgVelocity = vel;
avgAcceleration = acc;
avgRhythm = rtm;
ups = up;
pressures = press;
velocities = vels;
accelerations = accs;
}
public double getTime(){
return time;
}
...
}
That class stores data from a device. This data should be stored in an XML file to be attached later on another file.
What I must have is to have the XML with stored data unreadable even if the attachment is visible. So should I Encrypt all the content of the variables and then store all the unreadable values on the xml? Or should I store all the values in the XML and then encrypt the whole file? or is there a better way to achieve this? (the serialization of the data in the xml is not a problem, I already did this, but whitout encrypting it)
I can't find any solution that fits my needs.
EDIT: according to the advices to encrypt the XML intead of the sigle data fields, what shoul be a good method to do this?