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
23
votes
3 answers

Relation between input and ciphertext length in AES

Having recently started using cryptography in my application, I find myself puzzled by the relationship between the input text length and the ciphertext it results in. Before applying crypto, it was easy to determine the database column size. Now,…
kander
  • 4,226
  • 1
  • 22
  • 43
22
votes
4 answers

Replace Mcrypt with OpenSSL

currently we have a mcrypt implentation on our systems to crypt some sensible data in our PHP application. Now we have a new requirement that we have to change the crypt module to openssl. Another thing which is important know is that we are using…
maTu
  • 289
  • 1
  • 3
  • 10
22
votes
1 answer

Upgrading my encryption library from Mcrypt to OpenSSL

I am using the below commonly referenced library for encryption. I want to upgrade it to OpenSSL from Mcrypt so that I am no longer using a deprecated library. I'm trying to find out if this is even possible. I've done some research on this, but…
Griffin Meyer
  • 684
  • 6
  • 19
21
votes
3 answers

How to add/remove PKCS7 padding from an AES encrypted string?

I'm trying to encrypt/decrypt a string using 128 bit AES encryption (ECB). What I want to know is how I can add/remove the PKCS7 padding to it. It seems that the Mcrypt extension can take care of the encryption/decryption, but the padding has to be…
Ali
  • 261,656
  • 265
  • 575
  • 769
20
votes
6 answers

Mcrypt PHP extension required on Mac OS X

I keep getting this error Mcrypt PHP extension required at the bottom after I run a composer update : Since I am using Mac, I have tried running : brew search mcrypt brew install php56-mcrypt I still get the same error message.
code-8
  • 54,650
  • 106
  • 352
  • 604
19
votes
4 answers

Encryption: Use of initialization vector vs key?

I am using PHP's mcrypt library and the AES-256 (rijndael) algorithm, which requires both a key + initialization vector to run. My logical brainside isn't really going along with this. Isn't just one key enough? Theoretical scenario: If I had…
Industrial
  • 41,400
  • 69
  • 194
  • 289
19
votes
8 answers

mcrypt_decrypt() error change key size

mcrypt_decrypt(): Key of size 15 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported How Can I fix this issue? my key is set - can not change it. It has to be a local change, I think my local PHP version is too advanced for…
Asaf Maoz
  • 675
  • 3
  • 6
  • 23
18
votes
1 answer

Cross platform (php to C# .NET) encryption/decryption with Rijndael

I'm currently having a bit of problem with decrypting a message encrypted by php mcrypt. The php code is as following:
user527113
  • 183
  • 1
  • 1
  • 5
17
votes
1 answer

PHP: Mcrypt - which mode?

I've been testing out the various modes available in PHP's mcrypt function. ECB is the mode used in most tutorials, but isn't recommended by both the just linked page and some users, so I reckon that either CBC or CFB should do the trick. The PHP…
Industrial
  • 41,400
  • 69
  • 194
  • 289
17
votes
10 answers

php error: The Encrypt library requires the Mcrypt extension in codeigniter

I have a login and sign up form and use the encrypt library to encrypt the password.. I am using Xampp for my server and my system works correctly.. code to encrypt the password: $this->encrypt->encode('my password'); add encrypt library …
MGB C
  • 442
  • 2
  • 7
  • 21
17
votes
6 answers

Installing mcrypt on OSX 10.8.2 - PHP 5.3.15 with homebrew

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 |--…
Matanya
  • 6,233
  • 9
  • 47
  • 80
16
votes
5 answers

PHP7.1 mcrypt alternative

Mcrypt function has been deprecated as of PHP 7.1.0. My deprecated string encode / decode functions: $key: secret key $str: string $encoded = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $str, MCRYPT_MODE_CBC,…
Tibi
  • 163
  • 1
  • 1
  • 6
16
votes
3 answers

How to check if mcrypt extension exists in php

I would like to know the simplest and fastest PHP code line to check if mcrypt extension is available/installed. There is a function that encrypts a string and first it requires to check if mcrypt is usable. If not, it will execute an alternative…
Heroselohim
  • 1,241
  • 1
  • 18
  • 23
16
votes
2 answers

Use of undefined constant MCRYPT_BLOWFISH

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 ->…
Ben Rogmans
  • 987
  • 1
  • 14
  • 22
15
votes
3 answers

MCrypt rijndael-128 to OpenSSL aes-128-ecb conversion

Since Mcrypt is deprecated, I want to use OpenSSL instead in my code since we already using php 7.0.17 in our server and there's no tell when they upgrade it. Some third party API (hosted on PHP 5.x probably and using mcrypt), is taking encrypted…
Jamshad Ahmad
  • 410
  • 1
  • 6
  • 16
1
2
3
61 62