How to write a basic encryption and pass it to the client?
Posted: Sat Aug 09, 2008 6:43 pm
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
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