{"id":13828214,"url":"https://github.com/paragonie/argon2-refiner","last_synced_at":"2025-05-05T20:24:56.466Z","repository":{"id":52800293,"uuid":"196054431","full_name":"paragonie/argon2-refiner","owner":"paragonie","description":"Generate Parameter Recommendations for Argon2id in PHP 7.3+","archived":false,"fork":false,"pushed_at":"2021-04-19T03:01:36.000Z","size":16,"stargazers_count":25,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-05T09:17:30.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://paragonie.com/software","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paragonie.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}},"created_at":"2019-07-09T17:33:06.000Z","updated_at":"2024-05-02T12:57:48.000Z","dependencies_parsed_at":"2022-08-23T06:10:19.623Z","dependency_job_id":null,"html_url":"https://github.com/paragonie/argon2-refiner","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fargon2-refiner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fargon2-refiner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fargon2-refiner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fargon2-refiner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paragonie","download_url":"https://codeload.github.com/paragonie/argon2-refiner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225057699,"owners_count":17414381,"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":[],"created_at":"2024-08-04T09:02:36.837Z","updated_at":"2024-11-17T15:34:37.038Z","avatar_url":"https://github.com/paragonie.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Argon2 Refiner\n\n[![Build Status](https://github.com/paragonie/argon2-refiner/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/argon2-refiner/actions)\n[![Latest Stable Version](https://poser.pugx.org/paragonie/argon2-refiner/v/stable)](https://packagist.org/packages/paragonie/argon2-refiner)\n[![Latest Unstable Version](https://poser.pugx.org/paragonie/argon2-refiner/v/unstable)](https://packagist.org/packages/paragonie/argon2-refiner)\n[![License](https://poser.pugx.org/paragonie/argon2-refiner/license)](https://packagist.org/packages/paragonie/argon2-refiner)\n[![Downloads](https://img.shields.io/packagist/dt/paragonie/argon2-refiner.svg)](https://packagist.org/packages/paragonie/argon2-refiner)\n\nEasily and effectively benchmark the real time to perform\nArgon2id password hashes on your machine.\n\n\u003e Warning: This might take many seconds or minutes to complete.\n\n## Installation Instructions\n\nUse [Composer](https://getcomposer.org/download).\n\n```\ncomposer require paragonie/argon2-refiner\n```\n\nAlternatively, you can install this with Git.\n\n```\ngit clone https://github.com/paragonie/argon2-refiner\ncd argon2-refiner\ncomposer install\n```\n\n## Usage Instructions\n\n### Command Line\n\nRun the bundled `benchmark` script like so:\n\n```\n# Installed via Composer:\nvendor/bin/benchmark [milliseconds=500] [tolerance=250]\n\n# Installed via Git:\ncomposer run-benchmarks [milliseconds=500] [tolerance=250]\n```\n\nThe expected output will look something like this:\n\n```\n$ vendor/bin/benchmark 125\n Recommended Argon2id parameters:\n \t       Memory cost (sodium): 79691776\n \tMemory cost (password_hash): 77824\n \t                  Time cost: 3\n \n Real time: 124ms\n```\n\nThis means that if you set your Argon2id mem_cost to `79691776` bytes\n(or `77824` KiB, which is what `password_hash()` expects) and the \n`time_cost` to 3, you will get the closest parameters that take about \n125 milliseconds to process (in this example, it took 124).\n\n### Object-Oriented API\n\nYou can fine-tune your min/max costs to search within from the object\nby invoking the appropriate methods.\n\n```php\n\u003c?php\nuse ParagonIE\\Argon2Refiner\\ParameterRecommender;\n\n$refiner = (new ParameterRecommender(125))\n    -\u003esetMinMemory(1 \u003c\u003c 20)\n    -\u003esetMaxMemory(1 \u003c\u003c 31)\n    -\u003esetMinTime(2)\n    -\u003esetMaxTime(4)\n    -\u003esetTolerance(25);\n\n$results = $refiner-\u003erunBenchmarks();\n```\n\nThe `runBenchmarks()` method returns a two-dimensional array of arrays.\nEach child array consists of the following data:\n\n* `mem_cost` (int) -- Candidate parameter\n* `time_cost` (int) -- Candidate parameter\n* `bench_time` (int) -- Milliseconds elapsed in Argon2id calculation\n\nFrom this data, you can devise your own strategy for selecting which\nparameters set is most suitable for your environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Fargon2-refiner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparagonie%2Fargon2-refiner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Fargon2-refiner/lists"}