by Spike » Thu Jan 29, 2015 9:26 pm
firstly, remember that its a pk3. yes its a zip, but your average user will not necessarily know that and won't try opening it (and windows won't guess based upon anything but the extension).
you could just use a pak instead, which do require more specialist tools to read+write properly.
if you're really desperate, you can use/make a filesystem plugin, an example is the mpq filesystem plugin (spirit may remember the diablo2 thing). again, people will be able to decode that if they know what it is and they can find appropriate tools.
if you made a similar plugin that 'contains' a single pk3, you could can hardcode pretty much all the logic to act as a passthrough to decrypt the embedded data, and depend upon fte's nested package support in order to load it using its built-in pk3 loading. of course, filesystem plugins depend upon engine headers, so you can't really get away from the gpl.
and even if you could, a user could just configure a server to allow its contents to be downloaded, or could write some qc to read the files and write them out to a new name that isn't inside a package (or do it in the engine).
it might be interesting to store per-file passwords as some postfix on the filename or something, and have the gamecode specify the passwords that way. you'd need some sort of algorithm to generate the (per-file) passwords to avoid the strings being seen in plain text (at least stored in the string table away from the mdl names), and there's always a problem with people decompiling mods.
however, there's some file types that would be hard to provide passwords for in this way, stuff like textures and shader files.
lots of options, and none of them with any real protection.
which I guess is why you'd be happy with a hardcoded password.
tl:dr:
fte doesn't support any encryption in pk3s.
there's a plugin for mpq (which does still support compression+obfuscation) if you can find tools to write them.
whatever you do, someone can hack the engine to write the file out to disk after any decryption.
.