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


PHP Crypt::setKey方法代码示例

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


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

示例1: testSetKey

 /**
  * Tests Crypt->setKey()
  */
 public function testSetKey()
 {
     // Set new key
     $newkey = 'gjhfdbhTGFJUGFDbvfdJHGFNcxfdsgDHVCNBfdsgjhgfNfdhgfdhd';
     $this->crypt->setKey($newkey);
     // Reset to old key
     $this->crypt->setKey(self::KEY);
     unset($newkey);
 }
开发者ID:spekkionu,项目名称:spekkionu-php-class-collection,代码行数:12,代码来源:CryptTest.php

示例2: __construct

 /**
  * constructor function
  *
  * @param string $obfuscatedFilePostfix
  */
 public function __construct($key = '', $obfuscatedFilePostfix = "")
 {
     $this->level = '';
     $this->key = $key;
     if (trim($obfuscatedFilePostfix) != "") {
         $this->obfuscatedFilePostfix = $obfuscatedFilePostfix;
     }
     Crypt::setKey($this->key);
 }
开发者ID:marcianobarros20,项目名称:ncryptd,代码行数:14,代码来源:PhpObfuscator.php

示例3: captcha

 /**
  * 输出验证码
  */
 public function captcha()
 {
     $builder = new CaptchaBuilder();
     $builder->build();
     $phrase = $builder->getPhrase();
     Crypt::setKey(Config::get('app.cookie_key'));
     $phrase_new = Crypt::encrypt($phrase);
     Session::flash('__captcha', $phrase_new);
     header("Cache-Control: no-cache, must-revalidate");
     header('Content-Type: image/jpeg');
     $builder->output();
     exit;
 }
开发者ID:azonwan,项目名称:pingju,代码行数:16,代码来源:ExtController.php

示例4: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::table('demographics', function (Blueprint $table) {
         $table->string('creditcard_key', 255)->nullable()->default('');
     });
     $query = DB::table('demographics')->where(function ($query_array1) {
         $query_array1->where('creditcard_number', '!=', '')->orWhereNotNull('creditcard_number');
     })->get();
     if ($query) {
         foreach ($query as $row) {
             $key = MD5(microtime());
             Crypt::setKey($key);
             $new = Crypt::encrypt($row->creditcard_number);
             $data = array('creditcard_key' => $key, 'creditcard_number' => $new);
             DB::table('demographics')->where('pid', '=', $row->pid)->update($data);
         }
     }
 }
开发者ID:carlosqueiroz,项目名称:nosh-core,代码行数:23,代码来源:2015_04_14_202233_add_creditcard_key_to_demographics_table.php

示例5: Crypt

<?php

require_once '../Crypt.php';
$crypt = new Crypt();
$crypt->setKey('YOUR CYPHER KEY');
$crypt->setComplexTypes(TRUE);
$crypt->setData('cryptPHP#bWOXEusBnyDHRuNY+zAyqOWpYLPkmSMJ#tdcvQqIxylC3bNuxFQ1GUIyKN0eO8HF/2JsQJG2GhkovgNEmQDTYLELIwNwoK5vmgaErww4CGslPDx1F2ZS7uVqMJcNnD4tp7XAKzCCqmWZNw+1mWRuf#3089b5eda40c7a40171666c6fb2694077b03de2d');
var_dump($crypt->decrypt());
开发者ID:Omgan,项目名称:crypt-php,代码行数:8,代码来源:decryptMixed.php

示例6: postSaveCreditcard

 public function postSaveCreditcard()
 {
     $data = array();
     $query = DB::table('demographics')->where('pid', '=', Session::get('pid'))->first();
     if ($query->creditcard_key == '') {
         $key = MD5(microtime());
         $data['creditcard_key'] = $key;
     } else {
         $key = $query->creditcard_key;
     }
     Crypt::setKey($key);
     $data['creditcard_number'] = Crypt::encrypt(Input::get('creditcard_number'));
     Crypt::setKey('YourSecretKey!!!');
     $data['creditcard_expiration'] = Input::get('creditcard_expiration');
     $data['creditcard_type'] = Input::get('creditcard_type');
     DB::table('demographics')->where('pid', '=', Session::get('pid'))->update($data);
     $this->audit('Update');
     echo "Credit Card Information Updated!";
 }
开发者ID:carlosqueiroz,项目名称:nosh-core,代码行数:19,代码来源:AjaxChartController.php

示例7: use

     * Error handler
     */
    set_error_handler(function ($errno, $errstr, $errfile, $errline) use($di) {
        if (!(error_reporting() & $errno)) {
            return;
        }
        $di->getFlash()->error($errstr);
        $di->getLogger()->log($errstr . ' ' . $errfile . ':' . $errline, Phalcon\Logger::ERROR);
        return true;
    });
    /**
     * Encryption service
     */
    $di->set('crypt', function () use($config) {
        $crypt = new Crypt();
        $crypt->setKey('1234');
        return $crypt;
    });
    /**
     * Handle the request
     */
    $application = new \Phalcon\Mvc\Application();
    $application->setDI($di);
    /**
     * Register application modules
     */
    //$application->registerModules(require __dir__ . '/../common/config/modules.php');
    // Register the installed modules
    $application->registerModules(array('frontend' => array('className' => 'Frontend\\Module', 'path' => '../apps/frontend/Module.php'), 'backend' => array('className' => 'Backend\\Module', 'path' => '../apps/backend/Module.php')));
    echo $application->handle()->getContent();
} catch (Phalcon\Exception $e) {
开发者ID:devsnippet,项目名称:city_site,代码行数:31,代码来源:index.php


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