you can use these functions to encrypt/decrypt your data
function rsa_encrypt($yourPublickey, $message) { $rsa = new Crypt_RSA(); $rsa->loadKey($yourPublickey); $encrypted = urlencode(base64_encode($rsa->encrypt($message))); return $encrypted; } function rsa_decrypt($yourPrivatekey, $cryptedData) { $rsa = new Crypt_RSA(); $rsa->loadKey($yourPrivatekey); $decrypted = $rsa->decrypt((base64_decode($cryptedData))); return $decrypted; }