{"id":15029171,"url":"https://github.com/ahsankhatri/cryptolib-php","last_synced_at":"2025-08-10T23:46:34.714Z","repository":{"id":56942578,"uuid":"160541698","full_name":"ahsankhatri/cryptolib-php","owner":"ahsankhatri","description":"A library to encrypt or decrypt with random password generator based on secret key defined.","archived":false,"fork":false,"pushed_at":"2023-12-19T05:54:42.000Z","size":11,"stargazers_count":14,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-23T05:14:06.988Z","etag":null,"topics":["decryption","encryption","php","php7","rijndael-aes-cipher"],"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/ahsankhatri.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2018-12-05T15:49:27.000Z","updated_at":"2025-01-05T10:52:12.000Z","dependencies_parsed_at":"2025-02-15T21:31:45.280Z","dependency_job_id":"8e473a06-46f1-49ac-85b6-7e5273eb1434","html_url":"https://github.com/ahsankhatri/cryptolib-php","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ahsankhatri/cryptolib-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahsankhatri%2Fcryptolib-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahsankhatri%2Fcryptolib-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahsankhatri%2Fcryptolib-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahsankhatri%2Fcryptolib-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahsankhatri","download_url":"https://codeload.github.com/ahsankhatri/cryptolib-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahsankhatri%2Fcryptolib-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269808823,"owners_count":24478509,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["decryption","encryption","php","php7","rijndael-aes-cipher"],"created_at":"2024-09-24T20:09:52.711Z","updated_at":"2025-08-10T23:46:34.689Z","avatar_url":"https://github.com/ahsankhatri.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CryptoLib (PHP)\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/ahsankhatri/cryptolib-php.svg?style=flat-square)](https://packagist.org/packages/ahsankhatri/cryptolib-php)\n![tests](https://github.com/ahsankhatri/cryptolib-php/actions/workflows/php-test.yml/badge.svg)\n[![Total Downloads](https://img.shields.io/packagist/dt/ahsankhatri/cryptolib-php.svg?style=flat-square)](https://packagist.org/packages/ahsankhatri/cryptolib-php)\n[![License](https://poser.pugx.org/ahsankhatri/cryptolib-php/license?format=flat-square)](https://packagist.org/packages/ahsankhatri/cryptolib-php)\n\n\nThis is the library for encrypting data with a key (password will be generate as per your parameters set) in PHP.\n\n**WHY ANOTHER LIBRARY?** This was intended to developed for cross-platform AES Encryption [here](https://github.com/skavinvarnan/Cross-Platform-AES) as PHP was missing. My main objective is to create library for `AES-256-CBC` to contribute PHP package for Cross-Platform-AES package, more features will be added whenever I gets time.\n\n### Features\n\n- Support for Random IV (initialization vector) for encryption and decryption. Randomization is crucial for encryption schemes to achieve semantic security, a property whereby repeated usage of the scheme under the same key does not allow an attacker to infer relationships between segments of the encrypted message.\n- Support for SHA-256 for hashing the key. Never use plain text as encryption key. Always hash the plain text key and then use for encryption. AES permits the use of 256-bit keys. Breaking a symmetric 256-bit key by brute force requires 2^128 times more computational power than a 128-bit key. A device that could check a billion billion (10^18) AES keys per second would in theory require about 3×10^51 years to exhaust the 256-bit key space.\n- PHP-7 Support since `mcrypt` has been deprecated.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require ahsankhatri/cryptolib-php\n```\n\n## Dependencies\n\nThe bindings require the following extensions in order to work properly:\n\n- [`openssl`](https://secure.php.net/manual/en/book.openssl.php)\n\nIf you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.\n\n## Usage\n\n#### With Random IV\n\n``` php\n$string     = 'The quick brown fox jumps over to the lazy dog.';\n$secretyKey = 'BlVssQKxzAHFAUNZbqvwS+yKw/m';\n\n$encryption = new \\MrShan0\\CryptoLib\\CryptoLib();\n\n$cipher  = $encryption-\u003eencryptPlainTextWithRandomIV($string, $secretyKey);\necho 'Cipher: ' . $cipher . PHP_EOL;\n\n$plainText = $encryption-\u003edecryptCipherTextWithRandomIV($cipher, $secretyKey);\necho 'Decrypted: ' . $plainText . PHP_EOL;\n```\n\n#### With Generated IV\n\n``` php\n$string     = 'The quick brown fox jumps over to the lazy dog.';\n$secretyKey = 'BlVssQKxzAHFAUNZbqvwS+yKw/m';\n\n$encryption = new \\MrShan0\\CryptoLib\\CryptoLib();\n$iv         = $encryption-\u003egenerateRandomIV();\n\n$cipher = $encryption-\u003eencrypt($string, $secretyKey, $iv);\necho 'Cipher: ' . $cipher . PHP_EOL;\n\n$plainText = $encryption-\u003edecrypt($cipher, $secretyKey, $iv);\necho 'Decrypted: ' . $plainText . PHP_EOL;\n```\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email ahsankhatri1992@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [Ahsaan Muhammad Yousuf](https://ahsaan.me)\n- [All Contributors](../../contributors)\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%2Fahsankhatri%2Fcryptolib-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahsankhatri%2Fcryptolib-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahsankhatri%2Fcryptolib-php/lists"}