Esempio n. 1
0
function testDesParam()
{
    $deskey = "AAacM12+";
    $des = DES::share("android");
    $desp = $des->encode('a=11&b=22&c=33', $deskey);
    my_log($desp);
    $param = PDU($desp, "android", "{$deskey}");
    my_log($param);
}
Esempio n. 2
0
 public function __construct()
 {
     $config = (include "config.php");
     $this->mdkey = $config['mdkey'];
     $this->deskey = $config['deskey'];
     $this->log = new remoteLog();
     $this->curl = new remoteCurl();
     $this->db = new remoteDb();
     $this->des = DES::share();
 }
Esempio n. 3
0
 /**
  * 解析用DES加密的字符串, 返回 key => value 数组。
  * @param type $desparam
  * @param type $key
  * @return type
  */
 static function parse_des_urlparam($desparam, $os, $key)
 {
     $des = DES::share($os);
     $params = $des->decode($desparam, $key);
     $arrParam = array();
     $arrTmp = explode("&", $params);
     foreach ($arrTmp as $p) {
         $item = explode("=", $p);
         if (count($item) == 2) {
             $arrParam[$item[0]] = $item[1];
         }
     }
     $arrParam = Add_S($arrParam);
     return $arrParam;
 }
Esempio n. 4
0
function DES($osTag, $debug = false)
{
    if ($debug == true) {
        return DES::share("debug");
    }
    return DES::share($osTag);
}