This tool will encrypt any PHP script using Base 64 encoding technique to secure your work or application.
To get started, Please copy and paste your PHP script in the text area space provided at the demonstration area.
I strongly advice you to start your code with the openning of PHP ("<?php") and end it with the closing of PHP ("?>"), to avoid any encoding errors.
After your code has been encrypted, copy it and paste on your page to see the encypted code in action.
Download
Live Demo
Example PHP script to encrypt and its encrypted result are shown below:
Code:
<?php
$user =
"Boy";
if(
$user ==
"Boy")
{
echo 'User is a boy<br />';
}
else
{
echo 'User is a girl<br />';
}
//RESULT
eval(gzinflate(base64_decode('41IpLU4tUrBVUHLKr1Sy5uXKTNOACkHFNBWqFVKTM/IV1ENBwpnFCokKSfmV6tYKtbxcqTnFqVjk0zOLciAKAA==')));
?>
Section of code that does the encryption:
<?php
//Check if the form has been submitted
if ($_POST["encrypt_this_code_now_by_vasPLUS_Programming_Blog"] == "yes")
{
if($_POST['code_to_encrypt'] == "")
{
echo "Please copy and paste your php source code that you wish to encrypt in the text area space provided below to proceed.";
}
else
{
//Form has been submitted
$_s_encrypt_this_code=$_POST['code_to_encrypt'];
$_s_encrypt_this_code=stripslashes($_s_encrypt_this_code);
//Remove space
$_s_encrypt_this_code=trim($_s_encrypt_this_code);
//Count string
$_s_countString=strlen($_s_encrypt_this_code);
$_s_lastString=$_s_countString-4;
$_s_restString = substr($_s_encrypt_this_code, 2, $_s_lastString);
$_s_codeDisplay= substr($_s_restString, 4);
$_s_strings= $_s_codeDisplay;
$_s_codeCompression = gzdeflate($_s_strings, 9);
$_s_encodeString = base64_encode($_s_codeCompression);
$_s_stringEncoded = "<"."?"."php".'
'.'eval(gzinflate(base64_decode('.'''.$_s_encodeString.'''.')));'.'
'.'?'.'>';
}
}
?>