Thursday 28 February 2013

Base 64 Encode And Decode

<?php
/*
*    By Afnum Vvip
*    in decode you can put <?php or evrything in it like
*    <?php  eval(base64_decode('YWZudW0gaGVuc2Vt'));  ?>
*    it can decode it for you :D
*/
?>
<head>
<title>Base 64</title>
</head>
<body bgcolor="#333">
<style>
a{
    color:#fff;
    font-size:21px
}
a:link{
    color:#FFF;
    font-size:21px
}
a:visited{
    color:#FFF
    font-size:21px
}
h1{
    color:#FFF
   
}

</style>
<table align="center" border="2px" bordercolor="#fff" width="100%" bgcolor="#333">
<center><th><a  href="?do=encode" title="Encode Your Script">Encode</a></th><th><a  href="?" title="Encode Your Script">Home</a></th><th><a href="?do=decode" title="Decode Your Script">Decode</a></th></center></table><br />

<?php
$f = array('<?php', '<?' , 'eval', '(', ')', 'base64_decode', '\'', ';', '?>');

switch($_GET['do'])
{
case encode:
    echo
    '
    <center><h1>Base64 Encode</h1><br />
    <form method="post">
    <textarea name="str" style=" height: 160px;  width: 653px; ">'.htmlentities(stripslashes($_POST["str"])).'</textarea><br /><br />
    <input type="submit" name="submit" value="Encode! " />
    </form><br /></center>
    ';
    $submit = $_POST['submit'];
    $str = $_POST['str'];
   
    doencode($_POST['submit'], $_POST['str']);

   
break;
case decode:
    echo
    '
    <center><h1>Base64 Decode</h1><br />
    <form method="post">
    <textarea name="dec" style=" height: 160px;  width: 653px; ">'.htmlentities(stripslashes($_POST["dec"])).'</textarea><br /><br />
    <input type="submit" name="submitt" value="Decode! " />
    </form><br /></center>
    ';
    $submitt = $_POST['submitt'];
    $dec = $_POST["dec"];
   
    dodecode();
break;
default:
echo
"
<center>
<font color='#FFF' size='5px'><br /><br /><br /><br /><br /><br /><br /><b><pre>
__________                           ________  _____ 
\______   \_____    ______  ____    /  _____/ /  |  |
 |    |  _/\__  \  /  ___/_/ __ \  /   __  \ /   |  |_
 |    |   \ / __ \_\___ \ \  ___/  \  |__\  |    ^   /
 |______  /(____  /____  > \___  >  \_____  |____   |
        \/      \/     \/      \/         \/     |__|
</pre></b></font>
</center>
";


}



function doencode(){
global $submit, $str;
    if($submit && !$str){
        echo "<script>alert('Y U NO Fill The Box ????')</script>";       
    }
    else if ($submit && !empty($str)){
        $strs = htmlentities($str);
        $enc = base64_encode($str);
        echo '<hr /><center><h1>Base64 Encoded</h1><br /><textarea style=" height: 160px;  width: 653px; " readonly>';
        echo "<?php  eval(base64_decode('$enc'));  ?>";
        echo '</textarea></center>';
    }
}

function dodecode(){
global $submitt, $dec, $f;
    if($submitt && !$dec){
        echo "<script>alert('Y U NO Fill The Box ????')</script>";       
    }
    else if ($submitt && !empty($dec)){
        $decode = str_ireplace($f, '', $dec);
        $deco  = base64_decode($decode);
        $html = htmlentities(stripslashes($deco));
        echo '<hr /><center><h1>Base64 Decoded</h1><br /><textarea style=" height: 160px;  width: 653px; " readonly>';
        echo $html;
        echo '</textarea></center>';
    }
}


?>
</body>

0 comments:

Post a Comment