PHPackages                             phpseclib/mcrypt\_compat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phpseclib/mcrypt\_compat

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phpseclib/mcrypt\_compat
========================

PHP 5.x-8.x polyfill for mcrypt extension

2.0.7(1y ago)28129.7M↑10.1%62[5 issues](https://github.com/phpseclib/mcrypt_compat/issues)[1 PRs](https://github.com/phpseclib/mcrypt_compat/pulls)20MITPHPPHP &gt;=5.6.1CI failing

Since Jul 3Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/phpseclib/mcrypt_compat)[ Packagist](https://packagist.org/packages/phpseclib/mcrypt_compat)[ Patreon](https://www.patreon.com/phpseclib)[ Fund](https://tidelift.com/funding/github/packagist/phpseclib/mcrypt_compat)[ RSS](/packages/phpseclib-mcrypt-compat/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (29)Used By (20)

mcrypt\_compat
==============

[](#mcrypt_compat)

[![CI Status](https://github.com/phpseclib/mcrypt_compat/actions/workflows/ci.yml/badge.svg?branch=master&event=push "CI Status")](https://github.com/phpseclib/mcrypt_compat/actions/workflows/ci.yml?query=branch%3Amaster)

PHP 5.x-8.x polyfill for mcrypt extension.

Supporting mcrypt\_compat
-------------------------

[](#supporting-mcrypt_compat)

- [Become a backer or sponsor on Patreon](https://www.patreon.com/phpseclib)
- [One-time donation via PayPal or crypto-currencies](http://sourceforge.net/donate/index.php?group_id=198487)
- [Subscribe to Tidelift](https://tidelift.com/subscription/pkg/packagist-phpseclib-mcrypt-compat?utm_source=packagist-phpseclib-mcrypt-compat&utm_medium=referral&utm_campaign=readme)

Installation
------------

[](#installation)

With [Composer](https://getcomposer.org/):

```
composer require phpseclib/mcrypt_compat

```

Supported algorithms
--------------------

[](#supported-algorithms)

- rijndael-128
- rijndael-192
- rijndael-256
- des
- blowfish
- rc2
- tripledes
- arcfour

Unsupported algorithms
----------------------

[](#unsupported-algorithms)

- cast-128
- gost
- cast-256
- loki97
- saferplus
- wake
- blowfish-compat
- serpent
- xtea
- enigma

Supported modes
---------------

[](#supported-modes)

- cbc
- ncfb
- cfb
- ctr
- ecb
- nofb
- ofb
- stream

mcrypt\_compat's `ncfb` implementation has some incompatibles with mcrypt's implementation where `mcrypt_generic` and `mdecrypt_generic` are concerned. The unit tests elaborate.

Emulating older PHP versions
----------------------------

[](#emulating-older-php-versions)

The mcrypt extension's behavior underwent changes as new versions of PHP were released. By default mcrypt\_compat emulates the behavior of PHP 7.1 but if you need to emulate how mcrypt behaved in, say, PHP 5.3.0, you may do so by doing `define('PHPSECLIB_MCRYPT_TARGET_VERSION', '5.3.0');` before including vendor/autoload.php (if you're using this with Composer).

Security contact information
----------------------------

[](#security-contact-information)

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.

###  Health Score

64

↑

FairBetter than 99% of packages

Maintenance67

Regular maintenance activity

Popularity69

Solid adoption and visibility

Community36

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 92.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~113 days

Recently: every ~64 days

Total

28

Last Release

555d ago

Major Versions

1.0.13 → 2.0.22022-01-30

1.0.14 → 2.0.32022-03-27

1.0.15 → 2.0.42022-12-19

1.0.16 → 2.0.52024-02-23

1.0.17 → 2.0.62024-02-26

PHP version history (3 changes)1.0.0PHP &gt;=5.3.0

1.0.2PHP &gt;=5.3.3

2.0.0PHP &gt;=5.6.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/1214cf33299ce51f30c9c199cf3b55e8630cc16d5df714c551407088937e9988?d=identicon)[terrafrost](/maintainers/terrafrost)

---

Top Contributors

[![terrafrost](https://avatars.githubusercontent.com/u/214474?v=4)](https://github.com/terrafrost "terrafrost (139 commits)")[![shimooka](https://avatars.githubusercontent.com/u/133541?v=4)](https://github.com/shimooka "shimooka (6 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![theodorejb](https://avatars.githubusercontent.com/u/3053271?v=4)](https://github.com/theodorejb "theodorejb (1 commits)")[![theofidry](https://avatars.githubusercontent.com/u/5175937?v=4)](https://github.com/theofidry "theofidry (1 commits)")[![drpayyne](https://avatars.githubusercontent.com/u/22623301?v=4)](https://github.com/drpayyne "drpayyne (1 commits)")[![umitakkaya](https://avatars.githubusercontent.com/u/1472822?v=4)](https://github.com/umitakkaya "umitakkaya (1 commits)")[![KiNgMaR](https://avatars.githubusercontent.com/u/438358?v=4)](https://github.com/KiNgMaR "KiNgMaR (1 commits)")

---

Tags

mcryptmcrypt-extensionpolyfillencryptionmcryptcryptograpy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpseclib-mcrypt-compat/health.svg)

```
[![Health](https://phpackages.com/badges/phpseclib-mcrypt-compat/health.svg)](https://phpackages.com/packages/phpseclib-mcrypt-compat)
```

###  Alternatives

[symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

7.8k1.2B515](/packages/symfony-polyfill-mbstring)[paragonie/random_compat

PHP 5.x polyfill for random\_bytes() and random\_int() from PHP 7

8.2k655.0M405](/packages/paragonie-random-compat)[symfony/polyfill-ctype

Symfony polyfill for ctype functions

4.0k982.0M125](/packages/symfony-polyfill-ctype)[symfony/polyfill-php72

Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions

4.7k674.7M31](/packages/symfony-polyfill-php72)[symfony/polyfill-intl-idn

Symfony polyfill for intl's idn\_to\_ascii and idn\_to\_utf8 functions

3.4k774.6M90](/packages/symfony-polyfill-intl-idn)[symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

2.1k830.2M36](/packages/symfony-polyfill-intl-normalizer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
