I want to encrypt the audio file; how do I achieve it in the iPhone? Is there any framework to get this done?
This is the code I am using to encrypt the file,
NSData *inputData = [NSData dataWithContentsOfFile:localfilePath.path];
NSString *encryptKey=[NSString stringWithString:@"nywleS"];
CCCryptorStatus status = kCCSuccess;
NSData *encrypted = [inputData dataEncryptedUsingAlgorithm:kCCAlgorithmAES128 key:encryptKey initializationVector:@"Selwyn" options:0 error:&status];
NSData *decryptedData = [outputData decryptedAES256DataUsingKey:encryptKey error:nil];
But the original file size becomes less after encryption in CBS mode. And also after decryption, it's the same size as encrypted.
iOS supports CommonCrypto (just like Mac OSX does). That will let you encrypt and decrypt any type of data, including audio.
There are several questions on how to use CommonCrypto in your applications.