This is what I found too if you don't provide PHP mcrypt with an
initialization vector or provide it with one of all zero's the first
block is not XORed with the initialization vector.
Any additional blocks are XORed with the prior. This and the padding
method are what create the compatibility problems. Padding the string
prior to encryption also solves this as long as the flash client knows
what character you used for padding. PHP mcrypt pads with null or the
zero ascii character which causes some issues when decrypting in the
flash client
In the class I wrote as long as I use PHP mcrypt with an
initialization vector of all zero's the output is identical. I pad
strings prior to encryption with a known character like so
//PAD STRING PRIOR TO ENCRYPTION
if(strlen($string) % 16){
$string = str_pad($string, ceil(strlen($string)/16)*16,"~");