{"id":13409232,"url":"https://github.com/ozh/phpass","last_synced_at":"2025-03-14T14:31:04.441Z","repository":{"id":21025922,"uuid":"91625972","full_name":"ozh/phpass","owner":"ozh","description":" Openwall phpass, namespaced with composer","archived":true,"fork":false,"pushed_at":"2022-02-23T15:39:06.000Z","size":38,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-20T06:19:52.262Z","etag":null,"topics":["hash","php","phpass"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ozh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-17T22:36:41.000Z","updated_at":"2023-01-28T01:22:15.000Z","dependencies_parsed_at":"2022-08-03T18:31:01.579Z","dependency_job_id":null,"html_url":"https://github.com/ozh/phpass","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozh%2Fphpass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozh%2Fphpass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozh%2Fphpass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozh%2Fphpass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ozh","download_url":"https://codeload.github.com/ozh/phpass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243593322,"owners_count":20316165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hash","php","phpass"],"created_at":"2024-07-30T20:00:59.080Z","updated_at":"2025-03-14T14:31:04.090Z","avatar_url":"https://github.com/ozh.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"Openwall Phpass, modernized\n===========================\n\n[![Build Status](https://app.travis-ci.com/ozh/phpass.svg?branch=master)](https://app.travis-ci.com/github/ozh/phpass)\n\nThis is Openwall's [Phpass](http://openwall.com/phpass/), based on the 0.5 release, but modernized slightly:\n\n- Namespaced\n- Composer support (Autoloading)\n- Unit Tested\n\nThe modernization has been done by Hautelook, from whom I stole this library to originally repackage it for PHP 5.3 to 7.0 compatibility in a single file and branch (Hautelook's port consisting of two branches, one for PHP 5.3 to 5.5, and another one for 5.6+).\n\nCurrent version requires PHP 5.6+\n\n## Installation ##\n\nAdd this requirement to your `composer.json` file and run `composer install`:\n\n    {\n        \"require\": {\n            \"ozh/phpass\": \"1.3.0\"\n        }\n    }\n\n## Usage ##\n\nThe following example shows how to hash a password (to then store the hash in the database), and how to check whether a provided password is correct (hashes to the same value):\n\n``` php\n\u003c?php\n\nnamespace Your\\Namespace;\n\nuse Ozh\\Phpass\\PasswordHash;\n\nrequire_once(__DIR__ . \"/vendor/autoload.php\"); // or require_once('path/to/src/Ozh/Phpass/PasswordHash.php');\n\n$passwordHasher = new PasswordHash(8,false);\n\n// Encrypt\n$password = $passwordHasher-\u003eHashPassword('secret');\nvar_dump($password);\n    // Will output something like:\n    // '$2a$08$a6XFLs8SrjClF1szoDDkI.6gtWVb4//QnzUjkxlus83AKCNjuD8Ha' (length=60)\n    // '$2a$08$Qze1smZ//VAwHJ1t52zklOY/yLwlbKR6Ighf6B7uqGXdYVozTPEdG' (length=60)\n    // '$2a$08$u2uKfE9igO.Cz0SptWxlXeVi0CQglfl3FdRK3YpbGm1NfF1d.CFPm' (length=60)\n\n// Decrypt\nvar_dump( $passwordHasher-\u003eCheckPassword('secret', '$2a$08$0RK6Yw6j9kSIXrrEOc3dwuDPQuT78HgR0S3/ghOFDEpOGpOkARoSu') );\n    // true\nvar_dump( $passwordHasher-\u003eCheckPassword('secret', '$2a$08$Qze1smZ//VAwHJ1t52zklOY/yLwlbKR6Ighf6B7uqGXdYVozTPEdG') );\n    // true\nvar_dump( $passwordHasher-\u003eCheckPassword('secret', '$2a$08$u2uKfE9igO.Cz0SptWxlXeVi0CQglfl3FdRK3YpbGm1NfF1d.CFPm') );\n    // true\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozh%2Fphpass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fozh%2Fphpass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozh%2Fphpass/lists"}