{"id":37006231,"url":"https://github.com/j3j5/hmac-bcrypt-laravel","last_synced_at":"2026-01-14T00:45:01.675Z","repository":{"id":60060299,"uuid":"538695237","full_name":"j3j5/hmac-bcrypt-laravel","owner":"j3j5","description":"A Laravel implementation of the HMAC-Bcrypt algorithm","archived":false,"fork":false,"pushed_at":"2024-06-01T23:52:12.000Z","size":79,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T17:34:12.843Z","etag":null,"topics":["hashing-algorithm","hmac-bcrypt","laravel","passwords","php"],"latest_commit_sha":null,"homepage":"","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/j3j5.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":"2022-09-19T20:58:23.000Z","updated_at":"2024-06-19T22:36:17.000Z","dependencies_parsed_at":"2024-06-02T00:45:00.116Z","dependency_job_id":"a9402db2-dcc4-4965-9aad-b36b6043c27f","html_url":"https://github.com/j3j5/hmac-bcrypt-laravel","commit_stats":{"total_commits":48,"total_committers":3,"mean_commits":16.0,"dds":"0.10416666666666663","last_synced_commit":"fbc18e13cc095c896ec638b9bac4e61b79e3153c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/j3j5/hmac-bcrypt-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3j5%2Fhmac-bcrypt-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3j5%2Fhmac-bcrypt-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3j5%2Fhmac-bcrypt-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3j5%2Fhmac-bcrypt-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j3j5","download_url":"https://codeload.github.com/j3j5/hmac-bcrypt-laravel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3j5%2Fhmac-bcrypt-laravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["hashing-algorithm","hmac-bcrypt","laravel","passwords","php"],"created_at":"2026-01-14T00:45:00.941Z","updated_at":"2026-01-14T00:45:01.669Z","avatar_url":"https://github.com/j3j5.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hmac-bcrypt\n\n![Coverage Badge](https://gist.githubusercontent.com/j3j5/a143261dcd5d0d9456c01f854eccecd0/raw/badge.svg \"PHPUnit coverage\")\n![PHPStan Badge, it reads \"level 9\"](https://img.shields.io/badge/PHPStan-level%209-brightgreen.svg?style=flat\u0026logo=php \"PHPStan Level 9\")\n![Build status for \"main\" branch](https://github.com/j3j5/hmac-bcrypt-laravel/actions/workflows/php.yml/badge.svg?branch=main \"Build status\")\n\nThis repository contains an implementation of the `hmac-bcrypt` password hashing function for the [Laravel Framework](https://github.com/laravel/laravel). It is based on the reference implementation created by [@epixoip]( https://github.com/epixoip ) (specifically [the PHP one](https://github.com/epixoip/hmac-bcrypt/blob/main/php/src/)).\n\nIf you are asking yourself why, you can read the [technical justification](https://github.com/epixoip/hmac-bcrypt#justification) on the original implementation.\n\n## Installation\nIf you want to use it, you can use composer:\n\n```\ncomposer require j3j5/hmac-bcrypt-laravel\n```\n\n## Configuration\nOn your `config/hashing.php` you can change the driver to `hmac-bcrypt`. In order to work, you need to set a _pepper_ which should be a **unique (per project) secret string**. You have two options, either set `HMAC_BCRYPT_PEPPER` on your `.env` or as an environment variable, or add to your own `hashing.php` config file the following array:\n```php\n'hmac-bcrypt' =\u003e [\n    'pepper' =\u003e 'black-pepper'\n],\n```\n\nThe amount of rounds used by bcrypt is also customizable. You can use `HMAC_BCRYPT_ROUNDS` on your `.env` (or as environment variable) or add the key `rounds` to the `hmac-bcrypt` key on your hashing config.\n\n```php\n'hmac-bcrypt' =\u003e [\n    'rounds' =\u003e 15\n],\n```\n\n## Use\nNow you can use it like you would use the hasher on Laravel:\n\n```php\n$clearTextPass = 'supersecret';\n\n$hash = Hash::make($clearTextPass);\n\n// Now store it on the db\n```\n\nLater on...\n\n```php\nif (Hash::check($clearTextPass, $hash)) {\n    // eccoli qua! you can log in your user!\n\n    // Check whether your settings have changed since last time\n    if (Hash::needsRehash($hash)) {\n        $newHash = Hash::make($clearTextPass);\n        // Store the new hash on the db\n    }\n}\n```\n\n## Final notes\n\nAlthough I tried to be very careful and thorough on the implementation, I made this driver for fun so use at your own risk. I encourage you to take a dive into the code to make sure I did not miss anything important or into the tests so you can check for yourself what currently works. Underneath it uses the native PHP functions for SHA512 `hash_hmac()` and `crypt()` for the Bcrypt encryption (with a salt generated by `random_bytes()`), so this is not a case of building your own crypto libraries but instead, using the already available ones.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj3j5%2Fhmac-bcrypt-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj3j5%2Fhmac-bcrypt-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj3j5%2Fhmac-bcrypt-laravel/lists"}