{"id":20527459,"url":"https://github.com/smknstd/laravel-kms-encryption","last_synced_at":"2026-03-10T12:34:53.734Z","repository":{"id":57053932,"uuid":"402798429","full_name":"smknstd/laravel-kms-encryption","owner":"smknstd","description":"Replaces Laravel's built-in encryption with an encryption based on AWS KMS","archived":false,"fork":false,"pushed_at":"2021-09-11T11:41:02.000Z","size":28,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T04:35:03.634Z","etag":null,"topics":["aws","encryption","kms","laravel","laravel-package"],"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/smknstd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null},"funding":{"github":"smknstd"}},"created_at":"2021-09-03T14:31:27.000Z","updated_at":"2024-12-05T14:32:55.000Z","dependencies_parsed_at":"2022-08-24T04:11:47.542Z","dependency_job_id":null,"html_url":"https://github.com/smknstd/laravel-kms-encryption","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/smknstd/laravel-kms-encryption","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smknstd%2Flaravel-kms-encryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smknstd%2Flaravel-kms-encryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smknstd%2Flaravel-kms-encryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smknstd%2Flaravel-kms-encryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smknstd","download_url":"https://codeload.github.com/smknstd/laravel-kms-encryption/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smknstd%2Flaravel-kms-encryption/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30333562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws","encryption","kms","laravel","laravel-package"],"created_at":"2024-11-15T23:19:01.172Z","updated_at":"2026-03-10T12:34:53.714Z","avatar_url":"https://github.com/smknstd.png","language":"PHP","funding_links":["https://github.com/sponsors/smknstd"],"categories":[],"sub_categories":[],"readme":"# Laravel Kms Encryption\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/smknstd/laravel-kms-encryption.svg?style=flat-square)](https://packagist.org/packages/smknstd/laravel-kms-encryption)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/smknstd/laravel-kms-encryption/run-tests?label=tests)](https://github.com/smknstd/laravel-kms-encryption/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/smknstd/laravel-kms-encryption/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/smknstd/laravel-kms-encryption/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/smknstd/laravel-kms-encryption.svg?style=flat-square)](https://packagist.org/packages/smknstd/laravel-kms-encryption)\n\n## Introduction\n\nThis package replaces Laravel's built-in encryption with an encryption based on AWS KMS.\n\nTwo major features provided by kms are:\n- ability to automatically [rotate key](https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) (annually) without deleting the previous ones\n- you don’t have access to the actual key, which means you can’t leak it\n\n_This package has been based on this [blogpost](https://blog.deleu.dev/swapping-laravel-encryption-with-aws-kms/)_\n\n## Installation\n\nThis package requires Laravel 8.x or higher.\n\nYou can install the package via composer:\n\n```bash\ncomposer require smknstd/laravel-kms-encryption\n```\n\nNext you should publish the config file, and setup your values :\n\n```bash\nphp artisan vendor:publish --provider=\"Smknstd\\LaravelKmsEncryption\\LaravelKmsEncryptionServiceProvider\"\n```\n\nIf you want to use IAM Roles that are already setup, aws sdk will automatically use them by default. Otherwise, you should setup credentials to the proper aws user [allowed](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-users) to \"use\" the given kms key, by adding a kms section in your `config/services.php` file :\n\n```\n    'kms' =\u003e [\n        'key' =\u003e env('AWS_ACCESS_KEY_ID'),\n        'secret' =\u003e env('AWS_SECRET_ACCESS_KEY'),\n        'region' =\u003e env('AWS_REGION'),\n    ],\n```\n\nNow everytime you'll [encrypt](https://laravel.com/docs/8.x/encryption) something it will use the provided kms key. It includes all fields using eloquent's [encrypted casting](https://laravel.com/docs/8.x/eloquent-mutators#encrypted-casting). If you have previously encrypted data, be aware that you won't be able to decrypt it.\n\n### Cookies encryption\n\nIf you use laravel's middleware `EncryptCookies`, it can't work with kms. To let the middleware continue working with laravel's encrypter you need to edit `App\\Http\\kernel.php`. Just replace the existing middleware with :\n\n```\n   protected $middlewareGroups = [\n     'web' =\u003e [\n         \\Smknstd\\LaravelKmsEncryption\\Middleware\\EncryptCookies::class,\n         ...\n     ]\n   ]\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Arnaud Becher](https://github.com/smknstd)\n- [Marco Aurélio Deleu](https://github.com/deleugpn)\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%2Fsmknstd%2Flaravel-kms-encryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmknstd%2Flaravel-kms-encryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmknstd%2Flaravel-kms-encryption/lists"}