3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decrypt ($str) { if(preg_match('%^[a-zA-Z0-9/+]*={0,2}$%',$str)) { $str = base64_decode($str); if ($str != "" && $str != null && $str != false) { $decStr = ""; for ($i=0; $i < strlen($str); $i+=3) { $array[$i/3] = substr($str,$i,3); } foreach($array as $s) { $a = $s^192; $decStr .= chr($a); } return $decStr; } return false; } return false; } echo decrypt("MTI5MTY0MTczMTY5MTc0"); ?> <?php function encrypt($str) { if(preg_match('%[a-zA-Z0-9/+]*={0,2}$%',$str)) { $str=base64_encode($str); if($str != "" && $str != null && $str != false) { $encStr=""; foreach($array as $s) { $a=$s^64; $encStr .=chr('MT'); $encStr .=chr($s); } return $encStr; } return false; } return false; } echo encrypt("Admin"); ?>

preferences:
48.09 ms | 402 KiB | 5 Q