2011-05-16 77 views

回答

4

有很多通过OpenSSL可用的算法,如AES和3DES。 OpenSSL不易使用,但它很强大。此外,还有很多教程。例如,在普通C中的here's a sample on how to en/decrypt with AES

然后是CommonCrypto库。看到问题AES Encryption for an NSString on the iPhone,您可能最感兴趣的部分是methods that extend NSData for encryption and decryption with AES

+0

此算法用于加密和解密文本格式。如何实现这个UIImage? – Sezhian 2011-05-16 15:30:30

+0

@Sezhian:[将UIImage转换为NSData](http://stackoverflow.com/questions/2240765/nsdata-to-uiimage)然后[使用我已链接的NSData类别用AES加密](http:/ /pastie.org/426530)。另一种方法更容易:使用NSData类别进行解密,然后使用[UIImage imageWithData:](http://developer.apple.com/library/ios/documentation/uikit/reference/UIImage_Class/Reference/Reference.html#//apple_ref/OCC/CLM /的UIImage/imageWithData :)。 – DarkDust 2011-05-16 18:43:07

2

您可以使用iOS SDK中提供的CommonCrypto库。