{"id":28359919,"url":"https://github.com/phpseclib/phpseclib2_compat","last_synced_at":"2026-04-27T09:03:55.454Z","repository":{"id":36639388,"uuid":"229183316","full_name":"phpseclib/phpseclib2_compat","owner":"phpseclib","description":"phpseclib 2.0 polyfill built with phpseclib 3.0","archived":false,"fork":false,"pushed_at":"2026-04-10T01:47:04.000Z","size":97,"stargazers_count":13,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-10T03:24:23.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpseclib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-20T03:30:45.000Z","updated_at":"2026-04-10T01:45:36.000Z","dependencies_parsed_at":"2024-11-10T23:24:04.801Z","dependency_job_id":"8d0fc498-ed3b-40e7-9abb-089c3ee442fe","html_url":"https://github.com/phpseclib/phpseclib2_compat","commit_stats":{"total_commits":44,"total_committers":6,"mean_commits":7.333333333333333,"dds":0.5454545454545454,"last_synced_commit":"af4f77c255884c38536a174ec639f481b9d0cc4b"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/phpseclib/phpseclib2_compat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpseclib%2Fphpseclib2_compat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpseclib%2Fphpseclib2_compat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpseclib%2Fphpseclib2_compat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpseclib%2Fphpseclib2_compat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpseclib","download_url":"https://codeload.github.com/phpseclib/phpseclib2_compat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpseclib%2Fphpseclib2_compat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32329467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-28T10:10:29.900Z","updated_at":"2026-04-27T09:03:55.421Z","avatar_url":"https://github.com/phpseclib.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpseclib2_compat\n\n[![CI Status](https://github.com/phpseclib/phpseclib2_compat/actions/workflows/ci.yml/badge.svg?branch=master\u0026event=push \"CI Status\")](https://github.com/phpseclib/phpseclib2_compat/actions/workflows/ci.yml?query=branch%3Amaster)\n\nphpseclib 2.0 polyfill built with phpseclib 3.0\n\n## Overview\n\nphpseclib 3.0 breaks backwards compatability with phpseclib 2.0. Most notably, public keys work completely differently. So let's say you wanted to use phpseclib 3.0 whilst some of your other dependencies still use phpseclib 2.0. What would you do in that instance?\n\nThat's where phpseclib2_compat comes into play. Require phpseclib/phpseclib:~3.0 and phpseclib/phpseclib2_compat:~1.0 and your dependencies will magically start using phpseclib 3.0 even if they don't know it.\n\nUsing phpseclib2_compat will actually bring a few enhancements to your dependencies. For example, while phpseclib 2.0 only supports RSA keys phpseclib2_compat sports support for ECDSA / DSA / Ed25519 / Ed449 keys.\n\nConsider this code sample:\n\n```php\nuse phpseclib\\Crypt\\RSA;\n\n$rsa = new RSA;\n$rsa-\u003eloadKey('ecdsa private key');\n\n$ssh = new SSH2('website.com');\n$ssh-\u003elogin('username', $rsa);\n```\nThat'll work with phpseclib2_compat, even with an ECDSA private key, whereas in phpseclib 2.0 it would not work.\n\nSSH1 and SCP are not supported but those were likely never frequently used anyway.\n\n## Using the old cipher suite\n\nphpseclib 3.0 uses a different cipher suite (an expanded one) than 2.0. If this causes you issues you can use the 2.0 ciphersuite by doing this prior to calling `$ssh-\u003elogin()`:\n\n```php\n$methods = [\n    'crypt' =\u003e array_intersect([\n        'arcfour256',\n        'arcfour128',\n        'aes128-ctr',\n        'aes192-ctr',\n        'aes256-ctr',\n        'twofish128-ctr',\n        'twofish192-ctr',\n        'twofish256-ctr',\n        'aes128-cbc',\n        'aes192-cbc',\n        'aes256-cbc',\n        'twofish128-cbc',\n        'twofish192-cbc',\n        'twofish256-cbc',\n        'twofish-cbc',\n        'blowfish-ctr',\n        'blowfish-cbc',\n        '3des-ctr',\n        '3des-cbc'\n    ], $ssh-\u003egetSupportedEncryptionAlgorithms()),\n    'mac' =\u003e [\n        'hmac-sha2-256',\n        'hmac-sha1-96',\n        'hmac-sha1',\n        'hmac-md5-96',\n        'hmac-md5'\n    ],\n    'comp' =\u003e ['none']\n];\n\n$ssh-\u003esetPreferredAlgorithms([\n    'kex' =\u003e [\n        'curve25519-sha256@libssh.org',\n        'diffie-hellman-group-exchange-sha256',\n        'diffie-hellman-group-exchange-sha1',\n        'diffie-hellman-group14-sha1',\n        'diffie-hellman-group14-sha256'\n    ],\n    'hostkey' =\u003e [\n        'rsa-sha2-256',\n        'rsa-sha2-512',\n        'ssh-rsa',\n        'ssh-dss'\n    ],\n    'client_to_server' =\u003e $methods,\n    'server_to_client' =\u003e $methods\n]);\n```\n\n## Installation\n\nWith [Composer](https://getcomposer.org/):\n\n```\ncomposer require phpseclib/phpseclib2_compat:~1.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpseclib%2Fphpseclib2_compat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpseclib%2Fphpseclib2_compat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpseclib%2Fphpseclib2_compat/lists"}