• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mcrypt_list_modes函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中mcrypt_list_modes函数的典型用法代码示例。如果您正苦于以下问题:PHP mcrypt_list_modes函数的具体用法?PHP mcrypt_list_modes怎么用?PHP mcrypt_list_modes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _key

function _key($v, $arg)
{
    echo '  key: ' . $v;
    if (count($arg) > 0) {
        echo "\n\n  Arguments:";
        foreach ($arg as $a) {
            echo "\n\t{$a}";
        }
    }
    if ($v == 'generate') {
        if (!is_dir(CONFIG_KEYS_PATH)) {
            mkdir(CONFIG_KEYS_PATH, 0777);
        }
        $base = ['I', 'u', 'h', '5', 'B', 'A', 'r', 'i', '7', '9', 'z', 'd', 'n', 't', 'F', '2', 'W', 'X', 'f', 'e', 'x', 'v', '_', '8', 'm', 'T', 'N', 'R', 'L', 'c', '6', 'P', 'k', 'Q', 'q', 'j', 'Y', 'M', '4', 'S', 'G', 'o', '0', '$', 'K', 's', 'g', 'H', 'E', 'b', 'a', 'J', 'U', 'Z', 'l', '1', 'O', '3', 'y', 'p', 'V', 'D', 'C', 'w'];
        $extra = ['$', '!', '#', '%', '&', '*', '+', '-', '?', '@', '(', ')', '/', '\\', '[', ']', '_', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
        shuffle($base);
        shuffle($extra);
        file_put_contents(CONFIG_KEYS_PATH . 'can.key', implode($base) . "\n" . implode($extra));
        echo "\n\n  New CAN key generated - success!";
        //Now, OPEN_SSL
        include CLI_PATH . 'open.php';
        return "\n\n  OpenSSL keys & certificates - success!";
    } elseif ($v == 'list') {
        echo "\n\n  Ciphers:";
        foreach (mcrypt_list_algorithms() as $x) {
            echo "\n\t" . $x;
        }
        echo "\n\n  Cipher Modes:";
        foreach (mcrypt_list_modes() as $x) {
            echo "\n\t" . $x;
        }
    } else {
        return "\n\n  ----- ERROR: Command 'key:{$v}' not found!\n" . _help();
    }
}
开发者ID:3razil,项目名称:frame,代码行数:35,代码来源:limp.php


示例2: get_system_requirements

 public static function get_system_requirements()
 {
     return [['name' => 'Memory limit', 'expected_value' => '640M', 'current_value' => function () {
         return ini_get('memory_limit');
     }, 'check' => function ($current_value, $expected_value) {
         return intval($current_value) >= intval($expected_value);
     }], ['name' => 'Max execution time', 'expected_value' => '30', 'current_value' => function () {
         return ini_get('max_execution_time');
     }, 'check' => function ($current_value, $expected_value) {
         return intval($current_value) >= intval($expected_value);
     }], ['name' => 'cUrl enabled', 'expected_value' => 'Yes', 'current_value' => function () {
         return extension_loaded('curl') ? 'Yes' : 'No';
     }, 'check' => function ($current_value, $expected_value) {
         return $current_value == 'Yes';
     }], ['name' => 'mCrypt enabled', 'expected_value' => 'Yes', 'current_value' => function () {
         return extension_loaded('mcrypt') ? 'Yes' : 'No';
     }, 'check' => function ($current_value, $expected_value) {
         return $current_value == 'Yes';
     }], ['name' => 'RIJNDAEL 128 available', 'expected_value' => 'Yes', 'current_value' => function () {
         return extension_loaded('mcrypt') && in_array('rijndael-128', mcrypt_list_algorithms()) ? 'Yes' : 'No';
     }, 'check' => function ($current_value, $expected_value) {
         return $current_value == 'Yes';
     }], ['name' => 'CBC mode available', 'expected_value' => 'Yes', 'current_value' => function () {
         return extension_loaded('mcrypt') && in_array('cbc', mcrypt_list_modes()) ? 'Yes' : 'No';
     }, 'check' => function ($current_value, $expected_value) {
         return $current_value == 'Yes';
     }], ['name' => 'SHA512 available', 'expected_value' => 'Yes', 'current_value' => function () {
         return in_array('sha512', hash_algos()) ? 'Yes' : 'No';
     }, 'check' => function ($current_value, $expected_value) {
         return $current_value == 'Yes';
     }]];
 }
开发者ID:ArloSoftware,项目名称:arlowp-plugin,代码行数:32,代码来源:arlo-system-requirements.php


示例3: encryptmode

function encryptmode($config)
{
    if (@function_exists('mcrypt_list_modes')) {
        $listed = array();
        if (!isset($config['mcrypt_mode'])) {
            $config['mcrypt_mode'] = 'cbc';
            /* MCRYPT_MODE_CBC */
        }
        $modes = @mcrypt_list_modes();
        $found = False;
        while (list($key, $value) = each($modes)) {
            $found = True;
            /* Only show each once - seems this is a problem in some installs */
            if (!in_array($value, $listed)) {
                if ($config['mcrypt_mode'] == $value) {
                    $selected = ' selected';
                } else {
                    $selected = '';
                }
                $descr = strtoupper($value);
                $out .= '<option value="' . $value . '"' . $selected . '>' . $descr . '</option>' . "\n";
                $listed[] = $value;
            }
        }
        if (!$found) {
            /* Something is wrong with their mcrypt install or php.ini */
            $out = '<option value="" selected>' . lang('no modes available') . '</option>' . "\n";
        }
    } else {
        $out = '<option value="cbc" selected>CBC</option>' . "\n";
    }
    return $out;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:33,代码来源:hook_config.inc.php


示例4: setMode

 public function setMode($mode)
 {
     $modes = mcrypt_list_modes("/usr/local/lib/libmcrypt");
     if (in_array($mode, $modes)) {
         $this->mode = $mode;
     }
 }
开发者ID:uhtoff,项目名称:eCRF,代码行数:7,代码来源:Encrypt.php


示例5: listModes

 /**
  * @return array
  */
 public static function listModes()
 {
     if (!self::$listModes) {
         $listModes = mcrypt_list_modes();
         self::$listModes = array_combine($listModes, $listModes);
     }
     return self::$listModes;
 }
开发者ID:lytc,项目名称:sloths,代码行数:11,代码来源:Mcrypt.php


示例6: vidtrial_crypto_mode

function vidtrial_crypto_mode()
{
    $modes = mcrypt_list_modes();
    foreach (array("cfb", "ctr") as $mode) {
        if (in_array($mode, $modes)) {
            return $mode;
        }
    }
    throw new Exception("bad installation");
}
开发者ID:ajenta,项目名称:vidtrial,代码行数:10,代码来源:crypto.php


示例7: setMode

 /**
  * 设置mode
  * @param [type] $mode [description]
  */
 function setMode($mode)
 {
     if (!strlen($mode)) {
         return false;
     }
     if (!in_array($mode, mcrypt_list_modes())) {
         return false;
     }
     $this->mode = $mode;
 }
开发者ID:bubutrip,项目名称:bubutrip,代码行数:14,代码来源:mcrypt.php


示例8: encrypt

 /**
  * Encrypt function
  * @param algo (string) algorithm to use
  * @param data (string) data to encrypt
  * @param mode (sting) mode to use for the encryption
  * @return (array) with encrypted data, key and iv size or null if the
  *         algo or mode does not exist
  */
 public static function encrypt($algo, $data, $mode = "cbc")
 {
     if (!in_array(strtolower($algo), mcrypt_list_algorithms())) {
         return null;
     }
     if (!in_array(strtolower($mode), mcrypt_list_modes())) {
         return null;
     }
     $r = self::_encrypt($algo, $data, $mode);
     return $r;
 }
开发者ID:kranack,项目名称:frmwrk,代码行数:19,代码来源:Security.php


示例9: __construct

 public function __construct(string $cipher = null, string $hash = null, string $mode = null, bool $twoStep = true)
 {
     parent::__construct($cipher, $hash, $mode, $twoStep);
     if (!function_exists("mcrypt_list_algorithms")) {
         throw new Exception("Could not find the MCrypt module");
     } elseif (!in_array($this->mCipher, mcrypt_list_algorithms())) {
         throw new Exception("The cipher '" . $this->mCipher . "' is not supported by this platform installation");
     } elseif (!in_array($this->mMode, mcrypt_list_modes())) {
         throw new Exception("The block mode '" . $this->mMode . "' is not supported by this platform installation");
     }
 }
开发者ID:IMPHP,项目名称:libimphp,代码行数:11,代码来源:Encrypter.php


示例10: action_check

 public function action_check()
 {
     $version = explode('.', phpversion());
     if ($version[0] != "5" or $version[0] == "5" and intval($version[1]) < 3) {
         return $this->_view->send_error_message("PHP 5.3 Required: Found " . implode('.', $version));
     }
     if (!function_exists('mysql_connect')) {
         return $this->_view->send_error_message("Missing MySQL support in PHP.");
     }
     if (!function_exists('imagepng')) {
         return $this->_view->send_error_message("Missing GD support in PHP.");
     }
     if (!function_exists('mcrypt_encrypt') or !in_array('rijndael-128', mcrypt_list_algorithms()) or !in_array('nofb', mcrypt_list_modes())) {
         return $this->_view->send_error_message("Missing MCrypt support or Rjindael 128.");
     }
     $this->request->redirect('/install/database');
 }
开发者ID:rrsc,项目名称:beansbooks,代码行数:17,代码来源:install.php


示例11: __construct

 /**
  * Constructor
  *
  * @param string $secret
  * @param string $cipher
  * @param string $mode
  */
 public function __construct($secret, $cipher = 'rijndael-256', $mode = 'ctr')
 {
     if (!extension_loaded('mcrypt')) {
         throw new \RuntimeException('The mcrypt extension must be loaded.');
     }
     if (!in_array($cipher, mcrypt_list_algorithms(), true)) {
         throw new \InvalidArgumentException(sprintf('The cipher "%s" is not supported.', $cipher));
     }
     if (!in_array($mode, mcrypt_list_modes(), true)) {
         throw new \InvalidArgumentException(sprintf('The mode "%s" is not supported.', $mode));
     }
     $this->cipher = $cipher;
     $this->mode = $mode;
     if (0 === strlen($secret)) {
         throw new \InvalidArgumentException('$secret must not be empty.');
     }
     $key = hash('sha256', $secret, true);
     if (strlen($key) > ($size = mcrypt_get_key_size($this->cipher, $this->mode))) {
         $key = substr($key, 0, $size);
     }
     $this->key = $key;
 }
开发者ID:vidinoti,项目名称:JMSPaymentCoreBundle,代码行数:29,代码来源:MCryptEncryptionService.php


示例12: decrypt

 /**
  * RIJNDAEL 256: two-way encryption/decryption, with a URL-safe base64 wrapper.
  *
  * Falls back on XOR encryption/decryption when mcrypt is not available.
  *
  * @package s2Member\Utilities
  * @since 3.5
  *
  * @param str $base64 A string of data to decrypt. Should still be base64 encoded.
  * @param str $key Optional. Key used originally for encryption. Defaults to the one configured for s2Member. Short of that, defaults to: ``wp_salt()``.
  * @return str Decrypted string.
  */
 public static function decrypt($base64 = FALSE, $key = FALSE)
 {
     $base64 = is_string($base64) ? $base64 : "";
     $e = strlen($base64) ? c_ws_plugin__s2member_utils_strings::base64_url_safe_decode($base64) : "";
     if (function_exists("mcrypt_decrypt") && in_array("rijndael-256", mcrypt_list_algorithms()) && in_array("cbc", mcrypt_list_modes()) && strlen($e) && preg_match("/^~r2\\:([a-zA-Z0-9]+)(?:\\:([a-zA-Z0-9]+))?\\|(.*?)\$/s", $e, $iv_md5_e)) {
         $key = c_ws_plugin__s2member_utils_encryption::key($key);
         $key = substr($key, 0, mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC));
         if (strlen($iv_md5_e[3]) && (!$iv_md5_e[2] || $iv_md5_e[2] === md5($iv_md5_e[3]))) {
             $d = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $iv_md5_e[3], MCRYPT_MODE_CBC, $iv_md5_e[1]);
         }
         if (isset($d) && is_string($d) && strlen($d)) {
             if (strlen($d = preg_replace("/^~r2\\|/", "", $d, 1, $r2)) && $r2) {
                 $d = rtrim($d, "");
             } else {
                 // Else we need to empty this out.
                 $d = "";
             }
         }
         return isset($d) && is_string($d) && strlen($d) ? $string = $d : "";
     } else {
         // Fallback on XOR decryption.
         return c_ws_plugin__s2member_utils_encryption::xdecrypt($base64, $key);
     }
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:36,代码来源:utils-encryption.inc.php


示例13: DB_eSession


//.........这里部分代码省略.........
      * The default is off since encryption takes extra resources/time.
      */
     $this->_ENCRYPT = (bool) isset($_param['encrypt']) ? $_param['encrypt'] : FALSE;
     /**
      * The key used to encrypt/decrypt individual field data or the whole
      * session data. Keep this key a secret (keep off the web directory).
      * Use readable characters and make at least 62 UNIQUE characters long.
      */
     $this->_ENCRYPT_KEY = isset($_param['encrypt_key']) ? $_param['encrypt_key'] : "z1Mc6KRxAfNwZ0dGjY5qBXhtrPgJO7eCaUmHvQT3yW8nDsI2VkEpiS4blFoLu9";
     /**
      * Determine if libmcrypt is installed and if it's one of the
      * latest versions.
      */
     $this->_MCRYPT = extension_loaded('mcrypt');
     $this->_MCRYPT_LATEST = FALSE;
     if ($this->_MCRYPT) {
         if (defined('MCRYPT_TRIPLEDES')) {
             // Only defined in >= 2.4.x
             $this->_MCRYPT_LATEST = TRUE;
         }
         /**
          * The key field used to encrypt/decrypt using the mcrypt library.
          */
         $this->_ENC_KEY_HASHED = md5($this->_ENCRYPT_KEY);
         $this->_ENC_ALGO = isset($_param['encrypt_cipher']) ? $_param['encrypt_cipher'] : MCRYPT_GOST;
         $_algo = mcrypt_list_algorithms();
         if (!in_array($this->_ENC_ALGO, $_algo)) {
             // Could not assign the encryption algorithm...
             $this->_setErrMsg('BAD_ALGO', NULL, $this->_ENC_ALGO);
             $this->_handleErrors();
             $this->_ENC_ALGO = NULL;
         }
         $this->_ENC_MODE = isset($_param['encrypt_mode']) ? $_param['encrypt_mode'] : MCRYPT_MODE_CFB;
         $_modes = mcrypt_list_modes();
         if (!in_array($this->_ENC_MODE, $_modes)) {
             // Could not assign the encryption mode...
             $this->_setErrMsg('BAD_ENC_MODE', NULL, $this->_ENC_MODE);
             $this->_handleErrors();
             $this->_ENC_MODE = NULL;
         } else {
             if ($this->_ENC_MODE != MCRYPT_MODE_ECB && $this->_ENC_MODE != MCRYPT_MODE_CBC && $this->_ENC_MODE != MCRYPT_MODE_CFB && $this->_ENC_MODE != MCRYPT_MODE_OFB) {
                 // Could not assign the encryption mode...Use class supported
                 $this->_setErrMsg('BAD_MODE_SUPP', NULL, $this->_ENC_MODE, 'ECB, CBC, CFB, OFB.');
                 $this->_handleErrors();
                 $this->_ENC_MODE = NULL;
             }
         }
     } else {
         $this->_ENC_KEY_HASHED = NULL;
         $this->_ENC_ALGO = NULL;
         $this->_ENC_MODE = NULL;
     }
     /**
      * As of PHP 4.2.0, there is no need to seed the random number
      * generator, however, we'll do it here for portability. This will be
      * needed for use with the encryption/decryption mcrypt routines and
      * generating of a new session ID.
      */
     mt_srand((double) microtime() * 1000000);
     srand((double) microtime() * 1000000);
     /**
      * See if MD5 hashing keys have been passed, otherwise set defaults.
      */
     $this->_KEY_PREFIX = isset($_param['key_prefix']) ? $_param['key_prefix'] : 'O9R^3mp#i|34';
     $this->_KEY_SUFFIX = isset($_param['key_suffix']) ? $_param['key_suffix'] : '+t97!u0K-2L5';
     /**
开发者ID:jfanctil,项目名称:lamoria,代码行数:67,代码来源:class.DB_eSession.php


示例14: mb_substr

<?php

$lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\neiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim\nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum\ndolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,\nsunt in culpa qui officia deserunt mollit anim id est laborum.";
// Take a plaintext that's an integer number times 16 bytes long.
// 96-byte plaintext is an integer number of blocks for block sizes 8, 16, 24 and 32.
$plaintext = mb_substr($lipsum, 0, 96, '8bit');
$ikm = '';
$iiv = '';
for ($i = 0; $i <= 255; $i += 1) {
    $ikm .= chr($i);
    $iiv .= chr(($i + 128) % 256);
}
$ciphers = mcrypt_list_algorithms();
sort($ciphers);
$modes = mcrypt_list_modes();
sort($modes);
$mcryptCiphertexts = [];
foreach ($ciphers as $cipher) {
    foreach ($modes as $mode) {
        $status = 'Yes';
        $keySize = '';
        $blockSize = '';
        $module = @mcrypt_module_open($cipher, '', $mode, '');
        if ($module === false || !is_resource($module)) {
            $status = 'No';
            continue;
        } else {
            $keySize = mcrypt_get_key_size($cipher, $mode);
            $blockSize = mcrypt_get_block_size($cipher, $mode);
            $padding = $mode === 'cbc' || $mode === 'ecb' ? str_repeat(chr($blockSize), $blockSize) : '';
            $iv = $mode === 'stream' ? '' : substr($iiv, 0, $blockSize);
开发者ID:h2ero,项目名称:mcrypt2openssl,代码行数:31,代码来源:mcrypt_test.php


示例15: intval

$p_encoding = intval(@$_GET['encoding']);
$p_mode = intval(@$_GET['mode']);
$p_key_settings = intval(@$_GET['key']);
$p_iv_settings = intval(@$_GET['iv']);
if ($p_cipher == 0) {
    $p_cipher = 3;
}
if ($p_encoding == 0) {
    $p_encoding = 2;
}
if ($p_mode == 0) {
    $p_mode = 1;
}
$cipherList = mcrypt_list_algorithms();
$cipher = $cipherList[$p_cipher - 1];
$modeList = mcrypt_list_modes();
$mode = $modeList[$p_mode - 1];
$key_iv_list = getKeySettings();
$keysize = intval(mcrypt_get_key_size($cipher, $mode));
$blocksize = intval(mcrypt_get_block_size($cipher, $mode));
$key = genKey($keysize);
$iv = genIV($blocksize);
$encoding_list = list_encoding();
function list_encoding()
{
    $encodings = array("base64", "lower hex", "upper hex", "websafe base64");
    return $encodings;
}
function encode($text, $mode = 2)
{
    switch ($mode) {
开发者ID:thisiseast,项目名称:MCIR,代码行数:31,代码来源:init.php


示例16: decrypt

 /**
  * Decryption Procedure
  *
  * @param string $msg output from encrypt()
  * @param string $key encryption key
  * @param boolean $base64 base64 decode msg
  * @param string $algorythm mcrypt algorithm
  * @param string $mode mcrypt mode
  *
  * @throws \Exception
  * @return string original message/data
  */
 public function decrypt($msg, $key, $base64 = false, $algorythm, $mode)
 {
     if ($base64) {
         $msg = base64_decode($msg);
     }
     if (!in_array($algorythm, mcrypt_list_algorithms())) {
         throw new Exception('Wrong mcrypt algorithm. Use mcrypt_list_algorithms() for list available algorythm.');
     }
     if (!in_array($mode, mcrypt_list_modes())) {
         throw new Exception('Wrong mcrypt mode. Use mcrypt_list_modes() for list available mode.');
     }
     if (!($td = mcrypt_module_open($algorythm, '', $mode, ''))) {
         throw new Exception('Can not open mcrypt module');
     }
     try {
         $initializationVector = substr($msg, 0, mcrypt_enc_get_iv_size($td));
         $mo = strlen($msg) - mcrypt_enc_get_iv_size($td);
         $em = substr($msg, $mo);
         $msg = substr($msg, mcrypt_enc_get_iv_size($td), strlen($msg) - mcrypt_enc_get_iv_size($td) * 2);
         $mac = $this->pbkdf2($initializationVector . $msg, $key, 1000, mcrypt_enc_get_iv_size($td));
     } catch (Exception $e) {
         return 'Caught exception: ' . $e->getMessage();
     }
     if ($em !== $mac) {
         throw new Exception('Can not init mcrypt');
     }
     if (mcrypt_generic_init($td, $key, $initializationVector) !== 0) {
         throw new Exception('Can not init mcrypt');
     }
     try {
         $msg = mdecrypt_generic($td, $msg);
         $msg = unserialize($msg);
         mcrypt_generic_deinit($td);
         mcrypt_module_close($td);
         return trim($msg);
     } catch (Exception $e) {
         return 'Caught exception: ' . $e->getMessage();
     }
 }
开发者ID:gwinn,项目名称:scyth,代码行数:51,代码来源:PBKDF2.php


示例17: header

<?php

/**
 * Lists all available mcrypt algorithms, all their respective modes as well as block, iv and key size.
 * Can be ran in a browser or on the command line
 */
header('Content-type: text/plain');
print "ALGORITHM: mode(block size, iv size, key size)[, mode(block size, iv size, key size)[, ...]]\n" . "-------------------------------\n";
foreach (mcrypt_list_algorithms() as $a) {
    print strtoupper($a) . ':';
    foreach (mcrypt_list_modes() as $m) {
        if (@mcrypt_get_block_size($a, $m)) {
            print ' ' . $m . '(' . mcrypt_get_block_size($a, $m) . ',' . mcrypt_get_iv_size($a, $m) . ',' . mcrypt_get_key_size($a, $m) . ')';
        }
    }
    print "\n";
}
开发者ID:rsms,项目名称:phpab,代码行数:17,代码来源:mcrypt_info.php


示例18: getEncryptConfig

 protected function getEncryptConfig()
 {
     $config = $this->getConfig('encrypt') ?: array();
     if (!isset($config[0]) || !$config[0]) {
         throw new \RuntimeException('Require encrypt salt string');
     }
     $salt = $config[0];
     $cipher = isset($config[1]) ? $config[1] : MCRYPT_RIJNDAEL_256;
     if (!in_array($cipher, mcrypt_list_algorithms())) {
         throw new \RuntimeException('Unsupport encrypt cipher: ' . $cipher);
     }
     $mode = isset($config[2]) ? $config[2] : MCRYPT_MODE_CBC;
     if (!in_array($mode, mcrypt_list_modes())) {
         throw new \RuntimeException('Unsupport encrypt mode: ' . $mode);
     }
     if (isset($config[3])) {
         $device = $config[3];
     } elseif (defined('MCRYPT_DEV_URANDOM')) {
         $device = MCRYPT_DEV_URANDOM;
     } elseif (defined('MCRYPT_DEV_RANDOM')) {
         $device = MCRYPT_DEV_RANDOM;
     } else {
         mt_srand();
         $device = MCRYPT_RAND;
     }
     return [$salt, $cipher, $mode, $device];
 }
开发者ID:yeaha,项目名称:owl-mvc,代码行数:27,代码来源:Cookie.php


示例19: vidtrial_check_dependencies

function vidtrial_check_dependencies()
{
    $errors = array();
    if (version_compare(PHP_VERSION, '5.3.0', '<')) {
        $errors[] = __("Your PHP version is too old. Please update to at least PHP5.3", VIDTRIAL_TD);
    }
    if (!function_exists("openssl_random_pseudo_bytes")) {
        $errors[] = __("Please install the PHP openssl module", VIDTRIAL_TD);
    }
    if (!function_exists("mcrypt_generic_init")) {
        $errors[] = __("Please install the PHP mcrypt module", VIDTRIAL_TD);
    }
    if (!count(array_intersect(mcrypt_list_algorithms(), array("rijndael-128", "twofish", "serpent")))) {
        $errors[] = __("Please ensure the mcrypt PHP module has one algorithm of 'rijndael', 'twofish' or 'serpent' available", VIDTRIAL_TD);
    }
    if (!count(array_intersect(mcrypt_list_modes(), array("cfb", "ctr")))) {
        $errors[] = __("Please ensure the mcrypt PHP module has one of 'cfb' or 'ctr' modes available", VIDTRIAL_TD);
    }
    if (count($errors)) {
        die(implode("<br>", $errors));
    }
}
开发者ID:ajenta,项目名称:vidtrial,代码行数:22,代码来源:init.php


示例20: set_mcrypt_modes

 public function set_mcrypt_modes()
 {
     $this->_mcrypt_modes = mcrypt_list_modes($this->_mcrypt_modes_dir);
 }
开发者ID:corner82,项目名称:Slim_SanalFabrika,代码行数:4,代码来源:Mcrypt.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mcrypt_module_close函数代码示例发布时间:2022-05-15
下一篇:
PHP mcrypt_list_algorithms函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap