{"id":26085274,"url":"https://github.com/codezero-be/encrypter","last_synced_at":"2025-04-12T02:01:32.461Z","repository":{"id":29475055,"uuid":"33011829","full_name":"codezero-be/encrypter","owner":"codezero-be","description":"Encrypt and decrypt data in PHP","archived":false,"fork":false,"pushed_at":"2019-09-26T14:19:05.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T19:43:02.394Z","etag":null,"topics":["encrypter","laravel","php","vanilla-php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/codezero-be.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-27T22:22:36.000Z","updated_at":"2023-11-25T14:59:16.000Z","dependencies_parsed_at":"2022-08-21T08:50:40.999Z","dependency_job_id":null,"html_url":"https://github.com/codezero-be/encrypter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codezero-be%2Fencrypter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codezero-be%2Fencrypter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codezero-be%2Fencrypter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codezero-be%2Fencrypter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codezero-be","download_url":"https://codeload.github.com/codezero-be/encrypter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505862,"owners_count":21115354,"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":["encrypter","laravel","php","vanilla-php"],"created_at":"2025-03-09T05:58:10.778Z","updated_at":"2025-04-12T02:01:32.428Z","avatar_url":"https://github.com/codezero-be.png","language":"PHP","funding_links":["https://ko-fi.com/R6R3UQ8V"],"categories":[],"sub_categories":[],"readme":"# Encrypter\n\n[![GitHub release](https://img.shields.io/github/release/codezero-be/encrypter.svg)]()\n[![License](https://img.shields.io/packagist/l/codezero/encrypter.svg)]()\n[![Build Status](https://scrutinizer-ci.com/g/codezero-be/encrypter/badges/build.png?b=master)](https://scrutinizer-ci.com/g/codezero-be/encrypter/build-status/master)\n[![Code Coverage](https://scrutinizer-ci.com/g/codezero-be/encrypter/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/codezero-be/encrypter/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/codezero-be/encrypter/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/codezero-be/encrypter/?branch=master)\n[![Total Downloads](https://img.shields.io/packagist/dt/codezero/encrypter.svg)](https://packagist.org/packages/codezero/encrypter)\n\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R3UQ8V)\n\n#### Encrypt and decrypt strings in PHP.\n\nThis package includes an adapter for [Laravel](http://laravel.com/)'s `Encrypter` that adheres to my `Encrypter` interface.\nThis can be used in vanilla PHP. Other implementations might be added in the future.\n\n## Installation\n\nInstall this package through Composer:\n\n```php\ncomposer require codezero/encrypter\n```\n\n## Vanilla PHP Implementation\n\nAutoload the vendor classes:\n\n```php\nrequire_once 'vendor/autoload.php'; // Path may vary\n```\n\nChoose a key. You will need the same key that was used to encrypt a string, to decrypt it.\n\n```php\n$key = 'my secret key';\n```\n \nAnd then use the `DefaultEncrypter` implementation:\n\n```php\n$encrypter = new \\CodeZero\\Encrypter\\DefaultEncrypter($key);\n```\n\n## Usage\n\n### Encrypt a string\n\n```php\n$encrypted = $encrypter-\u003eencrypt('some string');\n```\n\n### Decrypt an encrypted string\n\n```php\ntry {\n    $decrypted = $encrypter-\u003edecrypt($encrypted);\n} catch (\\CodeZero\\Encrypter\\DecryptException $exception) {\n    // Decryption failed...\n}\n```\n\n## Testing\n\n```\n$ composer run test\n```\n\n## Security\n\nIf you discover any security related issues, please [e-mail me](mailto:ivan@codezero.be) instead of using the issue tracker.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodezero-be%2Fencrypter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodezero-be%2Fencrypter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodezero-be%2Fencrypter/lists"}