Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>mcrypt allows me to encrypt the data transmitted via GET. (thanks to @dAm2K)</p> <p>The base64_encode is not enough to make the encrypted date URL friendly as it include ("+","/" and "=" characters) (thanks to @DavidThomas)</p> <p>I used str_replace to replace those 3 characters and everything is working fine.</p> <p>Here's the corrected code for the intranet server:</p> <pre><code>/* WEBSERVER1 */ $ORDER=$_GET['ORDER']; $EZAB=$_GET['EZAB']; $IP=$_GET['IP']; $ARRAY = array( "ORDER" =&gt; $ORDER, "EZAB" =&gt; $EZAB, "IP" =&gt; $IP); $SERIAL=serialize($ARRAY); $M=mcrypt_module_open('rijndael-256','','cbc',''); $KEY=md5("gi7aesawde2zomspgo8guvivmer8oici"); $IV=md5("dob1depatodop7lipdaig7bebeaion9d"); mcrypt_generic_init($M,$KEY,$IV); $ENCRYPTEDDATA=mcrypt_generic($M,$SERIAL); mcrypt_generic_deinit($M); mcrypt_module_close($M); $q=base64_encode($ENCRYPTEDDATA); $q=str_replace(array('+','/','='),array('-','_','.'),$q); $URL="http://mywebsite/?q=".$q; $EXCELHYPERLINK='=hyperlink("'.$URL.'")'; </code></pre> <p>and for the webserver :</p> <pre><code>/* WEBSERVER2 */ $q=$_GET['q']; $q=str_replace(array('-','_','.'),array('+','/','='),$q); $ENCRYPTEDDATA=base64_decode($q); $M=mcrypt_module_open('rijndael-256','','cbc',''); $KEY=md5("gi7aesawde2zomspgo8guvivmer8oici"); $IV=md5("dob1depatodop7lipdaig7bebeaion9d"); mcrypt_generic_init($M,$KEY,$IV); $SERIAL=mdecrypt_generic($M,$ENCRYPTEDDATA); mcrypt_generic_deinit($M); mcrypt_module_close($M); $ARRAY=unserialize($SERIAL); // Do something... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload