在我的申请中,我使用了加密和加密。
Before entering the string in to local database, I am encrypting that and after fetching the data from database I am decrypting it and using in my application. It is working fine. I have used encryption/decryption from link below
www.un.org/spanish/ecosoc 在加密时:
NSString *myKey=@"any string more than 8 char";
NSData *data ;
NSData *encryptedData;
NSString *encryptPassword,*encryptPasscode;
// 1) Encrypt
data = [password dataUsingEncoding: NSASCIIStringEncoding];
encryptedData = [data AESEncryptWithPassphrase:myKey];
// 2) Encode Base 64
[Base64 initialize];
encryptPassword = [Base64 encode:encryptedData];
www.un.org/spanish/ecosoc 加密时:
NSData *decryptedData;
NSData *b64DecData;
field1 = (char *) sqlite3_column_text(selectPasscodeStatement, 0);
NSString *fieldStr1 = [[NSString alloc] initWithUTF8String: field1];
// 3) Decode Base 64
b64DecData = [Base64 decode:fieldStr1];
// 4) Decrypt
decryptedData = [b64DecData AESDecryptWithPassphrase:myKey];
retrivedPasscode = [[NSString alloc] initWithData:decryptedData encoding:NSASCIIStringEncoding];
但是,我已静态地接受了同样的项目。 我在另一个项目中利用这一静态图书馆。 当我管理该项目时,在加密时,它给我留下了以下错误:
[NSConcrete MutableData] 缩略语