Ignore:
Timestamp:
Jul 15, 2016, 1:24:05 PM (3 years ago)
Author:
joamuran
Message:

Added aes encryption for n4d answers

Location:
admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center
Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/lib/utils.js

    r2140 r2185  
    465465                        method: n4dmethod,
    466466                        args: Utils.crypt.encrypt(JSON.stringify(n4dargs)),
     467                        pass: sessionStorage.password,
    467468                        timeout: timeout},
    468469                //args: n4dargs},
    469                 success: function(ret){
    470                          callback(ret);
     470                success: function(ret_coded){
     471                        console.log(ret_coded);                 
     472                        ret_str=(CryptoJS.AES.decrypt(JSON.stringify(ret_coded), sessionStorage.password,{format: CryptoJSAesJson}).toString(CryptoJS.enc.Utf8));
     473                        ret=JSON.parse(JSON.parse(ret_str));
     474                        callback(ret);
    471475                },error(){
    472476                        msg=_("N4d.Error.Connection");
  • admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/login.php

    r2115 r2185  
    3535        <!--script type="text/javascript" src="lib/bootstrap-design/js/material.min.js"></script-->
    3636        <script type="text/javascript" src="lib/bootstrap-material-design/js/material.min.js"></script>
     37       
     38        <script type="text/javascript" src="lib/cryptojs-aes/aes.js"></script>
     39    <script type="text/javascript" src="lib/cryptojs-aes/aes-json-format.js"></script>
    3740
    3841
  • admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/main.php

    r2160 r2185  
    2323importCommonLibraries();
    2424importCommonScripts();
     25
    2526echo ("</body>");
    2627echo ("</html>");
     28
     29
    2730
    2831/*  Main Functions  */
     
    98101  echo ('<script type="text/javascript" src="lib/utils.js"></script>');
    99102  echo ('<script type="text/javascript" src="lib/progressbarjs/progressbar.min.js"></script>');
     103  echo ('<script type="text/javascript" src="lib/cryptojs-aes/aes.js"></script>');
     104  echo ('<script type="text/javascript" src="lib/cryptojs-aes/aes-json-format.js"></script>');
     105 
     106 
    100107};
    101108
  • admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/n4d.php

    r2140 r2185  
    11<?php
     2include("./libphp/cryptojs-aes.php");
     3
    24//require_once("logServer.php"); -> No s'usa!
    35//require_once('php_lib/wsclient/vendor/autoload.php'); -> No s'usa !
     
    3537 
    3638  return $newsource;
     39}
     40
     41function AESEncrypt($plain){ 
     42  if (isset($_POST['pass'])) $pass=$_POST['pass'];
     43  else $pass=""; 
     44  return cryptoJsAesEncrypt($pass, $plain);
    3745}
    3846
     
    7381      $xml_snippet=simplexml_load_string($data);
    7482      $json=json_encode($xml_snippet);
    75       echo ($json);
     83      echo (AESEncrypt($json));
    7684    } else {
    7785        $xmlobj=xmlrpc_decode($data);
     
    8088       
    8189        $json=json_encode($xmlobj);
    82         var_error_log($data);
    83         var_error_log($xmlobj);
    84         var_error_log($json);
    8590        if ($json=="") {
    8691          $json=$xmlobj;}
    87           //error_log($json);
    88           var_error_log($json);
    89         echo ($json);
     92        echo (AESEncrypt($json));
    9093    }
    9194 
Note: See TracChangeset for help on using the changeset viewer.