phpseclib: pure PHP implementations of SSH, SFTP, RSA and X.509

2021 年 1 月 6 日1690

Compatibility

phpseclib is designed to be ultra-compatible. It works on PHP4+ (PHP4, assuming the use of PHP_Compat) and doesn't require any extensions. For purposes of speed, mcrypt is used if it's available as is gmp or bcmath (in that order), but they are not required.

Interoperability

phpseclib is designed to be fully interoperable with OpenSSL and other standardized cryptography programs and protocols.

MIT-Licensed

phpseclib is licensed with the MIT-license. By virtue of not being copyleft it's less restrictive than the GPL, which in turn, means that it's fully .

Usage

This library is written using the same conventions that libraries in the PHP Extension and Application Repository (PEAR) used to be written in (current requirements break PHP4 compatibility). In particular, this library needs to be in your include_path:





<?php



set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');







include('Net/SSH2.php');



?>

Other Branches: 2.0, 3.0 and master

The 2.0 branch has pretty much the exact same API as the 1.0 branch, save for that it is namespaced, uses PHP5-style constructors (thereby avoiding E_DEPRECATED errors) and requires the use of an autoloader. A few examples.

The 3.0 branch has a vastly different API for public key cryptography. It introduces support for Ed25519 / Ed449, Curve25519, Curve449, ECDSA / ECDH (with support for 66 curves), DSA and DH keys. Symmetric key algorithm support is expanded: ChaCha20, Poly1305 and GCM support are added. SHA3 has been added as well. Documentation can be found at phpseclib.com.

The master branch has an unstable API that is subject to change. The master branch will eventually turn into 4.0.

0 0