When calling the md5
method in php and passing a string as argument, i would guess that php has to convert the string to bytes to perform the hash operation, what encoding does it use when converting from string to bytes?
Im trying to port the following php code into .net code.
.net can't Hash a string first it has to be converted to a byte array or stream.
<?php
$params = $_GET;
$var = "";
foreach ($params as $key => $value)
{
if($key != "hash")
{
$var .= $value;
}
}
$genstamp = md5($var . "SecretMD5Key");
if($genstamp != $_GET["hash"])
{
echo "Hash is not valid";
exit();
}
else
{
//Hash is OK
}
?>