Skip to content
Advertisement

Convert PHP code that create encryption key to c# MD5

I’m trying to convert the following code that create encryption key to c# the result I need the $key ** and ** $iv

JavaScript

what I could do until now

JavaScript

but I’m not getting the same result

thanks

Advertisement

Answer

The called PHP md5 function will return the md5 hash in raw binary format (16 bytes). Read more about PHP md5.

Here is the equivalent in .NET.

JavaScript

If you want to check the outputs, use the PHP base64_encode function and the .NET Convert.ToBase64String, then compare the base64 strings.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement