I’m looking for ways to encrypt and decrypt NSStrings with a user defined keyword in Objective-C. I found this in a different Stack Overflow post:AES256 in objective-c.
How can one go about using these methods, I’m fairly new to Objective-C programming. How can I do this? Are there any tutorials on this?
Thanks in advance!
This is a category on NSData– it adds
AES256EncryptWithKey:andAES256DecryptWithKey:to the methods supported by NSData.So, to encrypt a string, you would first convert your string into an NSData object (using
dataUsingEncoding:on the string), then callAES256EncryptWithKeyon the NSData object you get fromdataUsingEncoding.