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
5
votes
1 answer

Coldfusion 3DES encrypt make the encrypted result different to PHP `mcrypt_encrypt`

At first, Coldfusion Encrypt: #ciphertext# Then, PHP mcrypt: $message =…
Juven
  • 63
  • 4
5
votes
1 answer

Undefined function mcrypt after update OSX to "El Capitan"

I have a problem with mcrypt extension after update "Yosemite" to "El Capitan". Fatal error: Call to undefined function mcrypt_decrypt() in /Users/Pilipe/Sites/prestashop-test/classes/Rijndael.php on line 68 In my php.ini, I added this line…
Pilipe
  • 134
  • 1
  • 8
5
votes
3 answers

mcrypt_encrypt not working properly on PHP 5.6.9

I have the following code which worked fine on PHP 5.5.9. function index() { echo $this->encryptText_3des('TEST','JHHKJH9879'); } function encryptText_3des($plainText, $key) { $key = hash("md5", $key, TRUE); for ($x=0;$x<8;$x++) { …
Saritha Nair
  • 109
  • 1
  • 11
5
votes
1 answer

mcrypt warning on update to php 5.6.2; Key of size x not supported

We are getting the following warning after updating from PHP 5.5.18 to PHP 5.6.2: mcrypt_decrypt(): Key of size 20 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported The encryption algorithm appeared to work fine before…
Arth
  • 12,789
  • 5
  • 37
  • 69
5
votes
2 answers

mcrypt_generic vs mcrypt_encrypt

Does anyone know the difference between mcrypt_generic and mcrypt_encrypt when it comes to encryption in PHP?
Xerri
  • 4,916
  • 6
  • 45
  • 54
5
votes
3 answers

Recreating MCRYPT_RIJNDAEL_128 in node.js

Trying to recreate the following php encryption code in node.js: $size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($size, MCRYPT_RAND); $msg = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128,…
Pasha Bitz
  • 787
  • 6
  • 9
5
votes
2 answers

How can I mcrypt 128 CFB to Ruby?

I need to exchange with a PHP API which crypts the requests and answers. On my side I am in rails 4.0.0 (ruby 2.0) and I cannot make it work. I have read a lot of answers on this subject and have tried to understand how mcrypt works, e.g.…
Stephanie
  • 53
  • 4
5
votes
2 answers

Error: No available formula for php54-mcrypt on Mac OS X Mavericks

I am trying to install mcrypt PHP extension via Homebrew on Mac OS X Mavericks and get the following error. Error: No available formula for php54-mcrypt Help!
Gaurav Gupta
  • 5,380
  • 2
  • 29
  • 36
5
votes
2 answers

How to encrypt big files with php and decrypt over commandline?

I'm writing a small script in PHP to backup my files. Before I transfer the files from the server I want to encrypt them. I did that in previous versions of my script by using exec() and OpenSSL on my Linuxserver. Now I'm looking for a native…
Matthias Dunkel
  • 305
  • 2
  • 14
5
votes
1 answer

mcrypt_encrypt or mcrypt_decrypt is not working with basic html form

Based on some examples on stackoverflow I've created a page which crpyts and decrypts the text that comes from html form. But somehow this is sometimes working sometimes not and usually it is not. Why is this happening? Does htmlencode modifies the…
siniradam
  • 2,727
  • 26
  • 37
5
votes
2 answers

How to do AES256 decryption in PHP?

I have an encrypted bit of text that I need to decrypt. It's encrypted with AES-256-CBC. I have the encrypted text, key, and iv. However, no matter what I try I just can't seem to get it to work. The internet has suggested that mcrypt's Rijndael…
Jeremy Logan
  • 47,151
  • 38
  • 123
  • 143
5
votes
3 answers

Storing credit card details with mcrypt or GnuPG

I have a requirement to store credit card details (not storing is NOT an option). Using mcrypt with mcrypt_dev_random to generate init_vector takes varying ages to encrypt/decrypt but seems is the most 'secure' option. mcrypt_dev_urandom MUCH…
Ian Wood
  • 6,515
  • 5
  • 34
  • 73
5
votes
3 answers

AES encryption in php and then decryption with Javascript (cryptojs)

I'm searching for a way to make a 2 way encryption of a simple text (5 to 6 numbers and/or characters). The catch is that i want to make the encryption in php and then decrypt it via Javascript. For php i've tested using mcrypt_encode and have…
Lyubomir Lyubenov
  • 109
  • 1
  • 1
  • 4
5
votes
1 answer

Does PHP's mcrypt_get_iv_size actually return zero when the IV is not required?

In the PHP documentation for mcrypt_get_iv_size it is stated that the return value will be zero when the algorithm / block mode combination does not use an IV: Returns the size of the Initialization Vector (IV) in bytes. On error the function…
jmalloc
  • 181
  • 1
  • 5
5
votes
1 answer

What's the difference between Blowfish and Blowfish-compat?

I can't seem to find a source for the differences. I've found this difference in this online decryption tool http://www.tools4noobs.com/online_tools/decrypt/ I have some encrypted Blowfish data that I'm trying to decrypt through Python's PyCrypto…
Coldblackice
  • 3,450
  • 4
  • 21
  • 22