<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>PhysFS zip and encrypt? [A5]</title>
		<link>http://www.allegro.cc/forums/view/608872</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 27 Nov 2011 03:25:50 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I did some research and as discussed here:<br /><a href="http://www.gamedev.net/topic/318218-using-physicsfs/">http://www.gamedev.net/topic/318218-using-physicsfs/</a><br />7 years ago, physFS had no support for opening encrypted zip files. Is it still so? I looked at A5&#39;s manual and didn&#39;t see any encrypting related commands.</p><p>I am wondering how should I implement that slight protection for my resources then. Renaming *.zip to *.dat is not good enough. However, as I have to load all my data as memory files anyway before actually using them I could encrypt each file separately and keep the zip unencrypted. Then after loading in a png for example I could invert all its bits and that would be good enough protection as there would be no password to find from exe binary as plaintext but rather the cracker should understand how the files are extracted in assembler (bit inversion for example).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Hyena_)</author>
		<pubDate>Mon, 21 Nov 2011 13:45:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/608872/938020#target">Hyena_</a> said:</div><div class="quote"><p>
However, as I have to load all my data as memory files anyway before actually using them I could encrypt each file separately and keep the zip unencrypted. Then after loading in a png for example I could invert all its bits and that would be good enough protection as there would be no password to find from exe binary as plaintext but rather the cracker should understand how the files are extracted in assembler (bit inversion for example).
</p></div></div><p>
You can do that. Just load the files into memory using <span class="source-code"><a href="http://www.allegro.cc/manual/al_fopen"><span class="a">al_fopen</span></a></span> and <span class="source-code"><a href="http://www.allegro.cc/manual/al_fread"><span class="a">al_fread</span></a></span>, then do your decryption, mount the memory using the memfile addon and then use the _f suffixed loading functions.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Sun, 27 Nov 2011 03:25:50 +0000</pubDate>
	</item>
</rss>
