mcrypt extension is deprecated in PHP 7.1 and removed in PHP 7.2

Created on 7 February 2018, almost 7 years ago
Updated 2 February 2024, 11 months ago

Problem/Motivation

The MCrypt function is deprecated from PHP 7.1. and is removed from PHP 7.2.

The the recommended version of this module at the time of this writing (7.x-2.x), has MCrypt as the default.

It is proposed to move MCrypt to a separate project in 7.x-3.x at #2554093: Roadmap to Encrypt 7.x-3.0 . In the meantime, it might be better to throw an exception instead of die outright if MCrypt is not available.

Proposed resolution

  1. Do not set MCrypt as the default. (Do not have any default encryption method.)
  2. Set status of mcrypt_aes_cbc to deprecated i hook_FILENAME_encrypt_encryption_methods().
  3. Fix tests.
  4. Provide upgrade path to convert legacy data.

Remaining tasks

See list above. Strikeout indicate that a task is completed.

User interface changes

Not having any defaults require users to set up a default profile. Prior versions did not require this step.

API changes

None.

Data model changes

None.

🌱 Plan
Status

Needs work

Version

2.0

Component

Code

Created by

🇨🇦Canada alberto56

Live updates comments and jobs are added and updated live.
  • PHP 7.2

    The issue particularly affects sites running on PHP version 7.2.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • There is an issue with proposed resolution item #3. While this module does attempt to decrypt data that was encrypted with mycrypt, the openssl decrypt method fails to decrypt the data with errors like:

    error:03000082:digital envelope routines::invalid key length

    I have attempted this in multiple environments and this seems pretty consistent.

Production build 0.71.5 2024