Is it possible for base 64 string generated and serialized to file on a windows machine to be deserialized in another base 64 string on a linux machine that is not equal to the string on windows. Implementation is in java using platform encodings. All other non base 64 strings came out fine.
DynamicObject do = new DynamicObject();
do.setBase64Property("MxSgTy==");
NonDynamicProperty ndp = new NonDynamicProperty();
ndp.setString("SimpleString");
Open a object output stream
ObjectOutputStream oo = new ObjectOutputStream(new FileOutputStream("file.ser"));
oo.writeObject(do);
oo.writeObject(ndp);
// close
On the server side (the linux platform)
ObjectInputStream oi = new ObjectInputStream(new FileInputStream("file.ser"));
Object obj = oi.readObject();
if(obj instanceof NonDynamicProperty){
NonDynamicProperty ndp = (NonDynamicProperty)obj;
ndp.getString();// outputs SimpleString
}else{
DynamicObject do = (DynamicObject)obj;
do.getBase64Property(); // yields uUsYjdh== for example
}
The base64 string is actually the outcome of encoding an encrypted version of a string property. The code that does this is pretty old a real buggy, but I am challenged with figuring out how deep this bug is. Knowing whether it is possible for any reason to have this string values transformed will greatly aid my understanding and put me a step closer to solving the problem.