Le 15 févr. 2011 à 16:35, Brad Stone a écrit :

> I've been doing a lot of hunting to find a simple way for me to encrypt an 
> NSString and NSData.  I've found a bunch of useful blogs like Cocoa Nut 
> (http://cocoa-nut.de/?tag=encryption, Deusty:Using OpenSSL in Cocoa 
> (http://deusty.blogspot.com/2007/01/using-openssl-in-cocoa.html) and the 
> SSCrypto site (http://septicus.com/products/opensource/).  The thing is 
> however that these, among others I've found (like "cocoa-ae"s from 2009), are 
> dated.  The SSCrypto files haven't been updated since 2006 and these blogs 
> are of similar age.
> 
> My question is simple: can I get this done without having to dive deep into 
> the world of OpenSSL?  If so, how?
> 
> I have about four NSString iVars and one NSData iVar I want to encrypt.  I 
> wrote my own test code to encrypt/decrypt an NSString on the fly and have it 
> work with core data transparently to the user.  I'm at the point now where I 
> need to replace that test code with something real.  From all I've read, 
> OpenSSL is the way to go but I've also read it's very difficult to implement. 
>  I know nothing about it.  What initially attracted me to SSCrypto is that 
> it's simple (i.e. NSData *decryptedText = [crypto decrypt:@"aes256"]) but I'm 
> worried about using something relatively old and using a third party 
> framework.
> 

For AES (and SHA, and HMAC), use CommonCrypto API which is part of libSystem.

man CCCryptor for details. (or search in Xcode doc).

-- Jean-Daniel




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to