function main($crypted) { $rsa = new Rsa(); if ($crypted) { $crypted = base64_decode($crypted); } else { $crypted = $rsa->rsaEncrypt("*****@*****.**"); echo "encrypt base64:" . base64_encode($crypted) . "\n"; } $decrypted = $rsa->rsaDecrypt($crypted); echo "encrypt and decrypt:" . $decrypted . "\n"; }