{"id":20163409,"url":"https://github.com/sjinks/php-stribog","last_synced_at":"2025-04-10T00:36:50.710Z","repository":{"id":20962206,"uuid":"24250929","full_name":"sjinks/php-stribog","owner":"sjinks","description":"GOST R 34.11-2012 (Stribog) Hash Function implementation for PHP.","archived":false,"fork":false,"pushed_at":"2024-12-30T17:13:48.000Z","size":190,"stargazers_count":19,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T02:22:26.541Z","etag":null,"topics":["gost3411","gost3411-2012","hash","php","php-extension","stribog"],"latest_commit_sha":null,"homepage":"","language":"C","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/sjinks.png","metadata":{"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"]},"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":"2014-09-20T01:45:35.000Z","updated_at":"2024-12-30T17:14:54.000Z","dependencies_parsed_at":"2023-02-17T19:00:20.555Z","dependency_job_id":"5394e3c1-100b-4f9b-ba39-59aad37f9686","html_url":"https://github.com/sjinks/php-stribog","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-stribog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-stribog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-stribog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-stribog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/php-stribog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138002,"owners_count":21053774,"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":["gost3411","gost3411-2012","hash","php","php-extension","stribog"],"created_at":"2024-11-14T00:29:30.345Z","updated_at":"2025-04-10T00:36:50.703Z","avatar_url":"https://github.com/sjinks.png","language":"C","funding_links":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"],"categories":[],"sub_categories":[],"readme":"# php-stribog\n\n[![Build and Test](https://github.com/sjinks/php-stribog/actions/workflows/test.yml/badge.svg)](https://github.com/sjinks/php-stribog/actions/workflows/test.yml)\n\nGOST R 34.11-2012 (Stribog) Hash Function Implementation for PHP.\n\nTested with PHP 5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, and nightly (8.5 as of writing)\n\n## Introduction\n\nThis extension provides the implementation of GOST R 34.11-2012 256- and 512-bit hash functions to use with PHP [hash](http://php.net/hash) extension.\n\nThe extension does not introduce any new functions; instead, it registers three hashes:\n  * `stribog-256` (GOST R 34.11-2012 256-bit hash function);\n  * `stribog-512` (GOST R 34.11-2012 512-bit hash function);\n  * `stribog` (alias of `stribog-512`).\n\nThese hashes can be used with any function from PHP `hash` extension.\n\nThe implementation of the hash function (`gost3411-2012-*.c`) is based on the implementation by [Alexey Degtyarev](https://www.streebog.net/en/), see `LICENSE.gost`.\nThe changes made to Alexey's code:\n  * the MMX implementation was almost completely rewritten in order not to use SSE instructions;\n  * optimization of 64-bit version of `extract()` — gained extra 0.7 MB/s;\n  * the generic implementation was optimized by removing unnecessary `memcpy` calls;\n  * inline functions instead of macros;\n  * the implementation (generic/MMX/SSE) is chosen at runtime depending on CPU capabilities (GCC 4.6 or newer is required for that);\n  * fixed `add512()` implementation.\n\n## Installing/Configuring\n\n```bash\nphpize\n./configure\nmake\nsudo make install\n```\n\nYou will also need to add\n\n```\nextension=stribog.so\n```\n\nto your `php.ini`.\n\nThere are no configuration directives defined in `php.ini`.\n\n## Usage Example\n\n**Hash calculation:**\n\n```php\n$data = '012345678901234567890123456789012345678901234567890123456789012';\necho hash('stribog256', $data), PHP_EOL;\necho hash('stribog512', $data), PHP_EOL;\necho hash('stribog', $data), PHP_EOL;\n```\n\n**HMAC calculation:**\n\n```php\n$data = 'Very secret data';\n$key  = 'password';\necho hash_hmac('stribog', $data, $key);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fphp-stribog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fphp-stribog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fphp-stribog/lists"}