项目中经常要用到一些重要的字符串,本文主要介绍如何对对称加密中的salt(盐)进行加密。
先拿个例子分析下:
#import "ViewController.h"
#import "EncryptionTools.h"
@interface ViewController ()
@end
//盐,salt
NSString *const AES_KEY = @"ABCDEF";
@implementation ViewController
- (void)encyptString:(NSString *)str {
NSString *encyptedString = [[EncryptionTools sharedEncryptionTools] encryptString:str keyString:AES_KEY iv:nil];
NSLog(@"加密后的字符串:%@",encyptedString);
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *