mcrypt

invalid login or password Mcrypt error

人走茶凉 提交于 2019-12-19 11:54:37
问题 I' facing an issue with registered Customer through checkout. After the checkout process, the customer lands in “My Account” but once logged off, he can’t acces "My Account" anymore, the message "Invalid login or password" is displayed. Setting a new password through “Forgotten Password” button seems to solve the problem for the customer. The system.log file is displaying: Warning: mcrypt_generic_init(): Key size is 0 in /lib/Varien/Crypt/Mcrypt.php on line 94 Warning: mcrypt_generic_init():

Decrypt mcrypt with openssl

拜拜、爱过 提交于 2019-12-18 07:07:05
问题 Since mcrypt is considered obsolete, my task is upgrading the current code to use openssl. Sounds simple, but ... after a few days of try and failure I feel like going insane. My question to you is: Is there any way you can decrypt with openssl data previously encrypted with mcrypt? I've read so many posts on this matter and most of them say that a previous manual padding of the data was/is necessary before running mcrypt on it. The issue is that the mcrypt-ed data is already encrypted (with

Generate an N-digit random number

给你一囗甜甜゛ 提交于 2019-12-17 18:16:12
问题 I want to generate a 6 digit random number using the PHP mt_rand() function. I know the PHP mt_rand() function only takes 2 parameters: a minimum and a maximum value. How can I do that? 回答1: Something like this ? <?php $a = mt_rand(100000,999999); ?> Or this, then the first digit can be 0 in first example can it only be 1 to 9 for ($i = 0; $i<6; $i++) { $a .= mt_rand(0,9); } 回答2: You can use the following code. <?php $num = mt_rand(100000,999999); printf("%d", $num); ?> Here mt_rand(min,max);

Why is mcrypt_encrypt() putting binary characters at the end of my string?

一个人想着一个人 提交于 2019-12-17 16:48:05
问题 Here is a PHP demo script that encrypts and decrypts data: <? $encryptionkey = 'h8y2p9d1'; $card_nbr = "1234"; echo "original card_nbr: $card_nbr <br>\n"; $card_nbr_encrypted=encrypt_data($card_nbr); echo "card_nbr_encrypted: $card_nbr_encrypted <br>\n"; $card_nbr_decrypted=decrypt_data($card_nbr_encrypted); echo "card_nbr_decrypted: $card_nbr_decrypted <br>\n"; $len=strlen($card_nbr_decrypted); echo "length: $len <br>\n"; function encrypt_data($text){ global $encryptionkey; $iv_size = mcrypt

Un-encrypting / re-encrypting a ColdFusion encrypted string in PHP

旧城冷巷雨未停 提交于 2019-12-17 16:31:10
问题 I'm in the unenviable position where I have to maintain functionality with an existing ColdFusion application. As part of it's login process the Coldfusion app stores a cookie with an encrypted string. encrypt(strToEncrypt, theKey, "AES", "Base64") I can successfully decrypt this string in PHP using MCrypt and the following code mcrypt_decrypt( MCRYPT_RIJNDAEL_128, base64_decode($theKey), base64_decode($encrypted_string), MCRYPT_MODE_ECB, "0000000000000000") I now have the need to perform the

Installing mcrypt on OSX 10.8.2 - PHP 5.3.15 with homebrew

耗尽温柔 提交于 2019-12-17 12:15:25
问题 I've successfully installed mcrypt via homebrew but I'm struggling to find the path to mcrypt.so to include it as an extension in php.ini . mcrypt was installed at /usr/local/Cellar/mcrypt/2.5.8 . Tree: -- AUTHORS |-- ChangeLog |-- INSTALL_RECEIPT.json |-- NEWS |-- README |-- TODO |-- bin | `-- libmcrypt-config |-- include | |-- mcrypt.h | `-- mutils | `-- mcrypt.h |-- lib | |-- libmcrypt.4.4.8.dylib | |-- libmcrypt.4.dylib -> libmcrypt.4.4.8.dylib | `-- libmcrypt.dylib -> libmcrypt.4.4.8

linux php7.2开启pdo等扩展

人盡茶涼 提交于 2019-12-17 11:47:02
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> yum install php72w-mysql php72w-gd libjpeg* php72w-imap php72w-ldap php72w-odbc php72w-pear php72w-xml php72w-xmlrpc php72w-mbstring php72w-mcrypt php72w-bcmath php72w-mhash libmcrypt 安装完成后重启Apache:service httpd restart php7所有扩展 p.s. php70w.x86_64即php7 php72w.x86_64即php7.2 yum install php70w.x86_64 php70w-bcmath.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-dba.x86_64 php70w-devel.x86_64 php70w-embedded.x86_64 php70w-enchant.x86_64 php70w-fpm.x86_64 php70w-gd.x86_64 php70w-imap.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64

Issue in installing php7.2-mcrypt

无人久伴 提交于 2019-12-17 05:50:28
问题 As I'm trying to load mcrypt extension module from PHP 7.2.X version. So I tried to make use of PECL library that is compatible to the current version of my PHP, in order to get installed and followed this link: Installing mcrypt on PHP 7.2 during installation! These below are the result's obtained after executing certain commands on the terminal. root@YYY:/var/www/html/orocrm# apt install php-pear Reading package lists... Done Building dependency tree Reading state information... Done The

Preparing for removal of Mcrypt in PHP 7.2

感情迁移 提交于 2019-12-16 20:05:34
问题 So as time moves on mcrypt will go in PHP 7.2. Of course there is an alternative: openssl. I find it difficult to switch from mcrypt to openssl, using AES 256 CBC and preserving IVs. I am sort of new to cryptography, so I don't really know everything, but I understand the basics. Let's say I have the following code function encrypt($masterPassword, $data) { $keySize = mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC); $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);

libmcrypt and MS Visual C++

孤者浪人 提交于 2019-12-14 04:27:17
问题 Has anyone tried using libmcrypt and visual c++? I was trying to use Crypto++ but it seems not fully compatible - and I need to decrypt data encrypted in PHP using linux libmcrypt. I found only cygwin version of libmcrypt but no .lib files or header. I'm using RIJNDAEL_128 - maybe there is easier way to decrypt it in Visual C++? Thanks 回答1: I'd be surprised if Crypto++ didn't do the job frankly. It is a bit awkward to use and is fairly badly documented, but I have found it very powerful in