{"id":25345508,"url":"https://github.com/jmrashed/laravel-cryptographic-signatures","last_synced_at":"2025-10-29T15:31:10.077Z","repository":{"id":277525710,"uuid":"932713206","full_name":"jmrashed/laravel-cryptographic-signatures","owner":"jmrashed","description":"A Laravel package for generating and verifying cryptographic signatures using RSA keys. This package provides easy-to-use methods for securing your data through signatures, ensuring authenticity and integrity.","archived":false,"fork":false,"pushed_at":"2025-02-14T12:02:30.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T12:17:20.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jmrashed.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-14T11:35:28.000Z","updated_at":"2025-02-14T12:02:33.000Z","dependencies_parsed_at":"2025-02-14T12:27:24.700Z","dependency_job_id":null,"html_url":"https://github.com/jmrashed/laravel-cryptographic-signatures","commit_stats":null,"previous_names":["jmrashed/laravel-cryptographic-signatures"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2Flaravel-cryptographic-signatures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2Flaravel-cryptographic-signatures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2Flaravel-cryptographic-signatures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2Flaravel-cryptographic-signatures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmrashed","download_url":"https://codeload.github.com/jmrashed/laravel-cryptographic-signatures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238841932,"owners_count":19539837,"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":[],"created_at":"2025-02-14T12:35:29.943Z","updated_at":"2025-10-29T15:31:09.732Z","avatar_url":"https://github.com/jmrashed.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Cryptographic Signatures\n\nA Laravel package for generating and verifying cryptographic signatures using RSA keys. This package provides easy-to-use methods for securing your data through signatures, ensuring authenticity and integrity.\n\n## Installation\n\nYou can install the package via Composer by running the following command in your Laravel project:\n\n```bash\ncomposer require jmrashed/laravel-cryptographic-signatures\n```\n\n### Publishing Configuration\n\nPublish the package's configuration file to customize your keys:\n\n```bash\nphp artisan vendor:publish --provider=\"Jmrashed\\LaravelCryptographicSignatures\\Providers\\CryptoSignaturesServiceProvider\" --tag=\"config\"\n```\n\nThis will create a `cryptosignature.php` file in the `config/` directory, where you can specify the paths to your private and public keys.\n\n### Configuration\n\nIn your `.env` file, set the paths to your private and public keys:\n\n```env\nCRYPTO_PRIVATE_KEY=storage/keys/private.key\nCRYPTO_PUBLIC_KEY=storage/keys/public.key\n```\n\nHow to generate RSA keys: storage/keys/private.key and storage/keys/public.key\n\n```bash \nopenssl genrsa -out storage/keys/private.key 2048\nopenssl rsa -in storage/keys/private.key -pubout -out storage/keys/public.key\n\n```\n\nMake sure your keys are stored securely in the specified paths.\n\n\n### How to publish config and keys \n\n```bash\nphp artisan vendor:publish --provider=\"Jmrashed\\LaravelCryptographicSignatures\\Providers\\CryptoSignaturesServiceProvider\" --tag=\"config\"\nphp artisan vendor:publish --provider=\"Jmrashed\\LaravelCryptographicSignatures\\Providers\\CryptoSignaturesServiceProvider\" --tag=\"keys\"\n```\n\n## Usage\n\nOnce the package is installed and configured, you can easily generate and verify cryptographic signatures.\n\n### Generating a Signature\n\nUse the `CryptoSignature` facade to generate a signature for your data.\n\n```php\nuse Jmrashed\\LaravelCryptographicSignatures\\Facades\\CryptoSignature;\n\n$data = 'Sensitive data to be signed';\n$signature = CryptoSignature::generateSignature($data);\n\necho \"Generated Signature: \" . $signature;\n```\n\n### Verifying a Signature\n\nYou can also verify a signature to ensure the integrity and authenticity of the data.\n\n```php\nuse Jmrashed\\LaravelCryptographicSignatures\\Facades\\CryptoSignature;\n\n$data = 'Sensitive data to be verified';\n$signature = 'previouslyGeneratedSignature';\n\n$isVerified = CryptoSignature::verifySignature($data, $signature);\n\nif ($isVerified) {\n    echo \"The signature is valid!\";\n} else {\n    echo \"The signature is invalid!\";\n}\n```\n\n## Features\n\n- **Generate cryptographic signatures**: Safely sign your data with a private key.\n- **Verify signatures**: Ensure the authenticity and integrity of data with a public key.\n- **Flexible configuration**: Easily set custom key paths through Laravel’s config system.\n\n## Example\n\nHere’s a complete example that demonstrates generating and verifying a signature:\n\n```php\nuse Jmrashed\\LaravelCryptographicSignatures\\Facades\\CryptoSignature;\n\n$data = 'Sensitive data to be signed';\n\n// Generate the signature\n$signature = CryptoSignature::generateSignature($data);\n\n// Verify the signature\n$isVerified = CryptoSignature::verifySignature($data, $signature);\n\nif ($isVerified) {\n    echo \"The data is verified!\";\n} else {\n    echo \"Signature verification failed!\";\n}\n```\n\n## Testing\n\nTo run tests for the package, use the following command:\n\n```bash\nphp artisan test\n```\n\nMake sure your keys are properly configured in the `.env` file before running the tests.\n\n## License\n\nThe package is open-sourced software licensed under the [MIT license](LICENSE).\n\n## Contributing\n\nContributions are welcome! Please feel free to fork the repository, submit issues, and send pull requests.\n\n- Fork the repo and clone it to your local machine\n- Create a new branch for your changes\n- Write tests for new features or bug fixes\n- Submit a pull request with a description of your changes\n\n## Support\n\nIf you encounter any issues or have questions, feel free to open an issue in the GitHub repository.\n\n## Acknowledgments\n\n- Thanks to Laravel for its amazing framework that makes building packages so easy!\n- OpenSSL for providing secure cryptographic tools that power this package.\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmrashed%2Flaravel-cryptographic-signatures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmrashed%2Flaravel-cryptographic-signatures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmrashed%2Flaravel-cryptographic-signatures/lists"}