php code encryption 1,but not support chinese

PHP code encryption and solutions, but does not support Chinese.


最好使用Zend Guard工具


<?php
/*
@ Name  :PHP Encryption/decryption  
@ Update  :2009 The September 2005  22 Day   20:23:47
*/
function phpencode($code) {
        $code = str_replace(array('<?php','?>','<?PHP'),array('','',''),$code);
        $encode = base64_encode(gzdeflate($code)); //  Start coding  
        $encode = '<?php'."\neval(gzinflate(base64_decode("."'".$encode."'".")));\n?>";
        return $encode;
}

function phpdecode($code) {
        $code = str_replace(array('<?php','<?PHP',"eval(gzinflate(base64_decode('","')));",'?>'),array('','','','','',''),$code);
        $decode = base64_decode($code);
        $decode = @gzinflate($decode);
        return $decode;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Encryption/decryption  </title>
<style type="text/css" media="all">
        html, body {
                margin: 0;padding: 0; 
        }
        
        body {
                color: #333;
                font: 12px Tahoma,Lucida Grande, sans-serif;
                margin: 9%;
        }
        
        a {
                color: #0055CC; 
        }
        
        img {
                border: 0px solid #CCC;
        }
        
        h1 {
                margin: 0;
        }
        
        h3 {
                color: #555;
                font-size: 1.6em;
                font-weight: normal;
                margin: 0; 
        }
        
        pre {
                color: #0055CC;
                font-size: 1.1em;
                line-height: 1.2;
                margin: 0.25em 0; 
        }
        
        p {
                margin: 0.65em 0;
        }
        
        #ads {
                border-left: 1px solid #eee;
                float: right;
                margin: 0 0 2em 2.5em;
                padding-left: 3px;
                width: 160px;
        }
        
        #source {
                margin-bottom: 2.5em; 
        }
        
        pre {
                overflow: auto;
                padding:1em 0; 
        }
        
        h2 {
                position: relative;
                top: 0.5em;
        }
</style>
</head>

<body>

        <h3>PHP Encryption/decryption  </h3>
        <form method="post">
                <textarea name="source" cols="55" rows="8">
                <?php
                if(!empty($_POST['source'])) {
                        if($_POST['button']==' Encryption  ') {
                                echo htmlspecialchars(phpencode(stripcslashes($_POST['source'])));
                        }
                        if($_POST['button']==' Decryption  ') {
                                echo htmlspecialchars(phpdecode(stripcslashes($_POST['source'])));
                        }
                }
                ?>
                </textarea>

                <?php
                if(!empty($_POST['source'])){
                        if($_POST['button']==' Encryption  ') {
                                echo '<br /><br /> Encryption successfully  .';
                        }
                        if($_POST['button']==' Decryption  ') {
                                echo '<br /><br /> Decrypt success  .';
                        }
                }else{
                        echo '<br /><br /> Use base64 + gzinflate on your  PHP Code is compressed, can to some extent, protect your code copyright and reduce the volume of code  .';
                }
                ?>

                <br /><br />
                <input type="submit" name="button" value=" Encryption  ">
                <input type="submit" name="button" value=" Decryption  ">
        </form>

</body>
</html>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值