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
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
14
votes
2 answers

How to build mcrypt library in armv7 architecture?

I'm working on AES Encryption with PJSIP open source library. The library which is used for AES Encryption is not built-in library available in C Programming. So, I have gone with external library (Libmcrypt) for AES Encryption. I followed this site…
Nandhakumar Kittusamy
  • 1,066
  • 12
  • 32
14
votes
8 answers

Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'

I have successfully installed Laravel, but after running php artisan serve and going to localhost:8000 I get this error: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' I have checked phpinfo() on localhost:8888 and…
Philip
  • 301
  • 1
  • 2
  • 10
14
votes
2 answers

Call to undefined function mcrypt_decrypt() - even when php5-mcrypt installed

So I can't stop getting the error: PHP Fatal error: Call to undefined function mcrypt_decrypt() in Even when I have php5_mcrypt installed, I've reinstalled php quite a few times but I can't get it working! More…
13
votes
4 answers

How to install mcrypt on PHP 7.3.3 ubuntu

I tried to follow: PHP Warning: PHP Startup: Unable to load dynamic library 'mcrypt.so' sudo apt-get -y install gcc make autoconf libc-dev pkg-config sudo apt-get -y install php7.2-dev sudo apt-get -y install libmcrypt-dev sudo pecl install…
Elia Weiss
  • 8,324
  • 13
  • 70
  • 110
13
votes
3 answers

mcrypt warning but still decrypts data

I have a bit of a weird one in this class:
Ian Wood
  • 6,515
  • 5
  • 34
  • 73
12
votes
2 answers

Speed of different PHP mcrypt algorithms

Hy guys. Today I was testing the php mcrypt algorithms. I run a test to check the speed of different mcrypt algos. Tested algorithms: Cast-128, Gost, Rijndael-128, Twofish, Cast-256, Loki97, Rijndael-192, Saferplus, Blowfish-compat, Des,…
Tamás Pap
  • 17,777
  • 15
  • 70
  • 102
12
votes
2 answers

mcrypt_encrypt to openssl_encrypt, and OPENSSL_ZERO_PADDING problems

I have this mcrypt_encrypt call, for a given $key, $message and $iv: $string = mcrypt_encrypt(MCRYPT_3DES, $key, $message, MCRYPT_MODE_CBC, $iv); I'd like to change the mcrypt_encrypt call to an openssl_encrypt one, to future-proof this. By having…
yivi
  • 42,438
  • 18
  • 116
  • 138
12
votes
4 answers

PHP sending encrypted data via the URL

I'm trying to send encrypted data over the url to another site (using file_get_contents("anotherUrl.php?hash=$encryptedString"). The problem is, sometimes, the encryption contains some special characters, like +, and this causes the decryption to…
Ali
  • 261,656
  • 265
  • 575
  • 769
12
votes
3 answers

Decrypting the .ASPXAUTH Cookie WITH protection=validation

For quite sometime I've been trying to decipher the ASP .ASPXAUTH cookie and decrypt it using PHP. My reasons are huge and I need to do this, there is no alternative. In PHP so far I have successfully managed to read the data from this cookie, but…
TheFrack
  • 2,823
  • 7
  • 28
  • 47
12
votes
2 answers

Figuring out the exact key created by PHP's mcrypt

A PHP application I'm maintaining uses Rijndael_256 with EBC_MODE encryption with mcrypt. Fun has it that the key isn't 256 bits long, but only 160. According to the mcrypt_encrypt documentation the key is padded with \0 to get the required size if…
Htbaa
  • 2,319
  • 18
  • 28
11
votes
4 answers

Cannot install mcrypt with homebrew and php7.4

OS: macOS 11 (big sur) Homebrew: 2.5.12 PEAR Version: 1.10.12 I just upgraded the php on my mac from php7.1 to php7.4 with homebrew (brew install php@7.4). Then, when I try to install mcrypt extension, I got the error: configure: error: mcrypt.h not…
zhangv
  • 950
  • 1
  • 9
  • 25
11
votes
1 answer

Sending an mcrypt-encrypted string via a URL parameter - decoded text is mangled

I'm messing with a simple authorization scheme. I think the easiest way to do it without SSL or other HTTP auth would be a shared key encryption. Adapting a simple example from the PHP manual, I came up with the following: $text = "boggles the…
julio
  • 6,630
  • 15
  • 60
  • 82
11
votes
5 answers

What are the differences between these encryption algorithms?

What are the difference between MCRYPT_RIJNDAEL_128, MCRYPT_RIJNDAEL_256, MCRYPT_BLOWFISH, etc. Which one is best suitable for data transfer on web?
murvinlai
  • 48,919
  • 52
  • 129
  • 177
1 2
3
61 62