明码:abcd123暗码:7683513b29093c0c请问这中间是通过什么加密方式?

解决方案 »

  1.   


    <?php
    /*
    @名称:PHP加密/解密
    */
    function phpencode($code) {
    $code = str_replace(array('<?php','?>','<?PHP'),array('','',''),$code);
    $encode = base64_encode(gzdeflate($code));// 开始编码
    $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>
    <html lang="zh-CN">
    <meta charset="utf-8">
    <title>PHP加密/解密</title>
    <link rel="alternate" title=" " href="http://feeds.feedburner.com/feeds/rss"type="application/rss+xml" />
    <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>
    <h3>PHP加密/解密</h3>
    <form method="post">
    <textarea name="source" cols="55" rows="8">
    <?php
    if(!empty($_POST['source'])) {
    if($_POST['button']=='加密') {
    echo htmlspecialchars(phpencode(stripcslashes($_POST['source'])));
    }
    if($_POST['button']=='解密') {
    echo htmlspecialchars(phpdecode(stripcslashes($_POST['source'])));
    }
    }
    ?>
    </textarea>
    <?php
    if(!empty($_POST['source'])){
    if($_POST['button']=='加密') {
    echo '<br /><br />加密成功.';
    }
    if($_POST['button']=='解密') {
    echo '<br /><br />解密成功.';
    }
    }else{
    echo '<br /><br />利用 base64+gzinflate 对您的PHP代码进行压缩,可以一定程度上保护您的代码版权和减小代码的体积。';
    }
    ?>
    <br /><br />
    <input type="submit" name="button" value="加密">
    <input type="submit" name="button" value="解密">
    </form>