{"id":16950400,"url":"https://github.com/wilon/authcode","last_synced_at":"2025-03-21T10:25:51.174Z","repository":{"id":57080883,"uuid":"81402762","full_name":"wilon/authcode","owner":"wilon","description":"PHP string Encryption and Decryption. From discuz source code.","archived":false,"fork":false,"pushed_at":"2017-08-16T03:02:29.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T07:08:04.130Z","etag":null,"topics":["php-encryption","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/wilon.png","metadata":{"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}},"created_at":"2017-02-09T03:05:19.000Z","updated_at":"2022-08-17T08:11:54.000Z","dependencies_parsed_at":"2022-08-24T14:58:06.691Z","dependency_job_id":null,"html_url":"https://github.com/wilon/authcode","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilon%2Fauthcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilon%2Fauthcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilon%2Fauthcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilon%2Fauthcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilon","download_url":"https://codeload.github.com/wilon/authcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244777013,"owners_count":20508630,"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":["php-encryption","php-library"],"created_at":"2024-10-13T21:57:34.953Z","updated_at":"2025-03-21T10:25:51.131Z","avatar_url":"https://github.com/wilon.png","language":"PHP","readme":"# wilon/authcode\n\n[![Packagist][badge_package]][link-packagist]\n[![Packagist Release][badge_release]][link-packagist]\n[![Packagist Downloads][badge_downloads]][link-packagist]\n\n[badge_package]:      https://img.shields.io/badge/package-wilon/authcode-blue.svg?style=flat-square\n[badge_release]:      https://img.shields.io/packagist/v/wilon/authcode.svg?style=flat-square\n[badge_downloads]:    https://img.shields.io/packagist/dt/wilon/authcode.svg?style=flat-square\n[link-packagist]:     https://packagist.org/packages/wilon/authcode\n\nPHP string Encryption and Decryption. From discuz source code.\n\n## Installation \u0026 loading\n\nJust add this line to your `composer.json` file:\n\n```json\n\"wilon/authcode\": \"^1.1.3\"\n```\n\nor\n\n```sh\ncomposer require wilon/authcode\n```\n\n## A Simple Example\n\n##### Encode \u0026 Decode\n\n```php\n\u003c?php\n\nuse Encryption\\Authcode;\n\n$key = 'IoUwe#(#FFFsfoaHFfa';\necho $auth = Authcode::encode('String', $key), '\u003cbr\u003e';\necho $result = Authcode::decode($auth, $key), '\u003cbr\u003e';\n```\n\n```php\n\u003c?php\n\n$key = 'IoUwe#(#FFFsfoaHFfa';\necho $auth = Encryption\\Authcode::encode('String', $key), '\u003cbr\u003e';\necho $result = Encryption\\Authcode::decode($auth, $key), '\u003cbr\u003e';\n```\n\n##### Only correct key can decode\n\n```php\n\u003c?php\n$key = 'IoUwe#(#FFFsfoaHFfa';\necho $auth = Encryption\\Authcode::encode('String', $key), '\u003cbr\u003e';\necho $result2 = Encryption\\Authcode::decode($auth, 'otherKey'), '\u003cbr\u003e';    # Can't get 'String'\n```\n\n##### Use expiry\n\n```php\n$key = 'IoUwe#(#FFFsfoaHFfa';\necho $auth = Encryption\\Authcode::encode('String', $key, 10), '\u003cbr\u003e';\nsleep(11);\necho $result = Encryption\\Authcode::decode($auth, $key), '\u003cbr\u003e';    # Can't get 'String'\n```\n\n##### Encode remain equal signs\n *python without '=' base64.b64decode() can't decode*\n\n```php\n\u003c?php\necho $auth = Encryption\\Authcode::encodeRemainEqualsigns('String', $key), '\u003cbr\u003e';    # has '='\necho $result = Encryption\\Authcode::decode($auth, $key), '\u003cbr\u003e';\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilon%2Fauthcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilon%2Fauthcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilon%2Fauthcode/lists"}