{"id":20463817,"url":"https://github.com/lorddashme/php-cryptor","last_synced_at":"2025-04-13T08:27:58.931Z","repository":{"id":62519034,"uuid":"116091079","full_name":"LordDashMe/php-cryptor","owner":"LordDashMe","description":"A PHP package wrapper for cryptography functions.","archived":false,"fork":false,"pushed_at":"2023-04-01T16:08:51.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T20:22:24.174Z","etag":null,"topics":["cryptography-functions","encryption","hash","php","php-library","security"],"latest_commit_sha":null,"homepage":"","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/LordDashMe.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}},"created_at":"2018-01-03T04:25:40.000Z","updated_at":"2024-06-24T13:42:00.000Z","dependencies_parsed_at":"2022-11-02T10:45:31.045Z","dependency_job_id":null,"html_url":"https://github.com/LordDashMe/php-cryptor","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/LordDashMe%2Fphp-cryptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordDashMe%2Fphp-cryptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordDashMe%2Fphp-cryptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordDashMe%2Fphp-cryptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LordDashMe","download_url":"https://codeload.github.com/LordDashMe/php-cryptor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248683505,"owners_count":21144918,"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":["cryptography-functions","encryption","hash","php","php-library","security"],"created_at":"2024-11-15T13:13:12.203Z","updated_at":"2025-04-13T08:27:58.893Z","avatar_url":"https://github.com/LordDashMe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Cryptor\n\nA package wrapper for PHP cryptography functions.\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/lorddashme/php-cryptor.svg?style=flat-square)](https://packagist.org/packages/lorddashme/php-cryptor) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net/) [![Coverage Status](https://img.shields.io/coveralls/LordDashMe/php-cryptor/master.svg?style=flat-square)](https://coveralls.io/github/LordDashMe/php-cryptor?branch=master)\n\n## Requirement(s)\n\n- PHP version from 5.6.* up to latest.\n\n## Install\n\n- It is advice to install the package via Composer. Use the command below to install the package:\n\n```txt\ncomposer require lorddashme/php-cryptor\n```\n\n## Usage\n\n### List of Wrapped Class Extensions\n\n| Class | Description |\n| ----- | ----------- |\n| \u003cimg width=\"200\" /\u003e | \u003cimg width=\"800\" /\u003e |\n| [OpenSSL](#openssl-class) | Use this extension to encrypt or decrypt a content. |\n| [PasswordHashing](#password-hashing-class) | Use this extension to hash a password content. |\n\n#### OpenSSL Class\n\n- To encrypt plain text.\n\n```php\n\u003c?php\n\ninclude __DIR__  . '/vendor/autoload.php';\n\nuse LordDashMe\\Cryptor\\OpenSSL\\OpenSSL;\n\n// Initialize the OpenSSL class.\n$openssl = new OpenSSL();\n\n// Provide the cipher method that will be using.\n$openssl-\u003ecipherMethod(\n  OpenSSL::CIPHER_METHOD_AES256\n);\n\n// Provide the key that will be using to encrypt the given content.\n$openssl-\u003ekey('password');\n\n// The plain text that will be process to encrypt.\n$openssl-\u003econtent('this is the plain text');\n\n// Execute the encryption process.\n$openssl-\u003eencrypt();\n\n// Output the processed content.\n$openssl-\u003eget(); // echo \"YToyOntzOjc6ImNvbnRlbnQiO3M6MzI6...\"\n```\n\n- To decrypt encrypted content.\n\n```php\n\u003c?php\n\ninclude __DIR__  . '/vendor/autoload.php';\n\nuse LordDashMe\\Cryptor\\OpenSSL\\OpenSSL;\n\n// Initialize the OpenSSL class.\n$openssl = new OpenSSL();\n\n// Provide the cipher method that will be using.\n$openssl-\u003ecipherMethod(\n  OpenSSL::CIPHER_METHOD_AES256\n);\n\n// Provide the key that will be using to encrypt the given content.\n$openssl-\u003ekey('password');\n\n// The encrypted content that will be process to decrypt.\n$openssl-\u003econtent('YToyOntzOjc6ImNvbnRlbnQiO3M6MzI6...');\n\n// Execute the decryption process.\n$openssl-\u003edecrypt();\n\n// Output the processed content.\n$openssl-\u003eget(); // echo \"this is the plain text\"\n```\n\n#### Password Hashing Class\n\n- To hash the content.\n\n```php\n\u003c?php\n\ninclude __DIR__  . '/vendor/autoload.php';\n\nuse LordDashMe\\Cryptor\\PasswordHashing\\PasswordHashing;\n\n// Initialize the Password Hashing class.\n$hashing = new PasswordHashing();\n\n// Provide the algorithm to be use for hashing.\n$hashing-\u003ealgorithm(\n  PasswordHashing::ALGO_PASSWORD_DEFAULT\n);\n\n// Execute the hashing process.\n$hashing-\u003ehash('Need to be hash');\n\n// Output the processed content.\n$hashing-\u003eget(); // echo \"$2y$10$cwzwDA.wXJitJMPQt9ogDe5rf46dASXh8r5DPIyH1Up3HhhROcFti\"\n```\n\n- To re-hash the content.\n\n```php\n\u003c?php\n\ninclude __DIR__  . '/vendor/autoload.php';\n\nuse LordDashMe\\Cryptor\\PasswordHashing\\PasswordHashing;\n\n// Initialize the Password Hashing class.\n$hashing = new PasswordHashing();\n\n// Provide the algorithm to be use for hashing.\n$hashing-\u003ealgorithm(\n  PasswordHashing::ALGO_PASSWORD_DEFAULT\n);\n\n// Execute the re-hashing process.\n$hashing-\u003erehash('Need to be hash', '$2y$10$cwzwDA.wXJitJMPQt9ogDe5rf46dASXh8r5DPIyH1Up3HhhROcFti');\n\n// Output the processed content.\n$hashing-\u003eget(); // echo \"$2y$10$cwzwDA.wXJitJMPQt9ogDe5rf...\"\n```\n\n- To get the info of the hashed content.\n\n```php\n\u003c?php\n\ninclude __DIR__  . '/vendor/autoload.php';\n\nuse LordDashMe\\Cryptor\\PasswordHashing\\PasswordHashing;\n\n// Initialize the Password Hashing class.\n$hashing = new PasswordHashing();\n\n// Execute the get info function.\n$hashing-\u003egetInfo('$2y$10$cwzwDA.wXJitJMPQt9ogDe5rf46dASXh8r5DPIyH1Up3HhhROcFti'); // return array(...)\n```\n\n- To verify the hashed content.\n\n```php\n\u003c?php\n\ninclude __DIR__  . '/vendor/autoload.php';\n\nuse LordDashMe\\Cryptor\\PasswordHashing\\PasswordHashing;\n\n// Initialize the Password Hashing class.\n$hashing = new PasswordHashing();\n\n// Execute the verify function.\n$hashing-\u003everify('Need to be hash', '$2y$10$cwzwDA.wXJitJMPQt9ogDe5rf46dASXh8r5DPIyH1Up3HhhROcFti'); // return boolean\n```\n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florddashme%2Fphp-cryptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florddashme%2Fphp-cryptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florddashme%2Fphp-cryptor/lists"}