當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Crypto::aesEncrypt方法代碼示例

本文整理匯總了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);
 }
開發者ID:mrvanes,項目名稱:simplesamlphp,代碼行數:19,代碼來源:HTTP.php

示例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">
開發者ID:neshkatrapati,項目名稱:Portcullis-Client,代碼行數:31,代碼來源:auth.php


注:本文中的Crypto::aesEncrypt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。