Re: Is there a way to Encrypt entire folders with BGT?

2014-11-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Is there a way to Encrypt entire folders with BGT?

Sure.One could encrypt each file individually, or could encrypt them after packing them.(IIRC, the encryption scheme changed after the Perilous Hearts demo, but I'm not sure about that. I think it changed at one point to something more secure.)Here's an example. I'm literally just adding one line to my pack_all example:// Pack all files in a certain directory, recursive.
// This probably needs to be in its own script; pack everything separately from the game, otherwise it will do weird things when someone tries to play it.

// Both parameters here have a default value, so you can just call pack_all().close() and that's everything. You might try pack_all("sounds") if you only want the sounds folder, for example.

pack_file@ pack_all(string top="", pack_file@ ret=null) {
 if(@ret==null) {
  pack_file temp;
  @ret=temp;
  ret.create("sounds.dat");
 }

// Formatting:
if((top!="")&&(string_right(top, 1)!="/")&&(string_right(top, 1)!="\\")) {
 top += "/";
 }
string[] dirs=find_directories(top + "*");
string[] files=find_files(top + "*");

for(uint i=0; iIf you wanted to encrypt something other than sounds, and use a file other than sounds.dat, you might do something like this:pack_file temp;pack_file@ pack=temp; // Just because we'll be passing it around to functions.pack.create("data.temp"); // It's a temp because we're going to encrypt it.pack_all("", pack);pack.close();file_encrypt("data.temp", "data.dat", "super awesome key of safety+4");To use the pack later, you'd need to decrypt it first, though, which could be a problem.An alternative would be to encrypt all your files separately, then pack the encrypted files. You'd need something like the pack_all function to do this, just encrypting instead of packing. The advantage to changing it to work that way would be that you could access the files more easily without the security risk of unpacking everything where a cheater 
 might find it.That, and the sound engine allows you to use a pack and set an encryption key, but IIUC it only works if the files are encrypted separately.

URL: http://forum.audiogames.net/viewtopic.php?pid=195204#p195204




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Is there a way to Encrypt entire folders with BGT?

2014-11-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Is there a way to Encrypt entire folders with BGT?

Sure.One could encrypt each file individually, or could encrypt them after packing them.(IIRC, the encryption scheme changed after the Perilous Hearts demo, but I'm not sure about that. I know it changed at one point to something more secure.)Here's an example. I'm literally just adding one line to my pack_all example:// Pack all files in a certain directory, recursive.
// This probably needs to be in its own script; pack everything separately from the game, otherwise it will do weird things when someone tries to play it.

// Both parameters here have a default value, so you can just call pack_all().close() and that's everything. You might try pack_all("sounds") if you only want the sounds folder, for example.

pack_file@ pack_all(string top="", pack_file@ ret=null) {
 if(@ret==null) {
  pack_file temp;
  @ret=temp;
  ret.create("sounds.dat");
 }

// Formatting:
if((top!="")&&(string_right(top, 1)!="/")&&(string_right(top, 1)!="\\")) {
 top += "/";
 }
string[] dirs=find_directories(top + "*");
string[] files=find_files(top + "*");

for(uint i=0; iIf you wanted to encrypt something other than sounds, and use a file other than sounds.dat, you might do something like this:pack_file temp;pack_file@ pack=temp; // Just because we'll be passing it around to functions.pack.create("data.temp"); // It's a temp because we're going to encrypt it.pack_all("", pack);pack.close();file_encrypt("data.temp", "data.dat", "super awesome key of safety+4");To use the pack later, you'd need to decrypt it first, though, which could be a problem.An alternative would be to encrypt all your files separately, then pack the encrypted files. You'd need something like the pack_all function to do this, just encrypting instead of packing. The advantage to changing it to work that way would be that you could access the files more easily without the security risk of unpacking everything where a cheater 
 might find it.That, and the sound engine allows you to use a pack and set an encryption key, but IIUC it only works if the files are encrypted separately.

URL: http://forum.audiogames.net/viewtopic.php?pid=195204#p195204




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Is there a way to Encrypt entire folders with BGT?

2014-11-19 Thread AudioGames . net Forum — Developers room : Orin via Audiogames-reflector


  


Is there a way to Encrypt entire folders with BGT?

Hi all,I'm just wondering if it is possible to do this? The Encryption functions themselves in BGT only allow for files, but I'd just love to encrypt my whole directory so that people can't get at sounds, music etc. Although, I know some people have decrypted stuff made with BGT sadly. I lost it when I formatted my Mac but the Parilous Hearts music and sounds were floating around.

URL: http://forum.audiogames.net/viewtopic.php?pid=195203#p195203




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector