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

Convert mcrypt_generic to openssl_encrypt

PHP no longer supports mcrypt. I have to make an OpenSSL alternative that has the exact same output as I only have access to half the code base. My attempts have all failed. As you can see below OS doesn't match MC. I've tried different $methods and…
J. Smith
  • 141
  • 7
2
votes
0 answers

encrypted data in Javascript is not being decrypted with php properly

I am encrypting with Cryptojs in javascript with this function. function encode(text, skey) { var base64Iv = "0123456789abcdef"; var key = CryptoJS.enc.Base64.parse(skey); var iv = CryptoJS.enc.Base64.parse(base64Iv); var encrypted…
Mukhammad Ali
  • 810
  • 7
  • 14
2
votes
1 answer

Rijndael 192-bit block size mcrypt alternative

Please read this question before knee-jerking it as a duplicate (although if it actually is, not sure why I couldn't find it, but GREAT!!) We have been using mcrypt with the rijndael-192 module in cfb mode for years now. We have a LOT of stuff…
superphonic
  • 7,954
  • 6
  • 30
  • 63
2
votes
0 answers

Deprecated: Function mcrypt_decrypt() in php

I update my server from 5.45 to 7.1 after that I am getting an error. I am getting the issue in decryptIt function. function encryptIt( $q ) { $cryptKey = 'qJB0rGtIn5UB1xG03efyCp'; $qEncoded = base64_encode( mcrypt_encrypt(…
Naren Verma
  • 2,205
  • 5
  • 38
  • 95
2
votes
2 answers

Php 7.1.9 mcrypt library not found

I have installed Php 7.1.9 on a windows server 2012 machine, if I check the php info I can see that mcrypt is enabled but if I type in shell php -v I have this error: Unable to load dynamic library 'C:/php/ext\php_mcrypt.dll' - The specified module…
Stefano Maglione
  • 3,946
  • 11
  • 49
  • 96
2
votes
1 answer

openssl_encrypt VS mcrypt_encrypt

I have to do AES 128 encryption in CBC mode and match it with the same AES encyption in coldfusion. Here is my code in PHP: function pkcs5_pad($text, $blocksize) { $pad = $blocksize - (strlen($text) % $blocksize); return $text .…
oussama kamal
  • 1,027
  • 2
  • 20
  • 44
2
votes
1 answer

what are NCFB and NOFB modes for?

I can't find it anywhere, when I google it it shows this question posted here. Given that situation I want to ask precisely: What this "n" before cfb and ofb means ?
rsk82
  • 28,217
  • 50
  • 150
  • 240
2
votes
1 answer

Convert framework from mcrypt to openssl

I'm working on developing encrypted session handling. The examples I have been provided use mcrypt, and while I know enough to modify the examples to work for my code, I do not know enough to convert Mcrypt to Openssl. private function…
Cyberpower678
  • 159
  • 1
  • 13
2
votes
1 answer

Convert Mcrypt RC4 to PHP-OpenSSL

I updated a serve from php 5 to php 7 and mcrypt function now is deprecated. I have the following code: $encryptedUserInfo = @mcrypt_encrypt(MCRYPT_ARCFOUR, $sessionKey, $json, MCRYPT_MODE_STREAM); Reading some post in stackoverflow i found this…
TacticJuls
  • 304
  • 1
  • 8
2
votes
2 answers

Mcrypt missing with MAMP Pro 4 on MacOS

There are various threads about this issue happening with earlier versions of MAMP, but most of those threads are dated back to 2014 and now it's 2016 with MAMP Pro having version 4. I need Mcrypt for a legacy codebase / framework. With MAMP Pro 4…
ux.engineer
  • 10,082
  • 13
  • 67
  • 112
2
votes
1 answer

How to get information about a keysize in php-openssl

I want to change the crypt-functions in my php-app from mcrypt to openssl. Now I'm missing a function like mcrypt_enc_get_key_size() in openssl? How do I can read the max. keysize of a cypher-method in openssl? Example:…
fischel
  • 106
  • 1
  • 5
2
votes
3 answers

Incorrect key size when porting Crypto++ AES encryption to PHP's mcrypt

Earlier I managed to port some C++ CryptoPP Rijndael_128 CBC code to MCrypt PHP, but now I'm having problems with CFB mode. The C++ and PHP results do not match (well the first byte matches but this could be coincidence, everything else doesn't).…
winwaed
  • 7,645
  • 6
  • 36
  • 81
2
votes
1 answer

Encrypt with PHP and Decrypt with Java

I have to write a program to decrypt a message using JAVA. The message is encrypted using Triple DES / ECB implemented in PHP. I have tried a few different settings on the algorithm, mode, and padding schema. I do not get the correct result. What is…
TFS
  • 964
  • 1
  • 9
  • 19
2
votes
2 answers

mcrypt_encrypt(): Mcrypt initialisation failed

I downloaded example Laravel 5 project and try to test on my local machine. But I can see errors like following: ErrorException in User.php line 115: mcrypt_encrypt(): Mcrypt initialisation failed 1. in User.php line 115 2. at…
Miron
  • 1,007
  • 2
  • 17
  • 31
2
votes
0 answers

Encrypt with angular CryptoJS and decrypt with PHP

I'm encrypting the data in ECB 256 AES using a key in the javascript and decrypting at php using the username and key. It is encrypting but i'm failing to decrypt in the php. I'm trying to do this in ionic app. In app.js in…
dpk12
  • 95
  • 2
  • 16