Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

phpseclib/phpseclib 3.0.34

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.
Package summary
Share
0
issues
0
licenses
Package created
10 Jun 2012
Version published
27 Nov 2023
Maintainers
2
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does phpseclib/phpseclib do?

PHP Secure Communications Library, also known as phpseclib, is a robust pure-PHP library that provides developers with implementations of RSA, AES, SSH2, SFTP, X.509, and other cryptographic algorithms. It's a crucial tool for ensuring secure communications in PHP applications. It supports numerous cryptographic primitives, including DES, 3DES, RC4, and others. The library includes implementations for various cryptographic functionalities in a PHP-friendly, easy-to-use format.

How do you use phpseclib/phpseclib?

Using phpseclib/phpseclib is straightforward. It can be installed via Composer, a PHP package manager, with the following command: composer require phpseclib/phpseclib:~3.0. The number at the end denotes the version of phpseclib – 3.0 in this case. After installation, the library's functions are available for use in your PHP scripts.

For instance, if you want to connect to a SSH-2 server, the code could look like this:

<?php
include('Net/SSH2.php');

$ssh = new Net_SSH2('www.domain.tld');
if (!$ssh->login('username', 'password')) {
    exit('Login Failed');
}

echo $ssh->exec('pwd');
echo $ssh->exec('ls -la');
?>

Bear in mind that the server's address, as well as the username and password, should be replaced with your own information.

Where are the phpseclib/phpseclib docs?

The official documentation for phpseclib/phpseclib can be found at phpseclib's official website. This includes a Manual with a wide range of topics and examples, providing a detailed guide on how to use the library effectively. For developers seeking more in-depth technical insights, the API documentation is available at api.phpseclib.com/3.0/. These resources are continually updated, providing a reliable source of information for both new and seasoned PHP developers aiming to secure their applications.