本文整理汇总了PHP中Crypto::aesEncrypt方法的典型用法代码示例。如果您正苦于以下问题:PHP Crypto::aesEncrypt方法的具体用法?PHP Crypto::aesEncrypt怎么用?PHP Crypto::aesEncrypt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crypto
的用法示例。
在下文中一共展示了Crypto::aesEncrypt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSecurePOSTRedirectURL
/**
* Obtain a URL where we can redirect to securely post a form with the given data to a specific destination.
*
* @param string $destination The destination URL.
* @param array $data An associative array containing the data to be posted to $destination.
*
* @return string A URL which allows to securely post a form to $destination.
*
* @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no>
*/
private static function getSecurePOSTRedirectURL($destination, $data)
{
$session = \SimpleSAML_Session::getSessionFromRequest();
$id = self::savePOSTData($session, $destination, $data);
// encrypt the session ID and the random ID
$info = base64_encode(Crypto::aesEncrypt($session->getSessionId() . ':' . $id));
$url = \SimpleSAML_Module::getModuleURL('core/postredirect.php', array('RedirInfo' => $info));
return preg_replace('#^https:#', 'http:', $url);
}
示例2: table_exists
$uname = $_POST["dbuname"];
$pass = $_POST["dbpass"];
$goto = $_GET["goto"];
$link = mysql_connect(DBHOST, $uname, $pass);
if (!$link) {
echo "<script type='text/javascript'>alert('Wrong Credentials!!');window.location='auth.php?goto={$goto}'</script>";
} else {
if (!mysql_select_db(DBNAME)) {
echo "<script type='text/javascript'>alert('Cant Connect to Database!!');window.location='auth.php?goto={$goto}'</script>";
}
}
require_once 'classes.php';
$pbkdf2 = new PBKDF2();
$key = $pbkdf2->deriveKey($goto);
$crypto = new Crypto($key);
$c = $crypto->aesEncrypt($goto);
setcookie("auth", $c);
$red = $_GET["goto"] . ".php";
echo "<script type='text/javascript'>window.location='{$red}';</script>";
}
function table_exists($tablename)
{
$x = mysql_query("show tables like '{$tablename}'");
if (mysql_num_rows($x) > 0) {
return TRUE;
} else {
return FALSE;
}
}
?>
<div id="additional">