PHPackages                             paragonie/pqcrypto\_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. [Security](/categories/security)
4. /
5. paragonie/pqcrypto\_compat

ActiveLibrary[Security](/categories/security)

paragonie/pqcrypto\_compat
==========================

Pure PHP implementation of pqcrypto; uses the PHP extension if it exists

v0.3.2(1mo ago)93.5k↓55.8%[1 issues](https://github.com/paragonie/pqcrypto_compat/issues)3ISCPHPPHP ^8.1CI passing

Since Apr 8Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/paragonie/pqcrypto_compat)[ Packagist](https://packagist.org/packages/paragonie/pqcrypto_compat)[ RSS](/packages/paragonie-pqcrypto-compat/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (3)

pqcrypto\_compat
================

[](#pqcrypto_compat)

[![Build Status](https://github.com/paragonie/pqcrypto_compat/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/pqcrypto_compat/actions)[![Latest Stable Version](https://camo.githubusercontent.com/b2924bfa52e5588b2d55bd73a91f36d8a5856d639771d6dee35236e232a71ff6/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f707163727970746f5f636f6d7061742f762f737461626c65)](https://packagist.org/packages/paragonie/pqcrypto_compat)[![License](https://camo.githubusercontent.com/49438b32797908451c57aad05b6179987bc00e805492b5705a23adc028643d70/68747470733a2f2f706f7365722e707567782e6f72672f70617261676f6e69652f707163727970746f5f636f6d7061742f6c6963656e7365)](https://packagist.org/packages/paragonie/pqcrypto_compat)[![Downloads](https://camo.githubusercontent.com/de159c349eeb7cc389c73092ece2500ea385e2c08b476bf0b326a5b0d5593820/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617261676f6e69652f707163727970746f5f636f6d7061742e737667)](https://packagist.org/packages/paragonie/pqcrypto_compat)

pqcrypto\_compat defers to [the pqcrypto extension](https://github.com/paragonie/ext-pqcrypto) if it's available, and provides a polyfill for environments where it is not available, ensuring the PHP ecosystem can effectively migrate to use post-quantum secure cryptographic algorithms.

Warning

This code has never been independently audited. Use at your own risk.

Installing
----------

[](#installing)

```
composer require paragonie/pqcrypto_compat
```

Optional, but recommended: Install [the pqcrypto extension](https://github.com/paragonie/ext-pqcrypto).

Usage
-----

[](#usage)

The recommended way to use this polyfill library is the Compat class.

Tip

If you aren't already using opcache and JIT, we **highly** recommend enabling those PHP features when using pqcrypto\_compat without ext-pqcrypto. It makes a huge difference.

### X-Wing Example

[](#x-wing-example)

X-Wing is a hybrid KEM combining X25519 and ML-KEM-768. The X25519 implementation is provided by [sodium\_compat](https://github.com/paragonie/sodium_compat).

```
