App crashed when enabling Encryption

Discussion and help for Easy Save 3
Post Reply
BFRETHGIL
Posts: 23
Joined: Wed Jun 13, 2018 8:25 pm

App crashed when enabling Encryption

Post by BFRETHGIL »

I enabled the Encryption setting, but once I update my app on the device, the app crashes (because the previous version didn't include encryption on the ES3 file)
The solution is to remove the app and reinstall the new version with the encryption,
I guess ES3 tries to decrypt a file that isn't encrypted and it causes the app to crash, which means a huge problem in the future in case of any changes with the encryption settings,
if the solution is to remove the ES3 file then all the data may be lost

Also, how slower does it make the app when using encryption? I notice some performance issue since I started with encryption
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: App crashed when enabling Encryption

Post by Joel »

Hi there,

This is to be expected because you're telling Easy Save that the data is encrypted, but it is not.

In this case you would generally need to catch the CryptographicException and load it without encryption enabled. You could then resave this data with encryption enabled.

It's hard to say how much slower encryption makes the saving/loading process, but due to the nature of encryption it's necessarily a slow process. If encryption didn't cause significant slow down, it would be extremely easy to crack.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
BFRETHGIL
Posts: 23
Joined: Wed Jun 13, 2018 8:25 pm

Re: App crashed when enabling Encryption

Post by BFRETHGIL »

Where can I find this code so I can add the catch?
Right now I'm saving/loading using the caching file.Save<T>(key, value);
I enabled the encryption from the editor
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: App crashed when enabling Encryption

Post by Joel »

Hi there,

You add the try/catch statement around your Save and Load code. You don't need to modify any of the Easy Save scripts.

For information on enabling/disabling encryption at runtime, see the Encryption guide: https://docs.moodkie.com/easy-save-3/es ... ncryption/

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