{"id":32985692,"url":"https://github.com/thibaultCha/lua-argon2","last_synced_at":"2025-11-18T02:02:13.778Z","repository":{"id":152276763,"uuid":"49388129","full_name":"thibaultcha/lua-argon2","owner":"thibaultcha","description":"Lua C binding for the Argon2 password hashing algorithm","archived":false,"fork":false,"pushed_at":"2023-03-29T19:47:45.000Z","size":109,"stargazers_count":23,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-04T20:07:03.668Z","etag":null,"topics":["argon2","lua"],"latest_commit_sha":null,"homepage":"http://thibaultcha.github.io/lua-argon2/","language":"C","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/thibaultcha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2016-01-10T22:18:31.000Z","updated_at":"2025-03-23T22:20:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"11a61b4a-eb27-43fd-b489-89e34d574c6d","html_url":"https://github.com/thibaultcha/lua-argon2","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/thibaultcha/lua-argon2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-argon2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-argon2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-argon2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-argon2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thibaultcha","download_url":"https://codeload.github.com/thibaultcha/lua-argon2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-argon2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284988465,"owners_count":27095952,"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-11-18T02:00:05.759Z","response_time":61,"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":["argon2","lua"],"created_at":"2025-11-13T08:00:33.766Z","updated_at":"2025-11-18T02:02:13.773Z","avatar_url":"https://github.com/thibaultcha.png","language":"C","readme":"# lua-argon2\n\n[![Module Version][badge-version-image]][luarocks-argon2]\n[![Build Status][badge-travis-image]][badge-travis-url]\n[![Coverage Status][badge-coveralls-image]][badge-coveralls-url]\n\nLua C binding for the [Argon2] password hashing function. Compatible with\nLua 5.x and LuaJIT.\n\n\u003e For LuaJIT or [ngx_lua]/[OpenResty] usage, consider the FFI implementation\n\u003e of this binding:\n\u003e [lua-argon2-ffi](https://github.com/thibaultcha/lua-argon2-ffi).\n\n### Table of Contents\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [Example](#example)\n- [License](#license)\n\n### Requirements\n\nThe [Argon2] shared library must be compiled and available in your system.\n\nCompatibility:\n- Version `1.x` of this module is compatible with Argon2\n  [`20151206`](https://github.com/P-H-C/phc-winner-argon2/releases/tag/20151206).\n- Version `2.x` of this module is compatible with Argon2\n  [`20160406`](https://github.com/P-H-C/phc-winner-argon2/releases/tag/20160406)\n  to [`20161029`](https://github.com/P-H-C/phc-winner-argon2/releases/tag/20161029).\n- Version `3.x` of this module is compatible with Argon2\n  [`20161029`](https://github.com/P-H-C/phc-winner-argon2/releases/tag/20161029)\n  and above.\n\nSee the [CI builds][badge-coveralls-url] for the status of the currently\nsupported versions.\n\n[Back to TOC](#table-of-contents)\n\n### Installation\n\nThis binding can be installed via [Luarocks](https://luarocks.org):\n\n```\n$ luarocks install argon2 ARGON2_INCDIR=\"...\" ARGON2_LIBDIR=\"...\"\n```\n\n`ARGON2_INCDIR` must contain the `argon2.h` header file, and `ARGON2_LIBDIR`\nmust contain the compiled shared library for your platform.\n\nOr by using the Makefile (use the provided variables to point it to your Lua\nand Argon2 installations):\n\n```\n$ make\n```\n\nUsing the Makefile will compile `argon2.so` which must be placed somewhere in\nyour `LUA_CPATH`.\n\n[Back to TOC](#table-of-contents)\n\n### Documentation\n\nThis binding's documentation is available at\n\u003chttp://thibaultcha.github.io/lua-argon2/\u003e.\n\nThe Argon2 password hashing function documentation is available at\n\u003chttps://github.com/P-H-C/phc-winner-argon2\u003e.\n\n[Back to TOC](#table-of-contents)\n\n### Example\n\nHash a password to an encoded string:\n\n```lua\nlocal argon2 = require \"argon2\"\n--- Prototype\n-- local encoded, err = argon2.hash_encoded(pwd, salt, opts)\n\n--- Argon2i\nlocal encoded = assert(argon2.hash_encoded(\"password\", \"somesalt\"))\n-- encoded is \"$argon2i$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$iWh06vD8Fy27wf9npn6FXWiCX4K6pW6Ue1Bnzz07Z8A\"\n\n--- Argon2d\nlocal encoded = assert(argon2.hash_encoded(\"password\", \"somesalt\", {\n  variant = argon2.variants.argon2_d\n}))\n-- encoded is \"$argon2d$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$2+JCoQtY/2x5F0VB9pEVP3xBNguWP1T25Ui0PtZuk8o\"\n\n--- Argon2id\nlocal encoded = assert(argon2.hash_encoded(\"password\", \"somesalt\", {\n  variant = argon2.variants.argon2_id\n}))\n-- encoded is \"$argon2id$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$qLml5cbqFAO6YxVHhrSBHP0UWdxrIxkNcM8aMX3blzU\"\n\n-- Hashing options\nlocal encoded = assert(argon2.hash_encoded(\"password\", \"somesalt\", {\n  t_cost = 4,\n  m_cost = math.pow(2, 16), -- 65536 KiB\n  parallelism = 2\n}))\n-- encoded is \"$argon2i$v=19$m=65536,t=4,p=2$c29tZXNhbHQ$n6x5DKNWV8BOeKemQJRk7BU3hcaCVomtn9TCyEA0inM\"\n\n-- Changing the default options (those arguments are the current defaults)\nargon2.t_cost(3)\nargon2.m_cost(4096)\nargon2.parallelism(1)\nargon2.hash_len(32)\nargon2.variant(argon2.variants.argon2_i)\n```\n\nVerify a password against an encoded string:\n\n```lua\nlocal argon2 = require \"argon2\"\n--- Prototype\n-- local ok, err = argon2.decrypt(hash, plain)\n\nlocal encoded = assert(argon2.hash_encoded(\"password\", \"somesalt\"))\n-- encoded: argon2i encoded hash\n\nlocal ok, err = argon2.verify(encoded, \"password\")\nif err then\n  error(\"could not verify: \" .. err)\nend\n\nif not ok then\n  error(\"The password does not match the supplied hash\")\nend\n```\n\n[Back to TOC](#table-of-contents)\n\n### License\n\nWork licensed under the MIT License. Please check\n[P-H-C/phc-winner-argon2][Argon2] for the license over Argon2 and the reference\nimplementation.\n\n[Back to TOC](#table-of-contents)\n\n[Argon2]: https://github.com/P-H-C/phc-winner-argon2\n[luarocks-argon2]: http://luarocks.org/modules/thibaultcha/argon2\n\n[ngx_lua]: https://github.com/openresty/lua-nginx-module\n[OpenResty]: https://openresty.org\n\n[badge-travis-url]: https://travis-ci.org/thibaultcha/lua-argon2\n[badge-travis-image]: https://travis-ci.org/thibaultcha/lua-argon2.svg?branch=master\n[badge-version-image]: https://img.shields.io/badge/version-3.0.1-blue.svg?style=flat\n[badge-coveralls-url]: https://coveralls.io/github/thibaultcha/lua-argon2?branch=master\n[badge-coveralls-image]: https://coveralls.io/repos/github/thibaultcha/lua-argon2/badge.svg?branch=master\n","funding_links":[],"categories":["Resources"],"sub_categories":["Cryptographic"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FthibaultCha%2Flua-argon2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FthibaultCha%2Flua-argon2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FthibaultCha%2Flua-argon2/lists"}