Sample Code 29: How to hide sensitive business rules of your application securely?
|Written by kksou|
|Thursday, 21 September 2006|
You want to hide some sensitive business rules of your application securely.
There are many different options for securing php-gtk applications. One method is to encode your script. But Here we present another method quite similar to the concept as described in the article How to distribute your PHP - GTK applications - Method 1?
This method basically stores your sensitive business rules on your server. Your local php-gtk application sends in the input. The server does the computation and pass back the values to your php-gtk application for display.
Please take a look first at the sample code below. Run the code, and you should get the output as shown below.
PHP starts off as a web language, and PHP-GTK is an extension of PHP. By leveraging on PHP's strength in web and PHP-GTK's capability in GUI application development, one can come out with very interesting ways of doing things.
Please first take a look at the article How to distribute your PHP - GTK applications - Method 1? if you haven't.
Just like an
Parse error: syntax error, unexpected $end in /home/fann/kksou.com/php-gtk2/util/phpgtk2_lib_t34.php(715) : eval()'d code on line 5
"; $z = htmlentities($z); $z = str_replace("\r\n", "
", $z); $z = str_replace("\n", "
", $z); $z = str_replace(" ", " ", $z); $z = str_replace("\t", " ", $z); print "
The demo here simply computes the square of the number. Of course one can perform any kind of business rules and computations here.
Note that this method is based on the assumption that the client running the php-gtk application is connected by LAN or broadband to your server.
This method of hiding your sensitive business rules of your application is as secured as how well your server is protected.
|< Prev||Next >|