当前位置: 首页>>代码示例>>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;未经允许,请勿转载。