首页 > 代码库 > [iOS]简单的数据加密

[iOS]简单的数据加密

#define kEncryptKey @"com.person.projectname"- (NSData *)encryptData:(id)dic{    NSMutableData *data = [[NSMutableData alloc] init];    NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];    [archiver encodeObject:dic forKey:kEncryptKey];    [archiver finishEncoding];    return data;}- (id)decryptData:(NSData *)data{    NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];    NSDictionary *dic = [unarchiver decodeObjectForKey:kEncryptKey];    [unarchiver finishDecoding];    return dic;}

 

[iOS]简单的数据加密