Best way to save settings etc.

Find quick help here to get you started with Hollywood
Post Reply
User avatar
Clyde
Posts: 155
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Best way to save settings etc.

Post by Clyde » Fri Dec 14, 2018 3:17 pm

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!
Currently using: Hollywood 7.1 with Windows IDE

SamuraiCrow
Posts: 214
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: Best way to save settings etc.

Post by SamuraiCrow » Fri Dec 14, 2018 3:27 pm

The Zip plugin supports encryption. Look for it on the download tab.

User avatar
Allanon
Posts: 461
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Best way to save settings etc.

Post by Allanon » 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.
Hope this help ;)
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

User avatar
Clyde
Posts: 155
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: Best way to save settings etc.

Post by Clyde » Fri Dec 14, 2018 9:17 pm

Nice suggestions, thanks to both of you!

Is it really that easy to "read" the executable?
Currently using: Hollywood 7.1 with Windows IDE

SamuraiCrow
Posts: 214
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: Best way to save settings etc.

Post by SamuraiCrow » Sat Dec 15, 2018 5:05 am

Unix and clones have a utility called "strings" that identifies any ASCII strings in an executable. It has been ported to the Amiga also.

User avatar
Clyde
Posts: 155
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: Best way to save settings etc.

Post by Clyde » Sat Dec 15, 2018 10:19 am

I see, thanks!
Currently using: Hollywood 7.1 with Windows IDE

User avatar
jPV
Posts: 246
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Best way to save settings etc.

Post by jPV » Sat Dec 15, 2018 11:30 am

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.
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.

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...

User avatar
Clyde
Posts: 155
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: Best way to save settings etc.

Post by Clyde » Mon Dec 17, 2018 11:14 am

Thanks for your considerations, jpv. That is interesting!
Currently using: Hollywood 7.1 with Windows IDE

SamuraiCrow
Posts: 214
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: Best way to save settings etc.

Post by SamuraiCrow » Mon Dec 17, 2018 8:24 pm

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.

User avatar
Clyde
Posts: 155
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: Best way to save settings etc.

Post by Clyde » Mon Dec 17, 2018 10:33 pm

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!
Currently using: Hollywood 7.1 with Windows IDE

Post Reply