// http://www.andrewpeace.com/rsajax // See LICENSE for licensing details session_start(); include_once('rsa.class.php'); include_once('rc4.php'); $rsajax_client_key = null; //add your own RSA keys! $rsajax_server_n = '118875288768814652586025854280572001693'; $rsajax_server_e = '40797132761883902031985546546799803063'; $rsajax_server_d = '30269809769178569242659846420167687183'; //$rsajax_server_n = '89288702738936233943675542606633455191'; //$rsajax_server_e = '46836301345325511454284323197610499223'; //$rsajax_server_d = '72423556884853502671666319943495241519'; $RSA = new RSA(); //if client key is already stored in the session if(isset($_SESSION['s_rsajax_client_key'])) { $rsajax_client_key = $_SESSION['s_rsajax_client_key']; } //returns the given value decrypted with the server's private key function rsajax_decrypt($value) { global $RSA; global $rsajax_server_n; global $rsajax_server_d; return $RSA->decrypt($value, $rsajax_server_d, $rsajax_server_n); } //returns the given value encrypted with the client's public key function rsajax_encrypt($value) { global $rsajax_client_key; return rc4Encrypt($rsajax_client_key, $value); } ?>