I'm trying to find a way to encrypt via php and decrypt via javascript/ajax
This isn't meant to be a robust solution but just a lightweight remedy to discourage the casual user from right clicking and looking at the source to see the correct answer in plain view. The answer will be revealed via ajax.
I was trying to translate the encoding of the string function I found below to php but it's not right.
http://www.yaldex.com/FSPassProtect/CharacterEncoder.htm
The code I have so far is this...
$string = "Ordinarily, license fees are in the nature of the exercise of police";
for($i=0;$i<strlen($string);$i+=1){
$output = $output . (ord($string[$i]) - 23);
}
echo $output;
but when I past the generated code into the webpage listed above to decrypt it it's not correct.
Any help would be appreciated.