Re: Hiding String Constant in Compiled Code
Re: Hiding String Constant in Compiled Code
- Subject: Re: Hiding String Constant in Compiled Code
- From: Uli Kusterer <email@hidden>
- Date: Mon, 30 Nov 2009 16:52:20 +0100
On 30.11.2009, at 15:48, Richard Somers wrote:
> Consider a string constant, @"string", in source code that also appears in the compiled unix executable file. If someone knew the value of the string they could easily open the executable with TextEdit, find the string, replace it with a perfectly functioning one of their own making, and then save the file and the application would run with the new string value.
>
> Is there some way to easily hide or munge a string constant so that it does not appear in the compiled executable?
Well, every hacker can of course still find it by just attaching to your application, so don't use that for license keys or passwords, but if you just want to keep people from searching your game for strings that provide a walkthrough, you can just XOR something over the string or use Rot13. Strings processed that way can be stored as arrays in your app, and you can then decode them at runtime (Both XOR and Rot13 are symmetric de/encodings), pass them to stringWithUTF8String and be on your way.
Cheers,
-- Uli Kusterer
"The witnesses of TeachText are everywhere..."
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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