hello..i new in php i need some help about function do_crypt & do_decrypt i want to write in my file auth_inc.php
function do_crypt & do_decrypt how to write this function...
this sample i get from another web but it not steady.i cannot read it and where to put in line...if anyone can write back please help me....!!
//---------------------------------------------- function do_crypt($Pass) { $Result=""; for ($i=0;$i<strlen($Pass);$i++) { $tmp=ord($Pass[$i]); $tmp=$tmp+$i; $num1=intval($tmp/100); $num2=intval($tmp%100); $num2=intval($num2/10); $num3=intval($tmp%10); $Result=$Result.$num1; $Result=$Result.$num2; $Result=$Result.$num3; } return $Result; }
//----------------------------------------------- function do_decrypt($CodedPass) { $result=""; $i=0; while ($i<strlen($CodedPass)) { $num1=ord($CodedPass[$i++]); if ($i>=strlen($CodedPass)) break; $num2=ord($CodedPass[$i++]); if ($i>=strlen($CodedPass)) break; $num3=ord($CodedPass[$i++]); if ($i>strlen($CodedPass)) break; $num1=$num1-48; $num2=$num2-48; $num3=$num3-48; $num=$num1100+$num210+$num3; $char=chr($num); $result=$result.$char; } $result1=""; for ($i=0;$i<strlen($result);$i++) { $tmp=ord($result[$i]); $tmp=$tmp-$i; $char=chr($tmp); $result1=$result1.$char; } return $result1;