コード例 #1
0
ファイル: rsa.php プロジェクト: foolin/myblog_article_code
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";
}