isError()) { $error = $obj->getLastError(); switch ($error->getCode()) { case CRYPT_RSA_ERROR_WRONG_TAIL : // nothing to do break; default: // echo error message and exit echo 'error: ', $error->getMessage(); exit; } } } $key_pair = new Crypt_RSA_KeyPair(128); check_error($key_pair); $public_key = $key_pair->getPublicKey()->toHex(); $private_key = $key_pair->getPrivateKey()->toHex(); ?> AJAX Secure Commnication

Test Form

Username
Password

AJAX CALL