mcrypt

MCRYPT_DEV_RANDOM freezes but MCRYPT_DEV_URANDOM works

淺唱寂寞╮ 提交于 2020-01-10 04:52:27
问题 I am trying to create an IV with the function: mcrypt_create_iv(32, MCRYPT_DEV_RANDOM) this causes the script to time out after more than 60 seconds. (maybe more?) but when I use URANDOM , it works fine almost instantly. From what I read it should take about 4 seconds with MCRYPT_DEV_RANDOM , but it is definitely taking too long. There is nothing in the error log. I have it installed with apache2 and php5 on an ubuntu 12.04 server. I have run the exact same code on my centos server without

MCrypt rijndael-128 to OpenSSL aes-128-ecb conversion

為{幸葍}努か 提交于 2020-01-08 21:39:50
问题 Since Mcrypt is deprecated, I want to use OpenSSL instead in my code since we already using php 7.0.17 in our server and there's no tell when they upgrade it. Some third party API (hosted on PHP 5.x probably and using mcrypt ), is taking encrypted data. They've provided methods which they are using to encrypt/decrypt strings. Here are they $secret = 'a0a7e7997b6d5fcd55f4b5c32611b87c' ; public function encrypt128($str) { $block = mcrypt_get_block_size("rijndael_128", "ecb"); $pad = $block -

Using mcrypt_create_iv on PHP IIS

我怕爱的太早我们不能终老 提交于 2020-01-06 11:45:56
问题 I'm trying to set up password salting on our website, and found the PBKDF2 functions at https://defuse.ca/php-pbkdf2.htm When I try it, I get: Fatal error: mcrypt_create_iv(): Could not gather sufficient random data in include\PBKDF2.php on line 23 I'm not sure if I need to do anything to make this work. It's running on IIS7.5 回答1: For those who are still facing error: Fatal Error: Call to undefined function mcrypt_create_iv() Please check the phpversion and correspondingly make sure to go to

Fresh Laravel install giving Mcrypt “error”. (OSX)

江枫思渺然 提交于 2020-01-04 18:09:32
问题 I install laravel by running: laravel new testing And it responds with: Application ready! Build something amazing. Yet when I visit public/index.php , it presents an empty page that says: Mcrypt PHP extension required. When I run php -m it does not list Mcrypt. I tried installing it with composer, by running: composer create-project laravel/laravel laravel_composer --prefer-dist And it resulted with the following: Writing lock file Generating autoload files Mcrypt PHP extension required.

Fresh Laravel install giving Mcrypt “error”. (OSX)

杀马特。学长 韩版系。学妹 提交于 2020-01-04 18:08:50
问题 I install laravel by running: laravel new testing And it responds with: Application ready! Build something amazing. Yet when I visit public/index.php , it presents an empty page that says: Mcrypt PHP extension required. When I run php -m it does not list Mcrypt. I tried installing it with composer, by running: composer create-project laravel/laravel laravel_composer --prefer-dist And it resulted with the following: Writing lock file Generating autoload files Mcrypt PHP extension required.

Using mcrypt to pass data across a webservice is failing

孤街浪徒 提交于 2020-01-04 15:28:43
问题 I'm writing an error handler script which encrypts the error data (file, line, error, message etc) and passes the serialized array as a POST variable (using curl) to a script which then logs the error in a central db. I've tested my encrypt/decrypt functions in a single file and the data is encrypted and decrypted fine: define('KEY', 'abc'); define('CYPHER', 'blowfish'); define('MODE', 'cfb'); function encrypt($data) { $td = mcrypt_module_open(CYPHER, '', MODE, ''); $iv = mcrypt_create_iv

Error Installing Laravel: Mcrypt PHP extension required

这一生的挚爱 提交于 2020-01-04 04:00:19
问题 I know there are a lot of questions about this on SO but none of them address my problem. I've checked everything they mention everything seems to indicate mcrypt is ok except when installing Laravel. Clearly I'm missing something. When installing Laravel as directed ( composer create-project laravel/laravel myproj --prefer-dist ) I get the error "Mcrypt PHP extension required" at what seems to be near the end of installation. As far as I can tell mcrypt is installed and enabled. Composer

Mcrypt PHP extension required on Mac OS X Mojave

左心房为你撑大大i 提交于 2020-01-02 20:24:08
问题 I just update my to Mac OS X Mojave. My local site now stop loading. I kept getting Mcrypt PHP extension required. I tried brew update brew upgrade brew tap homebrew/dupes brew tap josegonzalez/homebrew-php brew install php54-mcrypt php --version // To Test your php I got Error: php54-mcrypt: cannot load such file -- /usr/local/opt/php54-mcrypt/Abstract/abstract-php-extension I tried reload my site I still get this Mcrypt PHP extension required. My set up details php --version , I got PHP 7.1

How to get the same result with Node.js and PHP-mcrypt using TripleDES encryption?

时光总嘲笑我的痴心妄想 提交于 2020-01-02 16:54:26
问题 This is 3DES using crypto (base on OpenSSL) in native Node.js. var secretKey = "efd77bed61e8fdd0437df1ac"; var enchding = 'hex'; var text = 'This is test.'; var cipher = modules.crypto.createCipher('des-ede3-cbc', secretKey); var cryptedPassword = cipher.update(text, 'utf8', enchding) + cipher.final(enchding); output is : af4ee52e0227fe40ab2e7ddd72fb1137 But I used online PHP-mcrypt encrypt tool (link here). Key is efd77bed61e8fdd0437df1ac Algorithm is Tripledes , mode is CBC and output using

Where should one store the cipher key when using AES encryption with PHP?

这一生的挚爱 提交于 2020-01-02 11:48:10
问题 I am implementing AES-256 bit encrpytion in my web app: http://www.utoxin.name/2009/07/automatic-db-field-encryption-in-cakephp/ One of the steps says to store the cipher used and key in a boostrap file. But what is stopping someone from scanning the file system with PS or something and decrypting the data? What is the best way to secure the data? 回答1: If someone has access to all files on the hard drive of your server, all bets are off. There is no way you can protect your data then, because