PHP code verschlüsseln

#0
08.11.2006, 19:49
Member
Avatar Xeper

Beiträge: 5291
#16 google und wikipedia helfen:

http://de.wikipedia.org/wiki/GNU_Compiler_Collection
__________
E-Mail: therion at ninth-art dot de
IRC: megatherion @ Freenode
Seitenanfang Seitenende
04.04.2007, 13:37
...neu hier

Beiträge: 1
#17 Meinst du sowas:

Code

<?php
/************************************************
PHP SOURCE CODE ENCRYPTER BY ReZEN of XORCREW

Takes ANY php source file and encrypts it.  When you try to access
the new file your asked for a username and pass. You can use ANY
username you want but the pass has to be the same password you used to
encrypt it if you give it the right pass it then decrypts the file and you
are able to access it.
************************************************/

if(!isset($_POST['submit'])){

    echo '<table><form action="'.$PHP_SELF.'" method="post">'
    .'<tr><td><b>File:</b></td><td><input name="file" type="text" size="38"></td></tr>'
    .'<tr><td><b>Password For File:</b></td><td><input name="auth" type="password" size="38"></td></tr>'
    .'<tr><td><input type="submit" name="submit" value="Encrypt It!"></form></td></tr></table>';

} else {

    function easy_crypt($string, $key){
        $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC);
        $iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM);
        $string = mcrypt_encrypt(MCRYPT_BLOWFISH, $key,
        $string, MCRYPT_MODE_CBC, $iv);
        return array(base64_encode($string), base64_encode($iv));
    }

    function decrypt($cyph_arr, $key){
        $out = mcrypt_decrypt(MCRYPT_BLOWFISH, $key,
        base64_decode($cyph_arr[0]),
        MCRYPT_MODE_CBC, base64_decode($cyph_arr[1]));
        return trim($out);
    }

    $file = $_POST['file'];
    $contents = file_get_contents($file);
    $contents = str_replace('<'.'?php','<'.'?',$contents);
    $contents = '?'.'>'.trim($contents).'<'.'?';
    $code = $_POST['auth'];
    $pass = sha1($_POST['auth']);
    $cyph = easy_crypt($contents, $code);

    $source = "
    <?php

    function decrypt(\$cyph_arr, \$key){
    \$out = mcrypt_decrypt(MCRYPT_BLOWFISH, \$key,
    base64_decode(\$cyph_arr[0]),
    MCRYPT_MODE_CBC, base64_decode(\$cyph_arr[1]));
    return trim(\$out);
    }

    if (!isset(\$_SERVER['PHP_AUTH_USER'])) {
    header('WWW-Authenticate: Basic realm="Encrypted"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Maybe Next Time Skid.';
    exit;
    
    }else{

    \$code = \$_SERVER[’PHP_AUTH_PW’];
    \$cyph[0] = "".$cyph[0]."";
    \$cyph[1] = "".$cyph[1]."";
    \$dec = decrypt(\$cyph, \$code);
    eval(\$dec);
    }
    ?>
    ";

    $name = explode(".", $file);
    $encfile = "enc-".$name[0].".php";
    $f = fopen($encfile, 'w+') or die("Error!!");
    fwrite($f, $source);
    fclose($f);
    echo "File ".$encfile." encrypted successfully!";

}
?>
Seitenanfang Seitenende
Um auf dieses Thema zu ANTWORTEN
bitte erst » hier kostenlos registrieren!!

Folgende Themen könnten Dich auch interessieren: