{"id":22564183,"url":"https://github.com/lucascompython/argon2-bench-rust","last_synced_at":"2025-08-27T19:17:50.395Z","repository":{"id":266841768,"uuid":"899516688","full_name":"lucascompython/argon2-bench-rust","owner":"lucascompython","description":"Benchmark between different crates that provide password hashing in Rust","archived":false,"fork":false,"pushed_at":"2024-12-09T23:40:46.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T13:15:12.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucascompython.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":"2024-12-06T12:34:24.000Z","updated_at":"2024-12-09T23:40:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"458c9ca5-d57b-4cf9-b828-2c9c688ea48d","html_url":"https://github.com/lucascompython/argon2-bench-rust","commit_stats":null,"previous_names":["lucascompython/argon2-bench-rust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lucascompython/argon2-bench-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fargon2-bench-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fargon2-bench-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fargon2-bench-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fargon2-bench-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucascompython","download_url":"https://codeload.github.com/lucascompython/argon2-bench-rust/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucascompython%2Fargon2-bench-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272366799,"owners_count":24922221,"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","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"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":"2024-12-07T23:14:20.486Z","updated_at":"2025-08-27T19:17:50.389Z","avatar_url":"https://github.com/lucascompython.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Benchmark between different crates that provide password hashing in Rust\n\nThe crates being here benchmarked are:\n\n- [argon2](https://crates.io/crates/argon2) - Rust Implementation\n- [rust-argon2](https://crates.io/crates/rust-argon2) - Rust Implementation\n- [argon2-kdf](https://crates.io/crates/argon2-kdf) - Bindings to the C implementation\n- [scrpyt](https://crates.io/crates/scrypt) - Rust Implementation\n- [bcrypt](https://crates.io/crates/bcrypt) - Rust Implementation\n\nArgon2 parameters used in the benchmark:\n\n- `m=65536`\n- `t=4`\n- `p=4`\n- `password=\"password\"`\n- `salt=randomly generated with rand::rngs::OsRng`\n- `salt_length=16`\n- `hash_length=32`\n- `version=13`\n- `variant=Argon2id`\n\nScrypt parameters used in the benchmark:\n\n- `log_n=16`\n- `r=8`\n- `p=1`\n\nBcrypt parameters used in the benchmark:\n\n- `cost=10`\n\nThe benchmark is done using the [criterion](https://crates.io/crates/criterion) crate.  \n\n## Results\n\n`argon2-kdf` seems to be the fastest.  \nThese are the results of the benchmark on my machine AMD Ryzen 9 7950X (32) @ 5.88 GHz:\n\nRust Results:\n\n```bash\nargon2 hash password    time:   [71.344 ms 71.489 ms 71.638 ms]\n\nargon2 verify password  time:   [70.104 ms 70.234 ms 70.368 ms]\n\nrust_argon2 hash password    time:   [128.73 ms 128.91 ms 129.14 ms]\n\nrust_argon2 verify password    time:   [133.18 ms 133.37 ms 133.57 ms]\n\nargon2_kdf hash password    time:   [23.596 ms 23.644 ms 23.693 ms]\n\nargon2_kdf verify password    time:   [23.525 ms 23.594 ms 23.667 ms]\n\nscrypt hash password    time:   [89.648 ms 89.763 ms 89.896 ms]\n\nscrpyt verify password  time:   [90.840 ms 91.009 ms 91.185 ms]\n\nbcrypt hash password    time:   [37.686 ms 37.711 ms 37.739 ms]\n\nbcrypt verify password  time:   [37.660 ms 37.692 ms 37.733 ms]\n```\n\nPHP Results for comparison:\n\n```bash\nBcrypt hash elapsed time: 34.893989562988 ms\nBcrypt verify elapsed time: 34.30700302124 ms\nArgon2id hash elapsed time: 36.846876144409 ms\nArgon2id verify elapsed time: 37.317037582397 ms\n```\n\n## Running the benchmark\n\nJust run `cargo bench` in the root of the project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucascompython%2Fargon2-bench-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucascompython%2Fargon2-bench-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucascompython%2Fargon2-bench-rust/lists"}