Update 2 - it works
Thanks to Tom Leek for his answer.
The CFB
mode of mycrypt
for Rijndael
uses a 8-bit feedback loop and not a feedback loop the length of the key/iv.
You have to force it to use the full length with the parameter ncfb
. Confusingly this is not a documented constant in the PHP Mcrypt library: http://www.php.net/manual/en/mcrypt.constants.php
The appropriate lines in the PHP now looks like this:
$Crypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $Key, $Text, 'ncfb', $IV);
$UnCrypt = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $Key, $Crypt, 'ncfb', $IV);