{"id":31752058,"url":"https://github.com/ysdragon/argon2","last_synced_at":"2026-02-16T13:32:33.344Z","repository":{"id":318554469,"uuid":"1071751604","full_name":"ysdragon/argon2","owner":"ysdragon","description":"Ring bindings for Argon2 hashing algorithm","archived":false,"fork":false,"pushed_at":"2025-10-27T05:16:51.000Z","size":324,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-27T07:07:37.991Z","etag":null,"topics":["argon2","hash","hashing","openssl","ring-programming-language"],"latest_commit_sha":null,"homepage":"","language":"Ring","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/ysdragon.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-07T19:04:09.000Z","updated_at":"2025-10-27T05:16:55.000Z","dependencies_parsed_at":"2025-10-27T07:06:39.165Z","dependency_job_id":"3c913f10-9ad9-4d32-b7df-39bb0b97b672","html_url":"https://github.com/ysdragon/argon2","commit_stats":null,"previous_names":["ysdragon/argon2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ysdragon/argon2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fargon2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fargon2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fargon2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fargon2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ysdragon","download_url":"https://codeload.github.com/ysdragon/argon2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fargon2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29509119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: 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":["argon2","hash","hashing","openssl","ring-programming-language"],"created_at":"2025-10-09T16:55:05.984Z","updated_at":"2026-02-16T13:32:33.339Z","avatar_url":"https://github.com/ysdragon.png","language":"Ring","readme":"# Ring Argon2\r\n\r\n[license]: https://img.shields.io/github/license/ysdragon/argon2?style=for-the-badge\u0026logo=opensourcehardware\u0026label=License\u0026logoColor=C0CAF5\u0026labelColor=414868\u0026color=8c73cc\r\n[![][license]](https://github.com/ysdragon/argon2/blob/master/LICENSE)\r\n\r\n[ring]: https://img.shields.io/badge/Made_with_❤️_for-Ring-2D54CB?style=for-the-badge\r\n[![][ring]](https://ring-lang.net/)\r\n\r\nA Ring language binding for the [Argon2](https://github.com/P-H-C/phc-winner-argon2) password hashing algorithm, providing secure password hashing and verification capabilities with support for Argon2d, Argon2i, and Argon2id variants.\r\n\r\n## 📖 Overview\r\n\r\nArgon2 is the winner of the Password Hashing Competition (PHC) and is designed to be a memory-hard password hashing algorithm that is resistant to GPU cracking attacks and side-channel attacks.\r\n\r\n## ✨ Features\r\n\r\n- Support for all three Argon2 variants: Argon2d, Argon2i, and Argon2id\r\n- Easy-to-use API for password hashing and verification\r\n\r\n## 📦 Installation\r\n\r\nThis package can be installed using the Ring Package Manager (**RingPM**):\r\n\r\n```\r\nringpm install argon2 from ysdragon\r\n```\r\n\r\n## 💡 Usage\r\n\r\nFirst, load the library in your Ring script:\r\n\r\n```ring\r\nload \"argon2.ring\"\r\n```\r\n\r\n### Basic Password Hashing\r\n\r\nTo hash a password using Argon2id with default parameters:\r\n\r\n```ring\r\ncPassword = \"my_secure_password\"\r\ncSalt = \"somesalt1234\"  # In production, use a securely generated random salt\r\n\r\ncEncodedHash = argon2id_hash(\r\n    cPassword,\r\n    cSalt,\r\n    ARGON2_DEFAULT_T_COST,      # Time cost\r\n    ARGON2_DEFAULT_M_COST,      # Memory cost\r\n    ARGON2_DEFAULT_PARALLELISM, # Parallelism\r\n    ARGON2_DEFAULT_HASH_LEN     # Hash length\r\n)\r\n```\r\n\r\n### Password Verification\r\n\r\nTo verify a password against a stored hash:\r\n\r\n```ring\r\nif argon2id_verify(cEncodedHash, cPassword)\r\n    see \"Verification successful!\" + nl\r\nelse\r\n    see \"Verification failed!\" + nl\r\nok\r\n```\r\n\r\n## ⚙️ Variants\r\n\r\n- **Argon2i**: Resistant to side-channel attacks but potentially weaker against GPU cracking\r\n- **Argon2d**: Provides better resistance against GPU attacks but is vulnerable to side-channel attacks in certain contexts\r\n- **Argon2id**: A hybrid that provides both GPU attack resistance and side-channel protection\r\n\r\n## 📚 API Reference\r\n\r\n### Hashing Functions\r\n\r\n- `argon2i_hash(password, salt, t_cost, m_cost, parallelism, hash_len)` - Hashes a password using Argon2i algorithm\r\n- `argon2d_hash(password, salt, t_cost, m_cost, parallelism, hash_len)` - Hashes a password using Argon2d algorithm\r\n- `argon2id_hash(password, salt, t_cost, m_cost, parallelism, hash_len)` - Hashes a password using Argon2id algorithm\r\n\r\nAll hashing functions take these parameters:\r\n- `password` (string): The password to hash\r\n- `salt` (string): The salt to use for hashing\r\n- `t_cost` (number): Time cost parameter (iterations)\r\n- `m_cost` (number): Memory cost parameter (in KB)\r\n- `parallelism` (number): Parallelism parameter (number of threads)\r\n- `hash_len` (number): Output hash length in bytes\r\n\r\n### Verification Functions\r\n\r\n- `argon2d_verify(encoded_hash, password)` - Verifies a password against an Argon2d encoded hash\r\n- `argon2i_verify(encoded_hash, password)` - Verifies a password against an Argon2i encoded hash\r\n- `argon2id_verify(encoded_hash, password)` - Verifies a password against an Argon2id encoded hash\r\n\r\nAll verification functions take these parameters:\r\n- `encoded_hash` (string): The encoded hash to verify against\r\n- `password` (string): The password to verify\r\n\r\n### Constants\r\n\r\nThe following constants are available after loading the library:\r\n\r\n- `ARGON2_VERSION` - Current Argon2 version\r\n- `ARGON2_DEFAULT_T_COST` - Default time cost (3)\r\n- `ARGON2_DEFAULT_M_COST` - Default memory cost (19456 KB)\r\n- `ARGON2_DEFAULT_PARALLELISM` - Default parallelism (1)\r\n- `ARGON2_DEFAULT_HASH_LEN` - Default hash length (32 bytes)\r\n- `ARGON2_DEFAULT_SALT_LEN` - Default salt length (16 bytes)\r\n\r\n### Error Handling\r\n\r\n- `argon2_error_message(error_code)` - Returns a human-readable error message for an error code\r\n\r\n## 🛠️ Development\r\n\r\nIf you wish to contribute to the development of Ring Argon2 or build it from the source, follow these steps.\r\n\r\n### Prerequisites\r\n\r\n-   **CMake**: Version 3.16 or higher.\r\n-   **C Compiler**: A C compiler compatible with your platform (e.g., GCC, Clang, MSVC).\r\n-   **[Ring](https://ring-lang.net/) Source Code**: You will need to have the Ring language source code available on your machine.\r\n\r\n### Build Steps\r\n\r\n1.  **Clone the Repository:**\r\n    ```sh\r\n    git clone https://github.com/ysdragon/argon2.git --recursive\r\n    ```\r\n    \u003e **Note**: If you installed the library via RingPM, you can skip this step.\r\n\r\n2.  **Set the `RING` Environment Variable:**\r\n    This variable must point to the root directory of the Ring language source code.\r\n\r\n    -   **Windows (Command Prompt):**\r\n        ```cmd\r\n        set RING=X:\\path\\to\\ring\r\n        ```\r\n    -   **Windows (PowerShell):**\r\n        ```powershell\r\n        $env:RING = \"X:\\path\\to\\ring\"\r\n        ```\r\n    -   **Unix-like Systems (Linux, macOS or FreeBSD):**\r\n        ```bash\r\n        export RING=/path/to/ring\r\n        ```\r\n\r\n3.  **Configure with CMake:**\r\n    Create a build directory and run CMake from within it.\r\n    ```sh\r\n    mkdir build\r\n    cd build\r\n    cmake ..\r\n    ```\r\n\r\n4.  **Build the Project:**\r\n    Compile the source code using the build toolchain configured by CMake.\r\n    ```sh\r\n    cmake --build .\r\n    ```\r\n\r\n    The compiled library will be available in the `lib/\u003cos\u003e/\u003carch\u003e` directory.\r\n\r\n## 🤝 Contributing\r\n\r\nContributions are always welcome! If you have suggestions for improvements or have identified a bug, please feel free to open an issue or submit a pull request.\r\n\r\n## 📄 License\r\n\r\nThis project is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for more details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysdragon%2Fargon2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fysdragon%2Fargon2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysdragon%2Fargon2/lists"}