Raw file error

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
mrm83
Posts: 19
Joined: Tue Jan 26, 2016 6:20 pm

Raw file error

Post by mrm83 »

Hi

I have data currently stored to "data.es" with encrypt true, password "123".
I upload this data to PHP, and then load it back.
The byte data comes back, and I save the raw data to "data2.es" with encrypt true, password "321"

However, the data2.es fails to load now.. why?
If I resave the byte data with password "123", it works. But it doesn't work when the password differs from original.

Isn't the byte data suppose to be raw and unencrptyed by the password?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Raw file error

Post by Joel »

Hi there,

Please could you show me the code you're using? I've had no other reported issues like this, and it's not possible to determine what's happening from what you've said.

Just to clarify, are you using the ES2.SaveRaw method to save the raw data back to a file? These methods do not apply encryption, even if it's enabled.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
mrm83
Posts: 19
Joined: Tue Jan 26, 2016 6:20 pm

Re: Raw file error

Post by mrm83 »

I have multiple tags within the same file.

Do each of the tag encrypt individually with the provided password?
ie:
data.es?encrypt=true&password=123&tag=1
data.es?encrypt=true&password=123&tag=2
data.es?encrypt=true&password=123&tag=3

So even if I change the password of the main file to 321, do each of the tags (1,2,3) still use the old password (123)?

I am uploading to PHP with the following:
byte[] data = ES2.LoadRaw (Definitions.sData);
yield return StartCoroutine(web.UploadRaw (data));

downloading with:
ES2Web web = new ES2Web (myURL);
// Start downloading our data and wait for it to finish.
yield return StartCoroutine(web.Download());

And yes, I am using saveRaw to save it back to file.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Raw file error

Post by Joel »

Tags are encrypted individually, but I'm not sure what you mean by "change the password of the main file"?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
mrm83
Posts: 19
Joined: Tue Jan 26, 2016 6:20 pm

Re: Raw file error

Post by mrm83 »

Ok that is the problem then.

I am using SystemInfo.deviceUniqueIdentifier as the file password.

ie: save.es?password={SystemInfo.deviceUniqueIdentifier}

I am trying to load filedata between 2 different devices.

Device2 reading root file from Device1 is fine, but reading each tag fails as the DUI of Device2 differs from device1's DUI. I need to provide Device1's SystemInfo.deviceUniqueIdentifier as the password to read all the tags inside the file.

How can I reset the password for all the tags? Or do I need to manually load each tag with the old password and transfer it over?

ie: I have to do the following for all the tags
byte[] data = {data comes back from server}
// manually set the password of the data to the other device's id
string restorePath = "res.es?encrypt=true&password=" + "DEVICE1ID";
// assign new save file with old password
ES2.SaveRaw (data, restorePath);
List<ItemProperties> c = ES2.LoadList<ItemProperties> (restorePath + "&tag=tag1");
"c" loads properly.

If i don't set the password to the password originally used, I cant read any of the data tags.
Last edited by mrm83 on Thu Jan 04, 2018 10:02 pm, edited 1 time in total.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Raw file error

Post by Joel »

You will need to manually load each tag with the old password and transfer it over.

Tags are encrypted individually for performance reasons, otherwise we'd need to decrypt the entire file to be able to perform any random-access operations on it.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Locked