From searching all around, I can find a number of links referencing similar issues, but nothing is quite working, its driving me mad....
Can someone please give me a step by step guide on how to write the following PHP code in Objective C.
We are creating some web service calls, which require encrypted content, and we have only been given PHP encrypt sample. To be clear we do not want to un-encrypt, we want to mirror this encryption process in IOS.
Many thanks
function encrypt($plainText) {
$initVector = "mysite.com";
$key = base64_decode("GfSDfXS14U8I3YglEFrMjMOOnESUMxN3wRTt1TeDosY=");
$block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
$padding = $block - (strlen($plainText) % $block);
$plainText .= str_repeat(chr($padding), $padding);
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plainText, MCRYPT_MODE_CBC, $initVector);
$crypttext64 = base64_encode($crypttext);
return $crypttext64;
}