This is an old revision of the document!

PHP RFC: Deprecate (then Remove) Mcrypt


Let's get rid of ext/mcrypt, which is abandonware and inhibits the growth of the language, as soon as humanly possible.


In PHP 7.1, all mcrypt_* functions will raise an E_DEPRECATED notice.

In PHP 7.1+1 (be it 7.2 or 8.0), the mcrypt extension will be moved out of core and into PECL, where people who *really* want to install it may still do so if they can install PHP extensions from PECL.

This RFC does not concern itself with the concept of shims or compatibility layers, and those topics are out of scope. If this RFC passes, another RFC could be drafted by interested parties to propose such a feature at a later date.

Backward Incompatible Changes

Any cryptography code that depends on mcrypt will need to be refactored against openssl. This isn't as difficult as it sounds, provided you're using a trustworthy cipher (e.g. MCRYPT_RIJNDAEL_128). Based on this 3v4l, I can generally conclude that the following MCRYPT ciphers are not currently supported by openssl:

  • GOST
  • TwoFish
  • Loki97
  • RC6
  • Rijndael-192 (not to be confused with AES-192)
  • Rijndael-256 (not to be confused with AES-256)
  • Saferplus
  • Wake
  • Serpent
  • XTEA
  • Enigma

This is an acceptable loss: Most of the ciphers in the list above should not be used in new software anyway. Most cryptography experts would consider their inclusion in any software written in 2016 to be a code smell and indicative of a bad protocol design. Some of them (e.g. Enigma) are outright insecure and should not be used at all.

Proposed PHP Version(s)

Deprecation: Next minor version (7.1.0).

Removal from core: The following major/minor version (7.2.0 or 8.0.0).

Proposed Voting Choices

Vote “Yes” to raise an E_DEPRECATED notice in PHP 7.1 when any mcrypt function is used and to remove the extension from core in 7.1+1.

Vote “No” otherwise.

Since this would break backwards compatibility, a 2/3 majority is required.

Deprecate then Remove Mcrypt from the PHP Core?
Real name Yes No
bwoebi (bwoebi)  
colinodell (colinodell)  
davey (davey)  
derick (derick)  
diegopires (diegopires)  
dmitry (dmitry)  
frozenfire (frozenfire)  
gasolwu (gasolwu)  
jedisct1 (jedisct1)  
krakjoe (krakjoe)  
leigh (leigh)  
lstrojny (lstrojny)  
mariano (mariano)  
mbeccati (mbeccati)  
mcmic (mcmic)  
mightyuhu (mightyuhu)  
mikemike (mikemike)  
nikic (nikic)  
ocramius (ocramius)  
pauloelr (pauloelr)  
philstu (philstu)  
pollita (pollita)  
ramsey (ramsey)  
remi (remi)  
sammyk (sammyk)  
svpernova09 (svpernova09)  
trowski (trowski)  
willfitch (willfitch)  
zimt (zimt)  
Count: 23 6

This vote is opened on March 15th, 2016 and will close March 22nd at 17:00 UTC as announced on list.

Patches and Tests

If this RFC is accepted, I will author the patches to deprecate ext/mcrypt.


Rejected Features

rfc/mcrypt-viking-funeral.1458063906.txt.gz · Last modified: 2017/09/22 13:28 (external edit)