本文整理汇总了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]);
示例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");
}
}