Skip to content
WJunction - Webmaster Forum

Simple php encoder by NewEraCracker

Status
Not open for further replies.
I was bored and decided to make this small php script to encode and decode :)

PHP:
SiMPLE PHP ENCODER BY NEWERACRACKER [v0.0.5]<br/>
<br/>
Encoding: base64_encode(gzdeflate($text,9));<br/>
Decoding: gzinflate(base64_decode($text));<br/>
<br/>
<form action="" method="post">
	<textarea name="text" cols=100 rows=20></textarea>
	<br/>Encode <input type="radio" name="type" value="encode" checked> | <input type="radio" name="type" value="decode"> Decode
	<br/><input type="submit" value="Go !" name="submitcmd"/>
</form><br/>		

<?php
if (isset($_POST['text']) && isset($_POST['type']))
{
	$text = get_magic_quotes_gpc() ? stripslashes($_POST['text']) : $_POST['text'];

	if ($_POST['type']=='encode')
	{
		$encoded = base64_encode(gzdeflate($text,9));
		echo 'DECODED: <br/><textarea cols=100 rows=5>'.htmlspecialchars($text).'</textarea><br/>';
		echo 'ENCODED: <br/><textarea cols=100 rows=5>'.htmlspecialchars($encoded).'</textarea><br/>';
	}
	elseif ($_POST['type']=='decode')
	{
		$decoded = gzinflate(base64_decode($text));
		echo 'ENCODED: <br/><textarea cols=100 rows=5>'.htmlspecialchars($text).'</textarea><br/>';
		echo 'DECODED: <br/><textarea cols=100 rows=5>'.htmlspecialchars($decoded).'</textarea><br/>';
	}
}
?>
 

12 comments

Nice share buddy, was in serious need of this! Now i too can decode and encode things!!

Thanks again :)
 
lol what i am asking is, Why? :blink:

IMO its stupid to do this, even a noob can *decode* it. Just useless bloat 8-)

You guys are mistaking compression with encryption :blink:
 
Last edited:
It's actually just encoded compressed text.

Lots of scripts do this, mostly wordpress footers and such. Newbies don't understand it when they see a huge base64 string so they leave it alone. It works better than having just a html footer anyone can remove.
 
It's actually just encoded compressed text.

Lots of scripts do this, mostly wordpress footers and such. Newbies don't understand it when they see a huge base64 string so they leave it alone. It works better than having just a html footer anyone can remove.

Ah yeah :p
Though all they have to do is, replace 'eval' with 'echo', tada! XD

@localhost, No didn't knew that, Thx. But it doesn't base64 encode :p It compiles php source into bytecode, which makes sense ;)

@Netguy, with the above method: Yes. With ionCube: No, faster performance instead ;)
 
Status
Not open for further replies.

About the author

NewEraCracker
Senior Member · Joined
The Cracker of New Era
1,335
Messages
203
Reactions
63
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom