how to decode and encode like this
Started on the old forum in September 2012 · view the original in the archive · old links redirect here
mansi wrote: i want to decode urls in this format => 956ed3152e12e9354a061646ab0c5ff4 and encode urls too like this,, i saw many websites using this format ...
how to ? you cant... as arnage said... md5 hash
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!
hmmm,, no it is possible ,,, i show you an example
http://www.4funmusic.ir/dl/dl2/2-clip/Justin-Bieber-As-Long-As-You-Love-Me-ft-Big-Sean-320.mp3
this url encoded in => 956ed3152e12e9354a061646ab0c5ff4
but i dont find which encoding/decoding is used in this
mansi wrote: hmmm,, no it is possible ,,, i show you an example
http://www.4funmusic.ir/dl/dl2/2-clip/Justin-Bieber-As-Long-As-You-Love-Me-ft-Big-Sean-320.mp3
this url encoded in => 956ed3152e12e9354a061646ab0c5ff4
but i dont find which encoding/decoding is used in this
encoding is possible... decoding isn't... this has been said about 10 million times before... md5 hash is one way street... not reversable... yet it can be cracked... but thats not the same
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!
i suppose if you really wanted to have something simular to md5 you would have to create your own encoding/decoding function.
example would be: Encode
function Encode($Data)
{
$Encode_From = array('A', 'B', 'C');
$Encode_To = array('9E', 'R4', 'D1');
for($m = 0; $m<count($Encode_From); $m++)
{
$Data = str_replace($Encode_From[$m], rtrim($Encode_To[$m]), $Data);
}
Return $Data;
}
//
//
//
then you would to the same for a decoding function. but just putting the array from and array to into reverse.
ie: array from would become array to. and array to becomes array from.
this isnt tested, i just put it together as an example.
updated
i should of also mentioned to use it you could do it a number of ways.
to display result directly you can do:
echo Encode('ABC');
//
//
//
to gather the data you can do just
Encode('ABC');
//
//
or
$Gather_to_var = Encode('ABC');
//
//
etc etc.
this has now been tested and works for me. result for ABC = 9ER4D1
you would also want to prob put your own upper/lowercase checking in also. as right now this only looks for uppercase chars, as i put them all in as uppercase in the array.
anyway this should help you make your own version anyhow.
Ghost wrote: i suppose if you really wanted to have something simular to md5 you would have to create your own encoding/decoding function.
example would be: Encode
function Encode($Data) { $Encode_From = array('A', 'B', 'C'); $Encode_To = array('9E', 'R4', 'D1'); for($m = 0; $m<count($Encode_From); $m++) { $Data = str_replace($Encode_From[$m], rtrim($Encode_To[$m]), $Data); } Return $Data; } // // //then you would to the same for a decoding function. but just putting the array from and array to into reverse.
ie: array from would become array to. and array to becomes array from.
this isnt tested, i just put it together as an example.
updated
i should of also mentioned to use it you could do it a number of ways.
to display result directly you can do:
echo Encode('ABC'); // // //to gather the data you can do just
Encode('ABC'); // //or
$Gather_to_var = Encode('ABC'); // //etc etc.
this has now been tested and works for me. result for ABC = 9ER4D1
you would also want to prob put your own upper/lowercase checking in also. as right now this only looks for uppercase chars, as i put them all in as uppercase in the array.
anyway this should help you make your own version anyhow.
Really very good and detail reply,, and thanku for your help but i mainly want to know which encoding is used in this example as i tried md5() also but it is not md5,, may there are any good decoding technique other than base64... as i saw the same encoding pattern in many sites,,,it compress the size of url too ,, in 29-32 length string only
there is the byterun decoder but i dont know too much about it. php $_F=FILE;$_X= Byterun Decoder
and of course base64. Base64 Decode and Encode - Online
but i dont know of too many others. i would prefere to create my own from scratch as there is less chance of you being hacked/ripped for awhile at least. as everyone knows of these other decode/encoders but your own special one would be new to them. not saying it would never be cracked. but im guessing you have better odds than the others using base64 etc.
i creared an example decode / encoder here not long ago http://coding-talk.com/f16/example-encoding-decoding-script-19057/#post106101