downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Introduction> <hash
Last updated: Fri, 27 Nov 2009

view this page in

Mcrypt



add a note add a note User Contributed Notes
Mcrypt
Anonymous
16-Oct-2009 03:11
When using 3DES between PHP and C#, it is to be noted that there are subtle differences that if not strictly observed, will result in annoying problem encrypt/decrypt data.

1), When using a 16 bytes key, php and c# generates total different outcome string. it seems that a 24 bytes key is required for php and c# to work alike.
2), php doesnt have a "padding" option, while c# has 3 (?). My work around is to add nulls i.e. chr(0) to the end of the source string to make its size times of 8, while in c#, PaddingMode.Zeros is required.
3) the key size has to be times of 8, in php, to make it work for c#.

Introduction> <hash
Last updated: Fri, 27 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites