Encryption:

To use this module it is only required to enable it and set the encryption key that will be used to salt the data. If the module is enabled all other modules will now return the data in the encryption format.

      Explanation : Collect encrypted data from the demo module
      Example 1   : http://162.55.190.80/api.php?username=demo&password=demo&module=demo
      Result      : [DATA]

Decryption:

To decrypt the encrypted data you can us the following function:

      function api_decrypt_data($data, $key) {
        $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
        $iv      = mcrypt_create_iv($iv_size, MCRYPT_RAND);
        $res     = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $data, MCRYPT_MODE_ECB, $iv);
        return $res;
      }