Hi,
I've been curious about encryption, and how to apply that to PHP.
Well, basically what I want to do is have client data such as a variable get sent to my xml-rpc server. I want the server to decrypt the data.
How would i go upon doing this?
Heres how the client code works:
<?php
$data = xu_rpc_http_concise(
array(
'method' => "server_version",
'host' => $host,
'uri' => $uri,
'port' => 80
)
);
function decrypt_data($param) {
// decrypt the data string...
}
print "Decrypted Data: $data";
?>
Ok heres the server code:
function server_version($method_name,$params,$app_data)
{
// now lets just say this string is encrypted.... - but its not!
$encrypted = "2342384928ejfkjsd";
return $encrypted;
}
So how would I go upon doing this? can you provide me a basic encryption code that will be able to have the server data encrypt and then be decrypted on the client side?
Much Appreciated,
Aric Holland
How to write a basic encryption and pass it to the client?
Moderator: General Moderators
-
Aric_Holland
- Forum Newbie
- Posts: 5
- Joined: Sat Aug 09, 2008 6:23 pm
- Location: Maui, HI
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: How to write a basic encryption and pass it to the client?
1. Secret key encryption
2. Public key encryption
SSL, Blowfish are two keywords for you to Google.
2. Public key encryption
SSL, Blowfish are two keywords for you to Google.
Re: How to write a basic encryption and pass it to the client?
PHP contains builtin functions for encryption and decription: mcrypt_encrypt and mcrypt_decrypt