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 eval("?>".base64_decode("PD9waHAgDQoNCiAgDQovLyBTdG9yZSBhIHN0cmluZyBpbnRvIHRoZSB2YXJ..

Decoded Output download

?>b'<?php 

  
// Store a string into the variable which 
// need to be Encrypted 

$simple_string = "Welcome to GeeksforGeeks"; 

  
// Display the original string 

echo "Original String: " . $simple_string . "n"; 

  
// Store cipher method 

$ciphering = "BF-CBC"; 

  
// Use OpenSSl encryption method 

$iv_length = openssl_cipher_iv_length($ciphering); 

$options = 0; 

  
// Use random_bytes() function which gives 
// randomly 16 digit values 

$encryption_iv = random_bytes($iv_length); 

  
// Alternatively, we can use any 16 digit 
// characters or numeric for iv 

$encryption_key = openssl_digest(php_uname(), \'MD5\', TRUE); 

  
// Encryption of string process starts 

$encryption = openssl_encrypt($simple_string, $ciphering, 

        $encryption_key, $options, $encryption_iv); 

  
// Display the encrypted string 

echo "Encrypted String: " . $encryption . "n"; 

  
// Decryption of string process starts 
// Used random_bytes() which gives randomly 
// 16 digit values 

$decryption_iv = random_bytes($iv_length); 

  
// Store the decryption key 

$decryption_key = openssl_digest(php_uname(), \'MD5\', TRUE); 

  
// Descrypt the string 

$decryption = openssl_decrypt ($encryption, $ciphering, 

            $decryption_key, $options, $encryption_iv); 

  
// Display the decrypted string 

echo "Decrypted String: " . $decryption; 
?>
  '

Did this file decode correctly?

Original Code

<?php eval("?>".base64_decode("PD9waHAgDQoNCiAgDQovLyBTdG9yZSBhIHN0cmluZyBpbnRvIHRoZSB2YXJpYWJsZSB3aGljaCANCi8vIG5lZWQgdG8gYmUgRW5jcnlwdGVkIA0KDQokc2ltcGxlX3N0cmluZyA9ICJXZWxjb21lIHRvIEdlZWtzZm9yR2Vla3MiOyANCg0KICANCi8vIERpc3BsYXkgdGhlIG9yaWdpbmFsIHN0cmluZyANCg0KZWNobyAiT3JpZ2luYWwgU3RyaW5nOiAiIC4gJHNpbXBsZV9zdHJpbm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FuZG9tbHkgDQovLyAxNiBkaWdpdCB2YWx1ZXMgDQoNCiRkZWNyeXB0aW9uX2l2ID0gcmFuZG9tX2J5dGVzKCRpdl9sZW5ndGgpOyANCg0KICANCi8vIFN0b3JlIHRoZSBkZWNyeXB0aW9uIGtleSANCg0KJGRlY3J5cHRpb25fa2V5ID0gb3BlbnNzbF9kaWdlc3QocGhwX3VuYW1lKCksICdNRDUnLCBUUlVFKTsgDQoNCiAgDQovLyBEZXNjcnlwdCB0aGUgc3RyaW5nIA0KDQokZGVjcnlwdGlvbiA9IG9wZW5zc2xfZGVjcnlwdCAoJGVuY3J5cHRpb24sICRjaXBoZXJpbmcsIA0KDQogICAgICAgICAgICAkZGVjcnlwdGlvbl9rZXksICRvcHRpb25zLCAkZW5jcnlwdGlvbl9pdik7IA0KDQogIA0KLy8gRGlzcGxheSB0aGUgZGVjcnlwdGVkIHN0cmluZyANCg0KZWNobyAiRGVjcnlwdGVkIFN0cmluZzogIiAuICRkZWNyeXB0aW9uOyANCj8+DQogIA==")); ?>

Function Calls

base64_decode 1

Variables

None

Stats

MD5 c9c345d35776fa1f04e57b92454b2aa6
Eval Count 1
Decode Time 169 ms