Hey there,
what would be a proper way to save some specific settings/data like highscores or unlocked content to a file, which cannot be manipulated by the user? I know how to read and write text files, but I would like to encrypt them somehow, so no one can manipulate it.
What is the best approach in Hollywood? Is there an inbuilt way?
Thanks!
Best way to save settings etc.
Best way to save settings etc.
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: Best way to save settings etc.
The Zip plugin supports encryption. Look for it on the download tab.
I'm on registered MorphOS using FlowStudio.
Re: Best way to save settings etc.
If you encrypt zipped files I suggest to do not store the password in clear in your code, use a function to decode the stored pwd and then use it to decrypt your data, also do not store the password in variable names like "pwd" or "pass" or "password" so that it can be harder to find the pwd assignment looking into the executable.
Hope this help
Hope this help
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
Re: Best way to save settings etc.
Nice suggestions, thanks to both of you!
Is it really that easy to "read" the executable?
Is it really that easy to "read" the executable?
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: Best way to save settings etc.
Unix and clones have a utility called "strings" that identifies any ASCII strings in an executable. It has been ported to the Amiga also.
I'm on registered MorphOS using FlowStudio.
Re: Best way to save settings etc.
I see, thanks!
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
Re: Best way to save settings etc.
Although if you compile your Hollywood executable with the -compress option, then those variable names and passwords in your code won't be in readable form by just looking the executable. Might be enough if the project doesn't need that serious protection.Allanon wrote: ↑Fri Dec 14, 2018 8:58 pm If you encrypt zipped files I suggest to do not store the password in clear in your code, use a function to decode the stored pwd and then use it to decrypt your data, also do not store the password in variable names like "pwd" or "pass" or "password" so that it can be harder to find the pwd assignment looking into the executable.
Edit: uhmm... or maybe it's not that safe way, because Hollywood stores an uncompressed applet to a temporary directory in this case, so if user knows to look that...
Re: Best way to save settings etc.
Thanks for your considerations, jpv. That is interesting!
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: Best way to save settings etc.
Actually, jPV was probably on the right track. Just doing the same thing using CompressFile and DecompressFile commands on a text file containing the pass key and using the @FILE preprocessor directive on the compressed version would work without unpacking the application to a temporary file as far as I'm aware. Using a DefineVirtualFile to contain the pass key might be wise as well.
I'm on registered MorphOS using FlowStudio.
Re: Best way to save settings etc.
Nice! I like how this progresses.
I also looked a bit into VirtualFiles but you can't save to them. But storing the password in there is a great idea!
I also looked a bit into VirtualFiles but you can't save to them. But storing the password in there is a great idea!
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc