當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。