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.

918 questions
21
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
  • 279
  • 1
  • 3
  • 10
21
votes
3 answers

How to install mcrypt extension in xampp

how to install mcrypt in xampp on windows? My PHP Version 7.0.5 and xampp pack have not mcrypt extension so how can i install mcrypt on xampp ?
Dhaval Koradiya
  • 366
  • 1
  • 4
  • 10
20
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,086
  • 1
  • 19
  • 41
19
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…
Click Upvote
  • 235,452
  • 251
  • 553
  • 736
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
  • 36,181
  • 63
  • 182
  • 286
19
votes
5 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.
cyb3rZ
  • 43,853
  • 82
  • 251
  • 430
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
18
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
  • 607
  • 2
  • 6
  • 19
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
  • 36,181
  • 63
  • 182
  • 286
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
  • 5,911
  • 7
  • 43
  • 75
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
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
  • 1,018
  • 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
  • 391
  • 1
  • 4
  • 16
14
votes
3 answers

Decrypting strings in Python that were encrypted with MCRYPT_RIJNDAEL_256 in PHP

I have a function in PHP that encrypts text as follows: function encrypt($text) { $Key = "MyKey"; return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $Key, $text, MCRYPT_MODE_ECB,…
dharmesh
  • 245
  • 1
  • 2
  • 6
14
votes
6 answers

problem with mcrypt installation

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…
Kide
  • 141
  • 1
  • 1
  • 4
1
2
3
61 62