problem with encryption

David Beck david_beck at ministerschedulerpro.com
Fri Jun 1 09:18:55 EDT 2007


Despite all my efforts I can not ecnrypt a string the same way with Rev 
and php. The following rev code;

encrypt "hello" using "aes-128-cbc" with key "0123456789abcdef" and iv 
"01234567012345"
put it

produces:

å
U[·á$,^Ám¡u

The php code:

$td = mcrypt_module_open( MCRYPT_RIJNDAEL_128, '', 'cbc', '' );
mcrypt_generic_init( $td, '0123456789abcdef', '0123456789012345' );
$data = mcrypt_generic( $td, 'hello' );
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
echo( $data );

should be exactly equivilent, but produces:

Ý~Õ xëCàñTš6

Does anybody know why these two are producing two different strings or 
has anybody been able to get rev and php successfully "talking the same 
encryption language"? I can not get encryption / decryption to work 
between platforms.

I have tried many different ciphers all with a similar result.

Thanks very much for any help,

David



More information about the use-livecode mailing list