# phpseclib/phpseclib

PHP Secure Communications Library

Repository: https://github.com/phpseclib/phpseclib
Canonical: https://ross.abutalabs.com/products/phpseclib
Homepage: http://phpseclib.com/
Language: PHP
License: MIT
License Family: permissive
Topics: php, ssh, sftp, rsa, aes, x509, asn1, ecdsa, ecdh, aes-gcm, dsa, diffie-hellman, lts
Last push: 2026-08-26T12:17:07+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 99, longevity 100
- inputs: {"age_days": 5202, "days_push": 7, "days_rel": 7, "gap_med": 0.0, "n_releases_24m": 33}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5585, forks 907 (observed 2026-08-28T04:09:22.596554+00:00)

## What it is
A MIT-licensed pure-PHP library providing implementations of SSH-2, SFTP, X.509/CSR/CRL/PFX/CMS, and a wide range of cryptographic primitives including RSA, ECDSA, Ed25519, AES, and ChaCha20-Poly1305. It requires no PHP extensions, optionally using OpenSSL, GMP, or libsodium for speed, with multiple LTS branches supporting PHP from 4.4 to 8.1+.

## Use cases
- connect to ssh servers from php
- upload files over sftp in php
- encrypt and decrypt data with rsa in php
- generate and parse x509 certificates
- sign and verify jwt-like signatures with ed25519
- encrypt files with aes-gcm or chacha20-poly1305
- create certificate signing requests (csr)
- interoperate with openssl, java, or python crypto

## When to choose
- you need SSH/SFTP or PKI functionality in PHP without relying on shell exec or extensions
- you need portability across shared hosts where openssl/gmp may be unavailable
- you need fine-grained control over crypto parameters like OAEP hashes or cipher modes
- you need to support old PHP versions via the 1.0/2.0/3.0 LTS branches

## When to avoid
- you only need basic TLS/HTTPS - use curl or guzzle instead
- you need a full SSH client with terminal emulation or port forwarding - use openssh
- you need maximum crypto performance and can require the openssl extension directly
- you need languages other than PHP

## Facets
- artifact type: library
- maturity: stable
- function: cryptography, ssh, security, serialization
- domain: security, developer-tools, web-development
- platform: php, cross-platform
- tags: ssh2, sftp, x509, rsa, aes, pure-php, pki, asn1, elliptic-curves

## Member repositories
- phpseclib/phpseclib (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:22.596554+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:55:32.650440+00:00, confidence not recorded.
  - readme: https://github.com/phpseclib/phpseclib (fetched 2026-08-28T04:09:22.596554+00:00, sha fa09d07ad7d6)
  - homepage: http://phpseclib.com/ (fetched 2026-08-29T08:50:36.072356+00:00, sha 37b233d83cc5)
  - site_page: https://phpseclib.com/docs/intro/why (fetched 2026-08-29T08:50:36.081585+00:00, sha 4d44d524e971)
  - site_page: https://phpseclib.com/docs/3.0/intro/why (fetched 2026-08-29T08:50:36.084962+00:00, sha 708f096ae153)
  - site_page: https://phpseclib.com/docs/ssh2/connect (fetched 2026-08-29T08:50:36.087010+00:00, sha 7340b8dc3b38)
  - site_page: https://phpseclib.com/docs/publickeys/overview (fetched 2026-08-29T08:50:36.088924+00:00, sha 67a546007358)
  - site_page: https://phpseclib.com/docs/symmetric/overview (fetched 2026-08-29T08:50:36.091138+00:00, sha 08adb5cf6fda)
  - site_page: https://phpseclib.com/docs/file/overview (fetched 2026-08-29T08:50:36.093050+00:00, sha c05b4df431bc)
  - site_page: https://phpseclib.com/docs/intro/speed (fetched 2026-08-29T08:50:36.094805+00:00, sha 88e6c709c34c)
  - site_page: https://phpseclib.com/docs/interop/overview (fetched 2026-08-29T08:50:36.096615+00:00, sha 390128b2e3c1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
