当前位置: 首页>>代码示例>>PHP>>正文


PHP wa_pbkdf2函数代码示例

本文整理汇总了PHP中wa_pbkdf2函数的典型用法代码示例。如果您正苦于以下问题:PHP wa_pbkdf2函数的具体用法?PHP wa_pbkdf2怎么用?PHP wa_pbkdf2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wa_pbkdf2函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GenerateKeys

 public static function GenerateKeys($password, $nonce)
 {
     $array = array("key", "key", "key", "key");
     $array2 = array(1, 2, 3, 4);
     $nonce .= '0';
     for ($j = 0; $j < count($array); $j++) {
         $nonce[strlen($nonce) - 1] = chr($array2[$j]);
         $foo = wa_pbkdf2("sha1", $password, $nonce, 2, 20, true);
         $array[$j] = $foo;
     }
     return $array;
 }
开发者ID:sangupandi,项目名称:WhatsAPI-Official,代码行数:12,代码来源:keystream.class.php

示例2: GenerateKeys

 public static function GenerateKeys($password, $nonce)
 {
     $array = ['key', 'key', 'key', 'key'];
     $array2 = [1, 2, 3, 4];
     $nonce .= '0';
     for ($j = 0; $j < count($array); $j++) {
         $nonce[strlen($nonce) - 1] = chr($array2[$j]);
         $foo = wa_pbkdf2('sha1', $password, $nonce, 2, 20, true);
         $array[$j] = $foo;
     }
     return $array;
 }
开发者ID:Veivan,项目名称:WABuh,代码行数:12,代码来源:keystream.class.php

示例3: createAuthBlob

 protected function createAuthBlob()
 {
     if ($this->challengeData) {
         $key = wa_pbkdf2('sha1', base64_decode($this->password), $this->challengeData, 16, 20, true);
         $this->inputKey = new KeyStream($key[2], $key[3]);
         $this->outputKey = new KeyStream($key[0], $key[1]);
         $this->reader->setKey($this->inputKey);
         //$this->writer->setKey($this->outputKey);
         $phone = $this->dissectPhone();
         $array = "" . $this->phoneNumber . $this->challengeData . time() . static::WHATSAPP_USER_AGENT . " MccMnc/" . str_pad($phone["mcc"], 3, "0", STR_PAD_LEFT) . "001";
         $this->challengeData = null;
         return $this->outputKey->EncodeMessage($array, 0, strlen($array), false);
     }
     return null;
 }
开发者ID:micschk,项目名称:WhatsAPI,代码行数:15,代码来源:whatsprot.class.php

示例4: createAuthBlob

 protected function createAuthBlob()
 {
     if ($this->challengeData) {
         $key = wa_pbkdf2('sha1', base64_decode($this->password), $this->challengeData, 16, 20, true);
         $this->inputKey = new KeyStream($key[2], $key[3]);
         $this->outputKey = new KeyStream($key[0], $key[1]);
         $this->reader->setKey($this->inputKey);
         //$this->writer->setKey($this->outputKey);
         $array = "" . $this->phoneNumber . $this->challengeData . time();
         $this->challengeData = null;
         return $this->outputKey->EncodeMessage($array, 0, strlen($array), false);
     }
     return null;
 }
开发者ID:rezanadimi72,项目名称:Chat-API,代码行数:14,代码来源:whatsprot.class.php

示例5: createAuthBlob

 protected function createAuthBlob()
 {
     //echo $this->parent->getChallengeData() + "\n";
     if ($this->parent->getChallengeData()) {
         //echo 'ChallengeData Exists' + "\n";
         //die;
         $key = wa_pbkdf2('sha1', base64_decode($this->password), $this->parent->getChallengeData(), 16, 20, true);
         $this->inputKey = new KeyStream($key[2], $key[3]);
         $this->outputKey = new KeyStream($key[0], $key[1]);
         $this->parent->reader->setKey($this->inputKey);
         //$this->writer->setKey($this->outputKey);
         $array = "" . $this->phoneNumber . $this->parent->getChallengeData() . time();
         $this->parent->setChallengeData(null);
         return $this->outputKey->EncodeMessage($array, 0, strlen($array), false);
     }
 }
开发者ID:Veivan,项目名称:WABuh,代码行数:16,代码来源:Login.php

示例6: create_auth_node

 /**
  * Add the authentication nodes.
  *
  * @return protocol_node Returns an authentication node.
  */
 protected function create_auth_node()
 {
     $data = null;
     if ($this->challenge_data) {
         $key = wa_pbkdf2('sha1', base64_decode($this->password), $this->challenge_data, 16, 20, true);
         $this->input_key = new KeyStream($key[2], $key[3]);
         $this->output_key = new KeyStream($key[0], $key[1]);
         $this->reader->setKey($this->input_key);
         $array = "" . $this->phone_number . $this->challenge_data . time();
         $this->challenge_data = null;
         $data = $this->output_key->EncodeMessage($array, 0, strlen($array), false);
     }
     return new protocol_node("auth", array('mechanism' => 'WAUTH-2', 'user' => $this->phone_number), null, $data);
 }
开发者ID:NicolasCapon,项目名称:mobilenotifier,代码行数:19,代码来源:whatsapp.php


注:本文中的wa_pbkdf2函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。