Latest in branch 2.0 (LTS)
2.0.54
Released 27 Apr 2026
(1 month ago)
Softwarephpseclib
Version2.0 (LTS)
StatusLTS
Supported
Supported
PHP versions
PHP ≥ 5.3.3
Initial release2.0.0
21 Jan 2016
(10 years ago)
Latest release2.0.54
27 Apr 2026
(1 month ago)
Security supportYes
Release noteshttps://github.com/phpseclib/phpseclib/releases/tag/2.0.54
Source codehttps://github.com/phpseclib/phpseclib/tree/2.0.54
Documentationhttps://phpseclib.com/docs/why
phpseclib 2.0 (LTS) ReleasesView full list

What Is New in phpseclib 2.0

phpseclib 2.0 is a major release that modernizes the library with significant internal changes and new features. The focus is on improving code quality, maintainability, and developer experience.

Category Key Changes
New Features Namespaces, Composer support, new Crypt_* class hierarchy.
Improvements Stricter type hints, PSR-4 autoloading, updated dependencies.
Backwards Compatibility Old class names deprecated, OpenSSL fallback removed.
Bug Fixes Various fixes for SSH, SFTP, and X.509 handling.

How does the new namespaced structure work?

The entire library has been restructured to use proper PHP namespaces. This means the old global classes like Crypt_RSA are now deprecated in favor of new namespaced equivalents like phpseclib\Crypt\RSA.

In practice, this makes autoloading cleaner and prevents class name collisions with other projects. You'll need to update your code to use the new class names for full compatibility with future versions.

Example of the new syntax:

use phpseclib\Crypt\RSA;
$rsa = new RSA();

What changed with OpenSSL and pure-PHP implementations?

phpseclib 2.0 removes the automatic fallback to OpenSSL for certain operations. The library now defaults to its own pure-PPHP implementations for consistent behavior across all environments.

This change matters because it eliminates a whole class of potential bugs that occurred when switching between OpenSSL and pure-PHP modes. You can still manually enable OpenSSL if needed, but it's no longer the default fallback.

How has the autoloading been improved?

The library now uses PSR-4 autoloading standards, which is the modern way PHP packages handle class loading. The old phpseclib/phpseclib/phpseclib.php file has been removed.

This means you'll need to use Composer's autoloader or implement your own PSR-4 compatible autoloader. The change simplifies the codebase and makes it more compatible with modern PHP frameworks.

What SSH and SFTP improvements were made?

Several SSH and SFTP components received updates, including better handling of various server implementations and improved file operation reliability. The SSH agent support was also enhanced for better key management.

These improvements make the library more robust when working with different SSH server configurations. You'll notice fewer edge case failures during file transfers and remote command execution.

FAQ

Is phpseclib 2.0 backwards compatible with 1.0?
No, it's not fully backwards compatible. While there's a compatibility layer for old class names, you should update your code to use the new namespaced classes. The old global classes are deprecated and will be removed in future versions.

Do I need Composer to use phpseclib 2.0?
While Composer is the recommended way to install and autoload the library, you can still use it without Composer. You'll need to implement your own PSR-4 compatible autoloader to load the namespaced classes properly.

Why was the OpenSSL fallback removed?
The automatic fallback was removed to ensure consistent behavior across all systems. The pure-PHP implementations have matured enough to handle most use cases reliably, and removing the fallback eliminates a source of hard-to-debug behavioral differences.

What happened to the phpseclib.php file?
It was removed in favor of PSR-4 autoloading. You can no longer include that single file to load the entire library. Use Composer's autoloader or implement your own PSR-4 solution instead.

Are there any new cryptographic algorithms supported?
The focus was on architectural changes rather than adding new algorithms. However, the updated structure makes it easier to add new algorithms in future point releases while maintaining better code organization.

Releases In Branch 2.0 (LTS)

VersionRelease date
2.0.5427 Apr 2026
(1 month ago)
2.0.5310 Apr 2026
(2 months ago)
2.0.5219 Mar 2026
(2 months ago)
2.0.5127 Jan 2026
(4 months ago)
2.0.5015 Dec 2025
(5 months ago)
2.0.4906 Oct 2025
(8 months ago)
2.0.4814 Dec 2024
(1 year ago)
2.0.4726 Feb 2024
(2 years ago)
2.0.4629 Dec 2023
(2 years ago)
2.0.4516 Sep 2023
(2 years ago)
2.0.4413 Jun 2023
(3 years ago)
2.0.4313 Jun 2023
(3 years ago)
2.0.4206 Mar 2023
(3 years ago)
2.0.4123 Dec 2022
(3 years ago)
2.0.4017 Dec 2022
(3 years ago)
2.0.3924 Oct 2022
(3 years ago)
2.0.3802 Sep 2022
(3 years ago)
2.0.3704 Apr 2022
(4 years ago)
2.0.3630 Jan 2022
(4 years ago)
2.0.3529 Nov 2021
(4 years ago)
2.0.3427 Oct 2021
(4 years ago)
2.0.3316 Aug 2021
(4 years ago)
2.0.3214 Jun 2021
(4 years ago)
2.0.3106 Apr 2021
(5 years ago)
2.0.3017 Dec 2020
(5 years ago)
2.0.2908 Sep 2020
(5 years ago)
2.0.2808 Jul 2020
(5 years ago)
2.0.2706 Apr 2020
(6 years ago)
2.0.2623 Mar 2020
(6 years ago)
2.0.2525 Feb 2020
(6 years ago)
2.0.2422 Feb 2020
(6 years ago)
2.0.2317 Sep 2019
(6 years ago)
2.0.2215 Sep 2019
(6 years ago)
2.0.2115 Jul 2019
(6 years ago)
2.0.2023 Jun 2019
(6 years ago)
2.0.1920 Jun 2019
(6 years ago)
2.0.1813 Jun 2019
(7 years ago)
2.0.1726 May 2019
(7 years ago)
2.0.1626 May 2019
(7 years ago)
2.0.1510 Mar 2019
(7 years ago)
2.0.1427 Jan 2019
(7 years ago)
2.0.1316 Dec 2018
(7 years ago)
2.0.1204 Nov 2018
(7 years ago)
2.0.1115 Apr 2018
(8 years ago)
2.0.1019 Feb 2018
(8 years ago)
2.0.929 Nov 2017
(8 years ago)
2.0.829 Nov 2017
(8 years ago)
2.0.723 Oct 2017
(8 years ago)
2.0.605 Jun 2017
(9 years ago)
2.0.508 May 2017
(9 years ago)
2.0.404 Oct 2016
(9 years ago)
2.0.318 Aug 2016
(9 years ago)
2.0.204 Jun 2016
(10 years ago)
2.0.121 Jan 2016
(10 years ago)
2.0.021 Jan 2016
(10 years ago)