Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-22-2009, 10:11 AM   #63 (permalink)
hellrider
Registered Member
 
Join Date: Jul 2009
Posts: 96
hellrider is on a distinguished road
Default

Checksums are the most effective way to deter "noob" crackers. Anyone who knows some assembly can easily patch this, but its better than nothing.

Here's a function that returns the MD5 checksum of the given data.

Code:
#import CommonCrypto/CommonDigest.h

// this site fails with regards to disallowing < > in CODE blocks

NSString * data_getMD5(NSData *data) {
	
	if (data == nil)
		return nil;

	const void * bytes = [data bytes];
	int len = [data length];
	unsigned char digest[CC_MD5_DIGEST_LENGTH];
	
	CC_MD5_CTX c;
	CC_MD5_Init(&c);
	CC_MD5_Update(&c, bytes, len);
	CC_MD5_Final(digest, &c);
	
	return [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
			digest[0], digest[1], digest[2], digest[3],
			digest[4], digest[5], digest[6], digest[7],
			digest[8], digest[9], digest[10], digest[11],
			digest[12], digest[13], digest[14], digest[15] ];
}
Pass an NSData object holding the bytes of the info.plist.

Also, you can easily adapt it to do SHA1 instead.
hellrider is offline   Reply With Quote
 

» Advertisements
» Online Users: 682
20 members and 662 guests
13dario13, ADY, AlanR917, Alex40, burntsoap, carlandrews, dcool, doffing81, Droverson, estherkt98, matador1978, MysticLine, ncc1701e, pierresinne, ryantcb, SamorodovAlex, SLIC, Thompson22, vpros, Xaphann
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,419
Threads: 94,016
Posts: 402,536
Top Poster: BrianSlick (7,978)
Welcome to our newest member, estherkt98
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:21 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.