- iOS本地化存储信息
本地化不能存储明文,如果采用MD5 加密,因为MD5加密后都是64位的,过于复杂.所以本地采用钥匙串才是最明智的选择.
钥匙串是iOS7.0.3版本推出来的功能.(iCloud钥匙串),采用256位AES加密技术,用户的信息非常安全.
BOOL isStoreSuccess = [SSKeychain setPassword:@"myPassword" forService:@"kLoginKeyServiceName" account:@"Rephontil"];
NSString *password = [SSKeychain passwordForService:@"kLoginKeyServiceName" account:@"Rephontil"];
NSLog(@"isStoreSuccess = %d, %@ %@", isStoreSuccess,[SSKeychain allAccounts],password);
NSLog(@"isStoreSuccess = %d, %@ %@", isStoreSuccess,[SSKeychain allAccounts],password);
- 使用钥匙串注意
温馨提示:使用钥匙串记得先在Capabilities里面打开Keychain Sharing的开关哦