Questions tagged [mcrypt]

MCrypt, and the accompanying libmcrypt, are intended to be replacements for the old Unix crypt, except that they are under the GPL and support an ever-wider range of algorithms and modes. MCrypt has not been updated since 2007

MCrypt implements numerous cryptographic algorithms, mostly block ciphers and stream ciphers, some of which falls under export restrictions in the United States. Algorithms include , , arcfour, enigma, ghost, LOKI97, RC2, serpent, threeway, twofish, wake, XTEA

Caution

Please note that the MCrypt library has not been updated since 2007. The PHP project has moved to deprecate and ultimately remove MCrypt from the PHP core and other projects will likely follow suit. It is highly recommended you switch to OpenSSL or another maintained encryption project.

922 questions
6
votes
4 answers

can't create a Laravel project because mcrypt extension is missing

OK, I have seen many posts about this, and I have spent the entire day working through them to solve this issue, with no success. I am trying to create a Laravel project. I am using a Mac (Yosemite), which is running PHP 5.5.14. There is also an…
rogdawg
  • 687
  • 3
  • 11
  • 33
6
votes
3 answers

Encryption in JavaScript and decryption with PHP

I'm encrypting my user password in JavaScript like this: var encryptedPassword = CryptoJS.AES.encrypt(password, "Secret Passphrase"); It works fine but now I'm trying to decrypt in PHP on the server side like this: $iv =…
Nizar B.
  • 3,098
  • 9
  • 38
  • 56
6
votes
3 answers

How Can We Use GCM Mode Encryption in PHP?

I have been reading a lot about GCM and how awesome it is and I would like to know how could I use AES-GCM authenticated encryption using PHP. Is it supported in mcrypt()? I found some references to GCM in the Codeigniter framework documentation…
xendi
  • 2,332
  • 5
  • 40
  • 64
6
votes
4 answers

LAMP Laravel ErrorException mcrypt_get_iv_size(): Module initialization failed

I installed laravel in my new pc and i'm getting this error: ErrorException mcrypt_get_iv_size(): Module initialization failed I copied the project from my old pc. mcrypt is installed and enabled, and other pages that do not use laravel are…
6
votes
2 answers

Mcrypt js encryption value is different than that produced by PHP mcrypt / Mcrypt JS decrypt doesn't work for UTF-8 chars

I have been trying to implement mcrypt encryption/ decryption technique on both server end, PHP and client end. I am trying to use mcrypt.js library at the moment as:
hsuk
  • 6,770
  • 13
  • 50
  • 80
5
votes
3 answers

Enable Mcrypt on PHP Install

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…
justacoder
  • 2,684
  • 6
  • 47
  • 78
5
votes
1 answer

PHP mcrypt to ColdFusion decrypt

I am working in a PHP app we have a particular string that we need to encrypt before storing in a database. I can do this in PHP with not problem using mcrypt with a key and a iv. Currently I'm trying to use blowfish because I thought it would be…
brucemartin
  • 317
  • 1
  • 5
  • 15
5
votes
2 answers

proper PHP mcrypt encryption methods?

Ok, I have tried to create my own encryption/decryption methods using PHP mcrypt, and when I posted them a while back some called them "trash". They were mentioning things about "Initialization Vectors" and such. Basically, how can I make these…
nkcmr
  • 10,690
  • 25
  • 63
  • 84
5
votes
1 answer

Mysql and Mcrypt Problem with PHP

I've seen this asked a few times, but not exactly how I'm going to ask it here... Hopefully this is ok with you guys. Basically I have this script that works fine and will print my result without a hitch: $algorithm = MCRYPT_BLOWFISH; $mode =…
Howard Zoopaloopa
  • 3,798
  • 14
  • 48
  • 87
5
votes
9 answers

What's needed for PHP's mcrypt_decrypt()?

I have a script that uses mcrypt_decrypt() function, but I get the following error Fatal error: Call to undefined function mcrypt_decrypt() What modules/libraries do I need to include to use this function? Or is there another reason I'm getting…
John
  • 32,403
  • 80
  • 251
  • 422
5
votes
3 answers

Encrypted data in URLs

I am developing a PHP application to manage orders for a company. To view an order the URL is currently /orders/view/3502. I don't want the order ID number to appear in the URL, so I used CodeIgniter's encrypt library to encrypt the ID in the URL. …
gen_Eric
  • 223,194
  • 41
  • 299
  • 337
5
votes
1 answer

How to decrypt a string with OpenSSL which was previously encrypted with mcrypt?

Since mcrypt was deprecated in PHP 7.1 and I have a lot of data encrypted/decrypted with mcrypt in existing project, how to migrate my PHP code from mcrypt to OpenSSL? I have the following code to encrypt: $encoded =…
Alexander Pravdin
  • 4,982
  • 3
  • 27
  • 30
5
votes
1 answer

Function mcrypt_get_iv_size() is deprecated in Laravel 4.2 on MAMP running PHP 7.1.0

I've just upgraded my MAMP server to run 7.1.0. I'm now getting this error with my Laravel 4.2 installations; Function mcrypt_get_iv_size() is deprecated I've tried changing 'cipher' => MCRYPT_RIJNDAEL_128, to 'cipher' => 'AES-256-CBC', but to…
Jordan D
  • 718
  • 7
  • 21
5
votes
3 answers

Issue with PHP mcrypt function

I use the following function to decrypt data on my server: function decrypt($key, $text) { return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,…
JM4
  • 6,740
  • 18
  • 77
  • 125
5
votes
2 answers

How to do symmetric cryptography without hardcoded key in PHP

I'm using the PHP mcrypt library to cryptograph and store (MySQL) data using AES. I was wondering if there is a good way to do this without having a hardcoded encryption/decryption key in my code. If a hacker gets access to my server he will be able…
Alexandre Justino
  • 1,716
  • 1
  • 19
  • 28