Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK Encrypted Asset Support

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Jan 2021 04:48
That sounds cool
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 29th Jan 2021 10:36
I'm not familiar with the zip method being discussed (ie go easy!) so have a few questions...

Overall does it allow you to read and write various files eg images (including font and subimage based atlas images), sounds and text files?
Do users require third party software (zip)?
Would the unencrypted/unprotected data be written to disk at any point (when the application opens the protected zip)?
How does it work with user/application generated files (save data etc) - can you write text files etc into the protected zip?
Are users comfortable with applications using a zipped folder? Security? Feels less trustworthy than simply a bunch of files you can't read to me...
Do Steam and other distribution platforms allow this method?

How would it be implemented/used in AppGameKit?

I guess to me, having encryption commands like EncryptFile() and LoadEncryptedImage(), LoadEncryptedSound() etc and for text files WriteEncryptedLine() and ReadEncryptedLine() ) etc just feels more seamless and easier to use for non-techie folk (like me) which feels like AGKs audience.

AQUILLANTO - A side-scrolling platformer with super tight controls, 3 worlds to explore, hordes of monsters and a quest... Inspired by games on the Amiga computer

FOLLOW ON TWITTER
SEE THE YOUTUBE CHANNEL

MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Jan 2021 10:54
Quote: "I like the idea of mounting/unmounting zips too but how would you refer to them?"

Quote: "Why would files in the mounted zips need to be referred to any differently? I think the file search order goes: 1) write folder, 2) read folder. What if searching mounted ZIPs (in the order mounted) for a matching file name was done before searching the write and read folders?"

This is exactly what Bengismo and I did. To read in this thread 19 post above this one.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Jan 2021 10:55 Edited at: 29th Jan 2021 10:55
Quote: "I guess to me, having encryption commands like EncryptFile() and LoadEncryptedImage(), LoadEncryptedSound() etc and for text files WriteEncryptedLine() and ReadEncryptedLine() ) etc just feels more seamless and easier to use for non-techie folk (like me) which feels like AGKs audience."

+1
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 29th Jan 2021 12:37
blink0k wrote: "I like the idea of mounting/unmounting zips too but how would you refer to them?"


In BlitzMax it works like this:


adambiser
AGK Developer
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 29th Jan 2021 13:32
@MadBit: Your method is the best and easiest I think. The only difference I suggested is the search order. You check the paths first, I suggested checking the mounted ZIPs first so it'd be easy to switch between raw files and ZIPs during development (since ZIPs can be unmounted and raw files would have to be moved).

@DavidAGK: I'll attempt to answer. MadBit can correct me if I'm wrong.
> Overall does it allow you to read and write various files eg images (including font and subimage based atlas images), sounds and text files?
Yes
> Do users require third party software (zip)?
No
> Would the unencrypted/unprotected data be written to disk at any point (when the application opens the protected zip)?
No
> How does it work with user/application generated files (save data etc) - can you write text files etc into the protected zip?
Maybe AppGameKit could add a "password" parameter to the existing CreateZip method?
> Are users comfortable with applications using a zipped folder? Security? Feels less trustworthy than simply a bunch of files you can't read to me...
Why not? Having one large data file is pretty common.
> Do Steam and other distribution platforms allow this method?
Why not? Having one large data file is pretty common.
> How would it be implemented/used in AppGameKit?
Similar to how MadBit described above.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 29th Jan 2021 14:12
Hmmmm... OK, sounding interesting at that stage. You'd need to be able to reference/access multiple zips as you don't really want base assets and player files (config, progress, inventory etc) stuff in the same zip... just a hunch - for permissions reasons. COuld be wrong though - out of my depth here.

adambiser - I've sent you a PM.

AQUILLANTO - A side-scrolling platformer with super tight controls, 3 worlds to explore, hordes of monsters and a quest... Inspired by games on the Amiga computer

FOLLOW ON TWITTER
SEE THE YOUTUBE CHANNEL

MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Jan 2021 15:45
Quote: "The only difference I suggested is the search order. You check the paths first, I suggested checking the mounted ZIPs first so it'd be easy to switch between raw files and ZIPs during development (since ZIPs can be unmounted and raw files would have to be moved)."

I had a slightly different workflow in mind.
I had imagined that the app would be developed using only the raw files.
How often are graphics sounds and the like replaced? I think very often.
Or you work with dummy files that are then replaced at some point.
When it is published. Then the media folder is simply zipped and only the assign line is inserted in the source text.
Furthermore, it might be good if, for example, a config file for the app is in the zip folder as a default. If it is loaded.
Then settings are changed and saved in the user profile. This file really does not need to be encrypted.
Now the possibility is that the saved file is simply loaded with the same name. Because it is found first in the user profile.
I had thought of something like that during development.

Oh yes, my system allows you to specify multiple zips that will be searched in the order in which they were assigned.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
adambiser
AGK Developer
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 29th Jan 2021 16:39
@MadBit: Either workflow would work for me. I could also just set the media folder to be "media-dev" or some such for development and build and swap in the zip when ready to deploy.
I assume that you also have an UnassignZip/UnmountZip function, yes?
When you say "the media folder is simply zipped" are you also meaning that the bytecode can be read from a mounted zip?
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Jan 2021 17:16
Quote: "I assume that you also have an UnassignZip/UnmountZip function, yes?"

Not at this stage. But it can be added without problems.

Quote: "When you say "the media folder is simply zipped" are you also meaning that the bytecode can be read from a mounted zip?"

Good point. I couldn't test that because I have no idea how to get the Assign command into the interpreter (Tier1).
My tests so far have only been in Tier2.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
adambiser
AGK Developer
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 29th Jan 2021 17:19
@MadBit: I typed that without thinking deeply enough. There wouldn't be a way to know to read the zip if the bytecode with the AssignZip call were in the zip...
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Jan 2021 17:22
I just thought of the same thing
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Jan 2021 17:34
I have just looked at the interpreter code.
I think theoretically it is even possible that the interpreter can read the bytecode directly from the zip.
Because it uses the same commands as in Tier2 and also binds the AGKWindows64.lib normally.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Jan 2021 22:39
Quote: "This is exactly what Bengismo and I did."

Is that for all devices or just windows?
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 30th Jan 2021 07:44
The changes I made and I think Bengismo made are at the core of Agk.
If the functions are assigned to the interpreter and compiler, it should work with any supported platform.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 31st Jan 2021 19:41
Quote: "If the functions are assigned to the interpreter and compiler"

That would be nice
Mike F
19
Years of Service
User Offline
Joined: 30th Mar 2005
Location:
Posted: 7th Apr 2021 01:32
Apologies, I just wish to verify something. The solutions discussed aren't currently publicly available? The ZIP mounting seems a good idea for several reasons, and the password protection, of course, fills the need for reasonable asset protection. I'd rather not duplicate effort with a custom loader if there's an accepted best practice, and this seems as close as we have.

Login to post a reply

Server time is: 2024-11-21 17:15:44
Your offset time is: 2024-11-21 17:15:44