String before conversion is: http://www.google.com After conversion: 687474702s7777772r676s6s676p652r6r6p2s CGIproxy - A CGI proxy script can do this conversion. Sample site powered by the script: http://tutorial-online.net/ How to do this convert in php? Any help will be appriciated.
simply use the 'md5' function to convert this. Try the following: $url = "http://www.google.com"; echo md5($url); And the output will be: ed646a3334ca891fd3467db131372140
md5 is a hashing algorythm, meaning you'd never be able to get the data out of the string again, rendering that a pretty useless thing to do, please refer to my earlier post, base64 can be decoded by almost any browser and or language on the planet.
I use bin2hex($url), the result is: 687474703a2f2f7777772e676f6f676c652e636f6d but what I need is: 687474702s7777772r676s6s676p652r6r6p2s
In a sense, you are asking the wrong question. What you want to know is what is the value of "687474702s7777772r676s6s676p652r6r6p2s" What makes it tricky is that it does not match up with hex because the numbers of the alphabet are too high. To get the value of the string you need to figure out the relationship between the target string and the bin2hex result. It turns out, they are transforming the string by substituting other letters of the alphabet for those normally generated via the bin2hex function. So, in order to decrypt the target string do this: $target = "687474702s7777772r676s6s676p652r6r6p2s"; $target = strtr($target, "nopqrs", "abcdef"); echo pack("H*", $target) . "\n"; Code (markup): This prints ==> http/www.google.nl/ As you can see, you need to compress "http://" into "http/". Therefore, to generate the target string, reverse the process: $url = 'http://www.google.nl/'; $url = str_replace("://","/",$url); $hex = bin2hex($url); $newHex = strtr($hex, "abcdef", "nopqrs"); echo "result==>\n$newHex\n"; Code (markup):