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
7
votes
4 answers

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

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…
HerrimanCoder
  • 6,835
  • 24
  • 78
  • 158
7
votes
6 answers

php extension mcrypt must be loaded

I was following a tutorial online about installing magento on ubuntu but I get this error at the config: php extension mcrypt must be loaded. I already tried: sudo apt-get install php5-mcrypt but this didn't work for me. I had the same problem with…
Loko
  • 6,539
  • 14
  • 50
  • 78
7
votes
2 answers

Best approach to encrypt big files with php

I'm developing a project in php where it's needed to encrypt files uploaded by users. This files could be from 1mb to 200mb more or less. Searching on the web, I came to the conclusion that the best way to do it was dividing files in chunks of,…
Sam Lowry
  • 71
  • 1
  • 2
7
votes
1 answer

PHP Mcrypt, how secure is it really?

At the moment I am working on a project that will handle some quite sensitive personal information, although it are not backaccount numbers it is still sensitive personal information and I want to do everything I can do to encrypt and store this…
Esocoder
  • 1,032
  • 1
  • 19
  • 40
6
votes
1 answer

mcrypt performance

I am encrypting some data and obtaining vastly differing results in srcipt running time between systems. Running my algorithm on a win7 machine the encryption completes in 3-8 thousands of a second. Same code on linux (ubuntu11 and debian6 boxes)…
Ian Wood
  • 6,515
  • 5
  • 34
  • 73
6
votes
1 answer

Why does something encrypted in PHP not match the same string encrypted in Ruby?

Here are my requirements: I need to encrypt a string in PHP using AES encryption (including a random iv), Base64 encode it, then URL-encode it so that it can be passed as a URL parameter. I am trying to get the same result in both PHP and Ruby, but…
John
  • 3,430
  • 2
  • 31
  • 44
6
votes
2 answers

Decrypting blowfish-ecb with nodejs crypto vs php's mcrypt

I'm trying to decode the following base64-encoded ciphertext in Node.js with the built-in crypto…
Adam M-W
  • 3,509
  • 9
  • 49
  • 69
6
votes
1 answer

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

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…
Kris
  • 8,680
  • 4
  • 39
  • 67
6
votes
3 answers

mcrypt encrypt adding s bunch of '%00' to end of string

Working with OAuth and encrypting the keys with the following function with a string which we'll call 'foo' (actually an OAuth token) public function encrypt( $text ) { // add end of text delimiter $data = mcrypt_encrypt(…
Chris Sobolewski
  • 12,819
  • 12
  • 63
  • 96
6
votes
1 answer

Encrypt by mcrypt and decrypt by openssl with mode CBC and cipher BLOWFISH

We have encrypted some data in mcrypt cipher BLOWFISH and mode is CBC String encrypted in php5.5 and need to decrypt this in php7.1 (php version upgraded) Following is our code to trying to decrypt mcrypt string using openssl $data = "Lorem…
Manmohan
  • 720
  • 6
  • 18
6
votes
3 answers

PHP 7.2 with mcrypt in Windows

There are some huge legacy systems whose dependencies on PHPs' mcrypt are extremely important and vital (including the data storage in database). I need to find a way to maintain this library while upgrading to PHP 7.2 (which already worked…
Danilo Davanso
  • 77
  • 1
  • 1
  • 10
6
votes
1 answer

Moving from mcrypt with Blowfish & ECB to OpenSSL

In the (not too distant) past a decision has been made (by someone who longer works here) to always 'encrypt' database IDs to something else, on the fly, whenever it was needed for external communication. Now, we've moved from PHP 5.x to PHP 7.0 for…
Mave
  • 2,413
  • 3
  • 28
  • 54
6
votes
0 answers

How to migrate from mcrypt to openssl with legacy data?

I have some old data that was encrypted using PHP's mcrypt functions. The site is now on PHP 7.1, which means we're hitting deprecation errors. I would like to migrate to use the openssl functions (which seems to be the current recommended…
AdamTheHutt
  • 8,287
  • 8
  • 33
  • 33
6
votes
3 answers

How are my C# and PHP decryption methods different?

I've inherited some C# code and need to port it to PHP. Here it is: string key = "some key"; string strEncrypted = "some encrypted string"; byte[] hashedKey = new MD5CryptoServiceProvider().ComputeHash(UTF8Encoding.UTF8.GetBytes(key)); byte[]…
matthewwithanm
  • 3,733
  • 2
  • 21
  • 27
6
votes
1 answer

AES in JavaScript that matches PHP's mcrypt

Is there any JavaScript libs that lets you encrypt and decrypt 256 bit AES the way you do it with mcrypt in PHP (and get the same result of course)? I want to give it a variable-length message and a 32 chars key. All libs I find wants fixed-length…
Martin
  • 5,197
  • 11
  • 45
  • 60