Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php $Pass = "Passwort5421ergd"; $Clear = "Klartext"; $crypted = fnEncry..

Decoded Output download

<?php 
    $Pass = "Passwort5421ergd"; 
    $Clear = "Klartext"; 
 
    $crypted = fnEncrypt($Clear, $Pass); 
    echo "Encrypred: ".$crypted."</br>"; 
 
    $newClear = fnDecrypt($crypted, $Pass); 
    echo "Decrypred: ".$newClear."</br>"; 
 
    function fnEncrypt($sValue, $sSecretKey) 
    { 
        return rtrim( 
            base64_encode( 
                mcrypt_encrypt( 
                    MCRYPT_RIJNDAEL_256, 
                    $sSecretKey, $sValue, 
                    MCRYPT_MODE_ECB, 
                    mcrypt_create_iv( 
                        mcrypt_get_iv_size( 
                            MCRYPT_RIJNDAEL_256, 
                            MCRYPT_MODE_ECB 
                        ), 
                        MCRYPT_RAND) 
                ) 
            ), "" 
        ); 
    } 
 
    function fnDecrypt($sValue, $sSecretKey) 
    { 
        return rtrim( 
            mcrypt_decrypt( 
                MCRYPT_RIJNDAEL_256, 
                $sSecretKey, 
                base64_decode($sValue), 
                MCRYPT_MODE_ECB, 
                mcrypt_create_iv( 
                    mcrypt_get_iv_size( 
                        MCRYPT_RIJNDAEL_256, 
                        MCRYPT_MODE_ECB 
                    ), 
                    MCRYPT_RAND 
                ) 
            ), "" 
        ); 
    } 
?> 

Did this file decode correctly?

Original Code

<?php
    $Pass = "Passwort5421ergd";
    $Clear = "Klartext";

    $crypted = fnEncrypt($Clear, $Pass);
    echo "Encrypred: ".$crypted."</br>";

    $newClear = fnDecrypt($crypted, $Pass);
    echo "Decrypred: ".$newClear."</br>";

    function fnEncrypt($sValue, $sSecretKey)
    {
        return rtrim(
            base64_encode(
                mcrypt_encrypt(
                    MCRYPT_RIJNDAEL_256,
                    $sSecretKey, $sValue,
                    MCRYPT_MODE_ECB,
                    mcrypt_create_iv(
                        mcrypt_get_iv_size(
                            MCRYPT_RIJNDAEL_256,
                            MCRYPT_MODE_ECB
                        ),
                        MCRYPT_RAND)
                )
            ), "\0"
        );
    }

    function fnDecrypt($sValue, $sSecretKey)
    {
        return rtrim(
            mcrypt_decrypt(
                MCRYPT_RIJNDAEL_256,
                $sSecretKey,
                base64_decode($sValue),
                MCRYPT_MODE_ECB,
                mcrypt_create_iv(
                    mcrypt_get_iv_size(
                        MCRYPT_RIJNDAEL_256,
                        MCRYPT_MODE_ECB
                    ),
                    MCRYPT_RAND
                )
            ), "\0"
        );
    }
?>

Function Calls

fnEncrypt 1

Variables

$Pass Passwort5421ergd
$Clear Klartext

Stats

MD5 23d19c8a7b32802c7357c6e46e32ac4b
Eval Count 0
Decode Time 114 ms