{"id":20163418,"url":"https://github.com/sjinks/php-kupyna","last_synced_at":"2025-04-10T00:36:56.522Z","repository":{"id":14132944,"uuid":"75560715","full_name":"sjinks/php-kupyna","owner":"sjinks","description":"Kupyna (DSTU 7564:2014) Hash Function implementation for PHP","archived":false,"fork":false,"pushed_at":"2025-01-20T13:21:27.000Z","size":165,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T02:22:29.401Z","etag":null,"topics":["dstu7564","hash","kupyna","php","php-extension"],"latest_commit_sha":null,"homepage":"","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/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":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-12-04T19:56:19.000Z","updated_at":"2025-01-31T23:35:13.000Z","dependencies_parsed_at":"2024-03-02T21:26:29.740Z","dependency_job_id":"c8fbc530-ae8c-47d8-9ad5-60a215f8e521","html_url":"https://github.com/sjinks/php-kupyna","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-kupyna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-kupyna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-kupyna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-kupyna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/php-kupyna/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138008,"owners_count":21053775,"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":["dstu7564","hash","kupyna","php","php-extension"],"created_at":"2024-11-14T00:29:30.966Z","updated_at":"2025-04-10T00:36:56.517Z","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-kupyna\n\n[![Build and Test](https://github.com/sjinks/php-kupyna/actions/workflows/test.yml/badge.svg)](https://github.com/sjinks/php-kupyna/actions/workflows/test.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=sjinks_php-kupyna\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=sjinks_php-kupyna)\n\nDSTU 7564:2014 (Kupyna) Hash Function Implementation for PHP.\n\nTested with PHP 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 DSTU 7564:2014 256-, 384-, and 512-bit hash functions to use with PHP [hash](http://php.net/hash) extension.\n\nThe extension registers three hashes:\n  * `kupyna-256` (DSTU 7564:2014 256 bit hash function);\n  * `kupyna-384` (DSTU 7564:2014 384 bit hash function);\n  * `kupyna-512` (DSTU 7564:2014 512 bit hash function);\n\nThese hashes can be used with any function from PHP `hash` extension.\n\nThe extension also makes these functions available:\n  * `string kupyna256_kmac(string $key, string $data)`\n  * `string kupyna384_kmac(string $key, string $data)`\n  * `string kupyna512_kmac(string $key, string $data)`\n\nThese functions return KMAC code (like HMAC, but computed differently) using the 256/384/512-bit key `$key` over the message `$data`.\nIf the key size is less than 256/384/512 bits, the key is hashed with the respective `kupynaXXX` function, and the returned result (which will be of the required size) is used as the key. If the key is longer than required, it will be truncated.\n\n## Installing/Configuring\n\n```bash\nphpize\n./configure\nmake\nsudo make install\n```\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('kupyna256', $data), PHP_EOL;\necho hash('kupyna384', $data), PHP_EOL;\necho hash('kupyna512', $data), PHP_EOL;\n```\n\n**HMAC calculation:**\n\n```php\n$data = 'Very secret data';\n$key  = 'password';\necho hash_hmac('kupyna512', $data, $key);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fphp-kupyna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fphp-kupyna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fphp-kupyna/lists"}