Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP]Simple string alteration.

Master Summoner
Joined
Jan 11, 2009
Messages
505
Reaction score
8
hello! disclaimer: if you want to risk your life, use this!

this is a simple process of converting strings to ascii. the process involves altering the string by adding annother ascii value of a particular character from your key to the particular character from your string. not encoding, nor encrypting.

Code:
function Convert( $arg1, $arg2 )
{
	$Str = $arg1;
	$Key = $arg2;
	$ConvertedString = "";
	$Increment = 0;

	for($i = 0; $i < strlen($Str); $i++)
	{	
		$Increment += 1;
		if($Increment == strlen($Key)) { $Increment = 0; }
		$ConvertedString .= chr(~ord($Str[$i])+ord($Key[$Increment]));
	}

	return $ConvertedString;
}

application: Convert("Sexy as socks on a rooster", "Haha");

Convert(string, key)

sample results on testing:
Converting strings, properly by using key: "Haha":
Converted string: èÎ@í'íøýÜíGñÙ@@ÕñøíÓûõ
Reconverted string: Sexy as socks on a rooster

Converting strings, improperly by using a different key: "Sexy time!":
Converted string: èÎ@í'íøýÜíGñÙ@@ÕñøíÓûõ
Reconverted string: WuQ3b=3Zg›‹Ø‚,^à}s‹Lxs
 
Last edited:
Back
Top