I am new to this encryption/decryption and I received following error
"PROGRAM RECEIVED SIGNAL: EXC_BAD_ACCESS"
IN RNCryptManager.m of DEcryptdata
NSData *key = [self AESKeyForPassword:password salt:salt];
When trying to encrypt/decrypt a string with password as "password" using RNCryptmanager.h amd .m files
NSData *en = [RNCryptmanager encryptedDataForData:data1 password:password1 iv:ivv salt:salt1 error:error];
values for iv and salt is a random data
NSData *ivv = [self randomData:32];
NSData *salt1 = [self randomdata:16];
Note that RNCryptManager has been superseded by RNCryptor, which has more features and improved security.
You should be receiving warnings about this code, which suggests you're ignoring warnings. You must never ignore warnings in ObjC.
The
iv
,salt
, anderror
parameters are pass-by-reference. This method returns them; it doesn't take them. It should look like:See CPCryptController for an example.