Hi.
I'm not sure if this belongs here, but how useful would it be if SGDK2 games had some kind of protection against unwanted distribution?
Since SGDK2 games are HTML5 based, you could generate a unique copy of the game for each user who loaded it.
Perhaps one could encrypt the game, and hide the data within a digital image of a person's own logo and rights ownership statement, using the JPEG compression algorithm. Additionally the hidden information could be encrypted again with some kind of chaotic map.
When the game is to be loaded, a JavaScript file collects the pixels of the image, and decodes the information into the code needed to run the game which is loaded into a buffer, and finally runs it with eval(); or new function();
This was used by Samil Shah:
http://stegosploit.info/The main idea is to load as little data as needed, pieces at a time. Really, so only load graphics once needed, and maps once needed, and only load them partially, etc. Additional security would be found by converting SGDK2 graphics to JPEG images and hiding information about the user whose copy this game belongs to within those.
This would help immensely in tracking down traitors.
Additionally, the domain of which the code is currently running under can be used as the key for decrypting the code from the image. This would make it difficult for the code from running under any other domain than yours. The idea is to avoid using "boolean" values at all because someone can just set these to true in the JavaScript event logger and bypass your security scheme.
By coupling your graphics and code you not only make it difficult for your game to be illegally modified, but you make it far more difficult for your code to be understood. By exploiting metadata that can be hidden in JPEG's DCT Transform, you can track who is distributing your game.