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


PHP Crypto::aesDecrypt方法代码示例

本文整理汇总了PHP中Crypto::aesDecrypt方法的典型用法代码示例。如果您正苦于以下问题:PHP Crypto::aesDecrypt方法的具体用法?PHP Crypto::aesDecrypt怎么用?PHP Crypto::aesDecrypt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Crypto的用法示例。


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

示例1: getSHOST

    $url = getSHOST() . "?mode=daterange&range=" . $from . ":" . $to . "&token=" . $_COOKIE['token'];
    //echo $url."<br>";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_REFERER, "www.google.com");
    $body = curl_exec($ch);
    curl_close($ch);
    //echo $body;
    $crypto = new Crypto($_COOKIE['keymas']);
    $json = json_decode($body);
    $choices = $json->choices;
    echo "<h4 style='color:white;text-decoration:bold;'>Select from These Choices</h4><br><form action='#' method='post'>";
    echo "<select name='choices[]' style='width:300px'>";
    for ($i = 0; $i < count($choices); $i++) {
        $msg = $crypto->aesDecrypt(utf8_decode($choices[$i]->result));
        $size = $choices[$i]->size;
        $branches = implode(":", $choices[$i]->branches);
        $rbvalue = implode(";", array($choices[$i]->id, $size, $branches));
        echo "<option value='" . $rbvalue . "'>" . $msg . "</option>";
    }
    echo "</select><br>";
    ?>
<br><input type="submit" class="btn" value='Submit' name='submit3'></input></form></div>
		<?php 
} else {
    if (isset($_POST["submit3"])) {
        echo "<div class='dashboard'>";
        require_once "classes.php";
        require_once "settings.php";
        $choicearray = explode(";", $_POST["choices"][0]);
开发者ID:neshkatrapati,项目名称:Portcullis-Client,代码行数:31,代码来源:phase2.php

示例2: phase1

 public function phase1($username, $passphrase)
 {
     $challenge = uniqid();
     $x = $username . $passphrase;
     $pbkdf2 = new PBKDF2();
     $key = $pbkdf2->deriveKey($x);
     $keymas = $pbkdf2->deriveKey($key . ":" . $challenge);
     $crypto = new Crypto($keymas);
     require_once "settings.php";
     $url = getSHOST() . "?mode=handshake&values=" . $username . ":" . $challenge;
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_REFERER, "www.google.com");
     $body = curl_exec($ch);
     $json = json_decode($body);
     $emsg = utf8_decode($json->message);
     $token = $crypto->aesDecrypt(utf8_decode($json->token));
     $plain = $crypto->aesDecrypt($emsg);
     $pl = $plain;
     if ($pl == "Standard Message#1") {
         setcookie("username", $username);
         setcookie("passphrase", $passphrase);
         setcookie("key", $key);
         setcookie("keymas", $keymas);
         setcookie("token", $token);
         echo "<script type='text/javascript'>window.location = \"phase2.php\";</script>";
     } else {
         //redirect("?err=true");
     }
 }
开发者ID:neshkatrapati,项目名称:Portcullis-Client,代码行数:31,代码来源:classes.php


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