PHPackages                             phpseclib/phpseclib - 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. phpseclib/phpseclib

ActiveLibrary[Security](/categories/security)

phpseclib/phpseclib
===================

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

3.0.50(2mo ago)5.6k434.8M↓10.2%908[197 issues](https://github.com/phpseclib/phpseclib/issues)[17 PRs](https://github.com/phpseclib/phpseclib/pulls)20MITPHPPHP &gt;=5.6.1CI failing

Since Jul 7Pushed today108 watchersCompare

[ Source](https://github.com/phpseclib/phpseclib)[ Packagist](https://packagist.org/packages/phpseclib/phpseclib)[ Docs](http://phpseclib.sourceforge.net)[ GitHub Sponsors](https://github.com/terrafrost)[ Patreon](https://www.patreon.com/phpseclib)[ RSS](/packages/phpseclib-phpseclib/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (135)Used By (20)Security (7)

phpseclib - PHP Secure Communications Library
=============================================

[](#phpseclib---php-secure-communications-library)

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

Supporting phpseclib
--------------------

[](#supporting-phpseclib)

- [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-phpseclib?utm_source=packagist-phpseclib-phpseclib&utm_medium=referral&utm_campaign=readme)

Introduction
------------

[](#introduction)

MIT-licensed pure-PHP implementations of the following:

SSH-2, SFTP, X.509, an arbitrary-precision integer arithmetic library, Ed25519 / Ed449 / Curve25519 / Curve449, ECDSA / ECDH (with support for 66 curves), RSA (PKCS#1 v2.2 compliant), DSA / DH, DES / 3DES / RC4 / Rijndael / AES / Blowfish / Twofish / Salsa20 / ChaCha20, GCM / Poly1305

- [Browse Git](https://github.com/phpseclib/phpseclib)

Documentation
-------------

[](#documentation)

- [Documentation / Manual](https://phpseclib.com/)
- [API Documentation](https://api.phpseclib.com/master/) (generated by Doctum)

Branches
--------

[](#branches)

### master

[](#master)

- Development Branch
- Unstable API
- Do not use in production

### 4.0

[](#40)

- Expected Release Date: September 2026
- Long term support (LTS) release
- X509 split into separate X509, CRL, CSR and SPKAC classes
- PFX and CMS classes added
- All ASN1 classes are lazy loaded by default
- Minimum PHP version: 8.1.0
- PSR-4 autoloading with namespace rooted at `\phpseclib4`
- Install via Composer: `composer require phpseclib/phpseclib:4.0.x-dev`

### 3.0

[](#30)

- Long term support (LTS) release
- Major expansion of cryptographic primitives
- Minimum PHP version: 5.6.1
- PSR-4 autoloading with namespace rooted at `\phpseclib3`
- Install via Composer: `composer require phpseclib/phpseclib:~3.0`

### 2.0

[](#20)

- Long term support (LTS) release
- Modernized version of 1.0
- Minimum PHP version: 5.3.3
- PSR-4 autoloading with namespace rooted at `\phpseclib`
- Install via Composer: `composer require phpseclib/phpseclib:~2.0`

### 1.0

[](#10)

- Long term support (LTS) release
- PHP4 compatible
- Composer compatible (PSR-0 autoloading)
- Install using Composer: `composer require phpseclib/phpseclib:~1.0`
- [Download 1.0.25 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.25.zip/download)

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.

Support
-------

[](#support)

Need Support?

- [Checkout Questions and Answers on Stack Overflow](http://stackoverflow.com/questions/tagged/phpseclib)
- [Create a Support Ticket on GitHub](https://github.com/phpseclib/phpseclib/issues/new)

Special Thanks
--------------

[](#special-thanks)

 [ ![Sovereign Tech Agency](https://camo.githubusercontent.com/7b751559686ec8bb0d25a3aa22f4b5a67671169969de21c8fac0be11de542184/68747470733a2f2f7068707365636c69622e636f6d2f696d672f73706f6e736f72732f736f7665726569676e2d746563682d6167656e63792e77656270) ](https://www.sovereign.tech/tech/phpseclib)

Additional Thanks
-----------------

[](#additional-thanks)

- Allan Simon
- [Anna Filina](https://afilina.com/)
- delovelady
- [ChargeOver](https://chargeover.com/)
- [![](https://camo.githubusercontent.com/b5639e7738c6dfae9fe3f3e20175570b7376ce2577a772e09c25c2d4f14bf86e/68747470733a2f2f7265736f75726365732e6a6574627261696e732e636f6d2f73746f726167652f70726f64756374732f636f6d70616e792f6272616e642f6c6f676f732f6a6574627261696e732e737667)](https://jb.gg/OpenSource)

Contributing
------------

[](#contributing)

1. Fork the Project
2. Ensure you have Composer installed (see [Composer Download Instructions](https://getcomposer.org/download/))
3. Install Development Dependencies

    ```
    composer install
    ```
4. Create a Feature Branch
5. Run continuous integration checks:

    ```
    composer run-script all-quality-tools
    ```
6. Send us a Pull Request

###  Health Score

82

—

ExcellentBetter than 100% of packages

Maintenance94

Actively maintained with recent releases

Popularity88

Widely adopted with strong download metrics

Community65

Healthy contributor diversity

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 79.4% 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 ~37 days

Recently: every ~2 days

Total

134

Last Release

53d ago

Major Versions

2.0.50 → 3.0.482025-12-15

1.0.26 → 2.0.512026-01-27

2.0.51 → 3.0.492026-01-27

1.0.27 → 2.0.522026-03-19

2.0.x-dev → 3.0.502026-03-19

PHP version history (3 changes)0.3.0PHP &gt;=5.0.0

2.0.0PHP &gt;=5.3.3

2.0.8PHP &gt;=5.6.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/700dfc1275a703602adf70d48a964c755c19ac49d0b48224aabd95611a336099?d=identicon)[bantu](/maintainers/bantu)

![](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 (4501 commits)")[![bantu](https://avatars.githubusercontent.com/u/189375?v=4)](https://github.com/bantu "bantu (884 commits)")[![phpsyscoder](https://avatars.githubusercontent.com/u/3170463?v=4)](https://github.com/phpsyscoder "phpsyscoder (53 commits)")[![jack-worman](https://avatars.githubusercontent.com/u/66142217?v=4)](https://github.com/jack-worman "jack-worman (46 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (29 commits)")[![rposky](https://avatars.githubusercontent.com/u/1095223?v=4)](https://github.com/rposky "rposky (21 commits)")[![kylekatarnls](https://avatars.githubusercontent.com/u/5966783?v=4)](https://github.com/kylekatarnls "kylekatarnls (12 commits)")[![cweagans](https://avatars.githubusercontent.com/u/101590?v=4)](https://github.com/cweagans "cweagans (11 commits)")[![montdidier](https://avatars.githubusercontent.com/u/1673628?v=4)](https://github.com/montdidier "montdidier (9 commits)")[![andrey012](https://avatars.githubusercontent.com/u/3939722?v=4)](https://github.com/andrey012 "andrey012 (7 commits)")[![paragonie-scott](https://avatars.githubusercontent.com/u/11591518?v=4)](https://github.com/paragonie-scott "paragonie-scott (7 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (7 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (7 commits)")[![williamdes](https://avatars.githubusercontent.com/u/7784660?v=4)](https://github.com/williamdes "williamdes (7 commits)")[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (6 commits)")[![eternalharvest](https://avatars.githubusercontent.com/u/1128403?v=4)](https://github.com/eternalharvest "eternalharvest (6 commits)")[![metaclassing](https://avatars.githubusercontent.com/u/1027733?v=4)](https://github.com/metaclassing "metaclassing (5 commits)")[![felipe-dossantos-iteris](https://avatars.githubusercontent.com/u/79320955?v=4)](https://github.com/felipe-dossantos-iteris "felipe-dossantos-iteris (5 commits)")[![CallMeJon90](https://avatars.githubusercontent.com/u/35259732?v=4)](https://github.com/CallMeJon90 "CallMeJon90 (5 commits)")[![Joey3000](https://avatars.githubusercontent.com/u/3662335?v=4)](https://github.com/Joey3000 "Joey3000 (5 commits)")

---

Tags

aesaes-gcmasn1diffie-hellmandsaecdhecdsaltsphprsasftpsshx509securitycryptographysshencryptionblowfishcryptosignaturesigningrsaaessftpx509asn1BigIntegertwofish

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[ionux/phactor

Phactor is a high-performance PHP implementation of the elliptic curve math functions required to generate &amp; verify private/public (asymmetric) EC keypairs and ECDSA signatures based on secp256k1 curve parameters. This library also includes a class to generate Service Identification Numbers (SINs) based on the published Identity Protocol v1 spec.

5275.0k30](/packages/ionux-phactor)

PHPackages © 2026

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