Re: Transparently en-/decrypt package resources
Re: Transparently en-/decrypt package resources
- Subject: Re: Transparently en-/decrypt package resources
- From: Ricky Sharp <email@hidden>
- Date: Mon, 15 Jan 2007 10:01:45 -0800
On Monday, January 15, 2007, at 08:24AM, "Dominik Pich" <email@hidden> wrote:
>Hi,
>we want to store our resources (nibs,xml&everything) in an encrpted
>way. We dont go for security (which would be kinda pointless here)
>but we would like to keep nosy ;) end-users from going through the
>package's content and maybe editing something here and there.
>
>So what we'd like to do is apply a XOR.. or so encryption and on the
>fly decrypt our resources.
>The thing is, we dont know where to hook in?!
>
>We could do it at startup before NSApplicationMain loads the
>principal class, I guess, but that'd be a last resort, because IIRC
>that would mean reading,decoding and then writing the files again.
>(Not to mention encrypting once the app's done.
>
>So. what is the adviced tequnique? Surely someone tried this before!?
First, whatever solution you create, remember that your app's bundle should never be written to (i.e. it should be read-only).
I've only done what you describe with images. To protect my artwork, all images in my bundle are encrypted. I created an "image factory" that then manages the loading of images (basically my own imageNamed: API).
And because my nibs contain tons of custom UI controls, etc, there was no need to encrypt those as nobody can open them without my custom IB palettes. I don't know offhand where in code you could tap into to decrypt _all_ resources on-the-fly.
Perhaps you can just encrypt your images? Or do you really need to encrypt everthing?
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden