mcrypt

mcrypt doesn't work in PHP 5.6 on windows/IIS

风格不统一 提交于 2019-12-12 10:37:32
问题 I have been making heavy use of mcrypt in my php app for years, both on win/IIS and on linux. Although I'm running PHP 5.4.28 on my linux server, I just upgraded to PHP 5.6.11 on my windows 8.1 IIS box. And mcrypt no longer works. It doesn't throw any errors that I can see; it just doesn't work. Here is my encryption function: function Encrypt($text){ global $salt; if($text != "") return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB, mcrypt_create_iv

Decrypting 3des from hex data with a hex key

霸气de小男生 提交于 2019-12-12 07:04:29
问题 I am trying to use the mycrypt php library to decrypt the following: Key: aaaaaaaabbbbbbbbccccccccdddddddd Data: b5057bbc04b842a96144a0f617f2820e Expected Result: Test123123 The data is encrypted with 3DES with the mode ECB. The code I'm currently working with decrypts the hex value to "e2119b734b5050e3" which translates to "â›sKPPã". I have tried using open ssl which is returning "False". The code is as follows: (PHP Version 5.3.3) $key = 'aaaaaaaabbbbbbbbccccccccdddddddd'; $key = pack('H*',

Converting a PHP mcrypt() call to node's mcrypt

痞子三分冷 提交于 2019-12-12 06:08:49
问题 I am trying to recreate an encryption function that we have in our old PHP application into a new Node JS application, using Node's mycrypt module. My goal is the make sure that given the same original string and salt, the PHP script below produces the same encrypted value as the Node script. PHP <?php $string = 'This is my password'; $salt = 'sodiumChloride12'; $encrypted = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $salt, $string, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv

mcrypt_encrypt to openssl_encrypt ecb des

喜夏-厌秋 提交于 2019-12-12 04:55:24
问题 i have to replace deprecated function mcrypt_encrypt using openssl_encrypt. My old mcrypt function use 'des' cipher and 'ecb' mode. I tried all cipher options (openssl_get_cipher_methods) and i cant find same result. Help please $key = '04647132'; $message = hex2bin('046471324B3680'); $mcrypt = base64_encode(mcrypt_encrypt('des', $key, $message, 'ecb')); foreach (openssl_get_cipher_methods(true) as $cipher) { $openSsl = base64_encode(@openssl_encrypt($message, $cipher, $key, OPENSSL_RAW_DATA)

php mcrypt: why to add spaces on string input?

旧街凉风 提交于 2019-12-12 04:44:11
问题 There's a mcrypt snippet on several webs: https://stackoverflow.com/a/11538728/408872 http://www.binrand.com/post/3810303-mcrypt-md5-how-to-create-an-online-encryption-decryption-web-page.html http://www.techbees.org/best-way-to-use-php-to-encrypt-and-decrypt/ $key = 'password to (en/de)crypt'; $string = ' string to be encrypted '; // note the spaces $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key)))); $decrypted = rtrim(mcrypt

Mcrypt on iPhone

僤鯓⒐⒋嵵緔 提交于 2019-12-12 02:26:58
问题 I want to use mcrypt encryption on iPhone. I don't have problem using it on the iPhone Simulator which uses i386 architecture. iPhone uses armv7s architecture and mcrypt doesn't seem to support it. I installed it with mac ports by this command: sudo install mcrypt +universal. So it should be 'universal'. Is there any way to get it working on iPhone? 回答1: The +universal flag on MacPorts is related to OS X universal binaries . It has nothing to do with iOS. So you'll get only binaries for OS X,

Mcrypt installed but doesn't show up on PHPINFO

偶尔善良 提交于 2019-12-12 01:31:11
问题 I think I managed to install mcrypt lib. The files are in place, but it looks like the library doesn't run at all. Tried to add: extension=mcrypt.so to PHP.INI; no good. Any help? 回答1: Have you tried restarting Apache? It won't recognise the new installed module until you do so AFAIK. Also, you've written you "think" you've installed it - did you use eg apt-get or yum to install it (eg apt-get install php-mcrypt ) or just download it? 回答2: Anyone actually looking for an answer to this on

Is libmcrypt not reliable?

爷,独闯天下 提交于 2019-12-11 13:54:04
问题 A few days ago I put a question on SO, without any meaningful answer. Bellow is it on short: I have a client server program in C that encrypts/decrypts data with mcrypt C 's library. The client encrypts the string that wants to send to server, send it, and after the server reads, decrypts it. Bellow are my encrypt and decrypt function: encrypt function: void encrypt(char *es, char *key, char *civ, size_t length) { MCRYPT td; int n; td = mcrypt_module_open(MCRYPT_TWOFISH, NULL, MCRYPT_CFB,

Magento on PHP 7.2 wamp server

时光怂恿深爱的人放手 提交于 2019-12-11 12:49:08
问题 i am configuring an existing magento project on local system with WAMP server php version 7.2, while installing magento i get error "PHP extension "mcrypt" must be loaded." Problem is mycrypt is no longer supported in php 7.2, can anyone suggest how can i resolve it? 回答1: mcrypt has been moved from php to pecl since 7.2 You still can install it. Install dependencies gcc make autoconf libc-dev pkg-config install the lib itself libmcrypt-dev I assume php7.2 and pecl are installed so you just

Convert mcrypt_generic to openssl_encrypt

北城以北 提交于 2019-12-11 12:14:16
问题 PHP no longer supports mcrypt . I have to make an OpenSSL alternative that has the exact same output as I only have access to half the code base. My attempts have all failed. As you can see below OS doesn't match MC. I've tried different $methods and combinations of OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING . Where am I going wrong? const n = "\n"; $text= 'hello my friends'; $method = 'AES-128-CBC'; $key = base64_decode('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); $text = base64_decode(