Re: Storing strings in code
Re: Storing strings in code
- Subject: Re: Storing strings in code
- From: Leo <email@hidden>
- Date: Thu, 09 Aug 2012 21:16:38 -0400
Thanks everybody for all the suggestions!
I got the point: there's no way to do this easier than I already do.
I don't need any sophisticated security.
All I want is that if someone opens the executable in a text editor, the
paths of certain two files to not appear in plain text.
For this purpose, my method does what I need:
NSString *str = [[NSArray arrayWithObjects: @"m", @"y", @"S", @"t",
@"r", @"i", @"n", @"g", nil] componentsJoinedByPath:@""]
If there's someone who can crack this, or crack my demo protection by
reverse engineering, then this person wouldn't buy my products anyway so
I'm not worrying.
Thanks again,
Leo
On 8/8/12 5:00 PM, Alex Zavatone wrote:
How much security do you want?
If your strings are basic ASCII, then their value is ASCII 32 to 126. You can just bit shift the ASCII values (+128), store the ASCII value, or zip the strings.
On Aug 8, 2012, at 4:37 PM, Jean-Daniel Dupas wrote:
Le 8 août 2012 à 22:15, Rick Mann <email@hidden> a écrit :
On Aug 8, 2012, at 12:58 , Leo <email@hidden> wrote:
As I recently learned, plain strings are stored "as is" in the executable and can be discovered - if opening it in a text editor, for example.
That is, if I have a string @"myString" inside the code, it can be read in plain text inside the executable.
I have a couple of string I don't want to be discovered (related to demo period handling).
Is there an easy way to store them in an encoded way?
I tried to define them as C strings (const char) but it doesn't make a difference.
So far I just break them into characters in AppleScript Editor, add @ in front of each with find-replace, and then store them as an array which receives the -componentsJoinedByString: method.
Is there an easier way?
There's no truly secure way to do this. About the best you can do is encrypt the strings, but people can crack it if they want to badly enough. Depending on how much effort you want them to go through, you can do any number of things to encrypt, from simple to complex.
You might also consider requiring a connection to a server to see if you should run. But given enough interest, you will get p0wned eventually.
Requiring a connection to check license is the best way to bother legitimate customers, while being totally ineffective to stop your application to being cracked.
I would not bother to much to hide strings. There is far more information in the binary that can be used to crack it, like the full objc metas.
--
Rick
-- Jean-Daniel
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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