mcrypt

problem with mcrypt installation

别等时光非礼了梦想. 提交于 2019-12-03 23:41:25
I've asked the system admins to install mcrypt on the server, and they say everything is OK. But when I run my simple script I get this. Warning: mcrypt_get_iv_size() [function.mcrypt-get-iv-size]: Module initialization failed It's coming from this line: $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,MCRYPT_MODE_ECB); Now, from this code: $algorithms = mcrypt_list_algorithms("/usr/local/bin/mcrypt"); foreach ($algorithms as $cipher) { echo "$cipher<br />\n"; } I get: Warning: mcrypt_list_algorithms() [function.mcrypt-list-algorithms]: No algorithms found in module dir When I run this:

PHP using mcrypt and store the encrypted in MySQL

半世苍凉 提交于 2019-12-03 20:26:34
I am using Mcrypt to encrypt some strings. After that I store them in my database, but in my database it looks like "??f??R?????h$", because many special chars are replaced by a '?'. Do I have to use a special charset or is there another simple way? Regards, Cr41s3 I think you might be saving the encrypted string's bytes directly into mysql database. You could do something like this to solve your problem: Encryption: Orignal Text > MCrypt Encrypt > Base64 Encode > Store as Plain Text in MySQL Decryption: Load encrypted base64 encoded text from MySQL > Base64 Decode > MCrypt Decrypt -> Orignal

Mcrypt PHP extension required in Laravel [duplicate]

二次信任 提交于 2019-12-03 20:14:06
This question already has an answer here: Laravel requires the Mcrypt PHP extension 22 answers I'm trying to install Laravel on Linux Ubuntu. I'm running Ubuntu 14.10. Everything worked alright. But now instead of getting the supposed page when accessing localhost I get the message: " Mcrypt PHP extension required " I'm copying some information from terminal to help pinpoint the problem. which php /usr/bin/php php --ini Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: /etc/php5/cli/php.ini Scan for additional .ini files in: /etc/php5/cli/conf.d Additional .ini files

Enable Mcrypt on PHP Install

情到浓时终转凉″ 提交于 2019-12-03 16:07:15
I have PHP 5.2.14 installed on a Windows box (installed via .msi) using Apache 2.2.16. The install came with both ext/php_mcrypt.dll and libmcrypt.dll but when I uncommented extension=php_mcrypt.dll in php.ini and restarted Apache it doesn't enable. phpinfo() shows nothing for it. What am I missing? UPDATE: I looked at my error logs and it spit this out to me: PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP5\ext\php_mcrypt.dll' - The specified module could not be found.\r\n in Unknown on line 0 I read up a bit about this and I don't have any php dll's stored in the windows32/

Use of undefined constant MCRYPT_BLOWFISH

六眼飞鱼酱① 提交于 2019-12-03 11:26:09
After reinstalling our server, MCRYPT is no longer working and PHP gives the notice Use of undefined constant MCRYPT_BLOWFISH ( Apache 2.4 , PHP 5.5 ). php -m returns mcrypt. ls -al /etc/php5/apache2/conf.d/ 20-mcrypt.ini -> ../../mods-available/mcrypt.ini cat /etc/php5/mods-available/mcrypt.ini ; configuration for php MCrypt module extension=mcrypt.so Why is mcrypt not recognized? How can I make this work? phazei No sooner do I speak do I find a solution, heh. This worked for me: mCrypt not present after Ubuntu upgrade to 13.10 needed to go: sudo php5enmod mcrypt even though it appeared to

mcrypt blowfish php slightly different results when compared to java and .net

送分小仙女□ 提交于 2019-12-03 08:27:37
Here is some example code with altered key values and payload: $key = '/4rTInjwg/H/nA=='; $key = base64_decode($key); $data = 'val=100|val=200|val=300|val=400|val=500|val=600|val=700|val=800|val=900|'; $data.= 'val2=100|val2=200|val2=300|val2=400|val2=500|val2=600|val2=700|val2=800|val2=900|'; $data.= 'val3=100|val3=200|val3=300|val3=400|val3=500|val3=600|val3=700|val3=800|val3=900|'; $data.= 'val4=100|val4=200|val4=300|val4=400|val4=500|val4=600|val4=700|val4=800|val4=900|'; $result = base64_encode(mcrypt_ecb(MCRYPT_BLOWFISH,$key, $data, MCRYPT_ENCRYPT)); This encrypts and decrypts fine in

Storing credit card details with mcrypt or GnuPG

我只是一个虾纸丫 提交于 2019-12-03 08:22:31
I have a requirement to store credit card details (not storing is NOT an option). Using mcrypt with mcrypt_dev_random to generate init_vector takes varying ages to encrypt/decrypt but seems is the most 'secure' option. mcrypt_dev_urandom MUCH quicker but not suitable for long term storage - as I have read. Looking at GnuPG as a possible alternative and would like some opinions/heads up on these if possible. If you really want to store credit card information securely, there's a standard for it: Payment Card Industry Data Security Standard . And it's a lot more involved than using one specific

Delphi DEC library (Rijndael) encryption

筅森魡賤 提交于 2019-12-03 08:13:41
I am trying to use the DEC 3.0 library ( Delphi Encryption Compedium Part I ) to encrypt data in Delphi 7 and send it to a PHP script through POST, where I am decrypting it with mcrypt (RIJNDAEL_256, ECB mode). Delphi part: uses Windows, DECUtil, Cipher, Cipher1; function EncryptMsgData(MsgData, Key: string): string; var RCipher: TCipher_Rijndael; begin RCipher:= TCipher_Rijndael.Create(KeyStr, nil); RCipher.Mode:= cmECB; Result:= RCipher.CodeString(MsgData, paEncode, fmtMIME64); RCipher.Free; end; PHP part: function decryptMsgContent($msgContent, $sKey) { return mcrypt_decrypt(MCRYPT_RIJNDAEL

Any Equivalent for mcrypt (in PHP) to use in Java?

自古美人都是妖i 提交于 2019-12-03 07:34:56
Can any one tell about any library that can be used in java, which gives the same result if operation was done in PHP using the mcrypt library. i want to actually encrypt a string in Java using AES, and decrypt it in PHP. Will the Java Cipher yield a encryption decryptable by mcrypt in PHP? edit: Found some resin-3.1 library in Web. Can it be? Encryption algorithms are programming language independent. As long as the: Cipher (eg: AES, DES, Blowfish, etc.), Mode of operation (eg: CBC, CTR, OFB, etc.) , Key , IV and Padding (mcrypt uses zero-padding) are all the same, you'll be able to encrypt

Using PHP mcrypt with Rijndael/AES

最后都变了- 提交于 2019-12-03 06:55:01
I am trying to encrypt some text messages using mcrypt from php and the cipher Rijndael, but I am not sure about the MCRYPT_MODE_modename (according to PHP's manual these are available "ecb", "cbc", "cfb", "ofb", "nofb" or "stream" but I read there are actually a few more). I have no idea what each one do or how to use them. I read two things, that ECB mode should not be used and MCRYPT_RAND neither. They didn't explain why. For the ECB mode I guess it's because it always generate the same encrypted output for the same plain text (maybe this could be used for an attack), no idea about MCRYPT