{"id":16296707,"url":"https://github.com/hernandev/laravel-aead","last_synced_at":"2025-10-07T01:47:40.925Z","repository":{"id":31885395,"uuid":"130483123","full_name":"hernandev/laravel-aead","owner":"hernandev","description":"Advanced Encryption with Associated Data (AEAD) for Laravel.","archived":false,"fork":false,"pushed_at":"2022-02-08T15:54:00.000Z","size":30,"stargazers_count":5,"open_issues_count":4,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T14:49:08.115Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hernandev.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-04-21T14:49:43.000Z","updated_at":"2022-09-26T07:59:11.000Z","dependencies_parsed_at":"2022-08-07T17:00:40.517Z","dependency_job_id":null,"html_url":"https://github.com/hernandev/laravel-aead","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hernandev%2Flaravel-aead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hernandev%2Flaravel-aead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hernandev%2Flaravel-aead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hernandev%2Flaravel-aead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hernandev","download_url":"https://codeload.github.com/hernandev/laravel-aead/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244552530,"owners_count":20471113,"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":"2024-10-10T20:23:43.329Z","updated_at":"2025-10-07T01:47:35.890Z","avatar_url":"https://github.com/hernandev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaravelAEAD.\n\n**LaravelAEAD** is a library which provides *Advanced Encryption with Associated Data* (AEAD) for Laravel.\n\n## Abstract:\nThis package replaces, when installed and enabled, the default encryption implementation of Laravel, which currently supports only two variants of the same block cipher, `AES-128-CBC` and `AES-256-CBC`.\n\nThe reason for only having two options is probably based on PHP history itself, like the (not so much) rececent depreciation of MCrypt.\n\nAs of PHP 7.2, we can now count on the exceptional `libsodium` extension, with supports the most secure AEAD construtions and it's variants.\n\nAEAD stands for Advanced Encryption, with Associated Data, and they are algorithms which combine a **stream cipher** with a **message authentication** code (MAC).\n\nThe result of such combination is a encryption scheme with provides three aspects that are useful for modern applications:\n- Confidentiality\n- Integrity\n- Authenticity\n\nFor more information on AEAD, I highly recommend [reading the libsodium documentation](https://download.libsodium.org/doc/secret-key_cryptography/aead.html), which states the main parts, but, reading the construction IETF RFC's is also something interesting if you care for security.\n\n## Available Constructions.\n\nThose are the libsodium AEAD constructors, and they respective key for usage with this package.\n\n| AEAD Cipher / Contruction | Key Size  | Nonce Size  | Config Key (config/app.php) \n| -                         | -         | -           | - \n| XChaCha20-Poly1305-IEFT   | 256 bits  | 192 bits    | 'XCHACHA20-POLY1305-IEFT'\n| ChaCha20-Poly1305-IEFT    | 256 bits  | 96 bits     | 'CHACHA20-POLY1305-IEFT'\n| ChaCha20-Poly1305         | 256 bits  | 64 bits     | 'CHACHA20-POLY1305'\n| AES-256-GCM               | 256 bits  | 96 bits     | 'AES-256-GCM'\n\n## Installing \u0026 Configuring.\n\nInstalling the Library.\n\n```php\ncomposer require hernandev/laravel-aead\n```\n\nChanging the authentication provider (on config/app.php):\n\n```php\n    // YOU MUST COMMENT OUT THE DEFAULT ENCRYPTION CLASS\u003e\n    // Illuminate\\Encryption\\EncryptionServiceProvider::class,\n    // THIS ONE SHOULD BE USED INSTEAD.\n    LaravelAEAD\\Providers\\EncryptionServiceProvider::class,\n```\n\nConfiguring the cipher (also on config/app.php):\n\n```php\n    'cipher' =\u003e 'XCHACHA20-POLY1305-IETF',\n```\n\n## Usage.\n\nAfter doing this install, all default Laravel encryption will be performed under the relative constructions / ciphers.\n\nMeaning if you use `encrypt()` and `decrypt()`, they will use this package instead of the default encryption.\n\nIt also means that cookies \u0026 session, that should be encrypted, will use it.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhernandev%2Flaravel-aead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhernandev%2Flaravel-aead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhernandev%2Flaravel-aead/lists"}