iPhone - AES256 Encryption Using Built In Library
Hey all, I am using http://pastie.org/966473 as a reference as all I need to do is encrypt something using AES256 encrypting. I created a class and put the implementation in the pastie on top of the implementation for my class.
@implementation
//pastie code
@end
@implementation
//my class code
@end
开发者_Go百科In my class code I create a NSMutableData and try to call the EncryptAES method and I get a warning saying it might not respond to that. What am I doing wrong here? do I need to implement the pastie code elsewhere? Thanks for any help.
That's just the @implementation
block. You also need to define the category. Put this in your header file:
@interface NSMutableData (AES)
- (NSMutableData*)EncryptAES:(NSString *)key;
- (NSMutableData*)DecryptAES:(NSString *)key
andForData:(NSMutableData*)objEncryptedData;
@end
精彩评论