开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜