{"id":14975123,"url":"https://github.com/misterdebug/laravel-file-encrypter","last_synced_at":"2025-07-11T16:13:15.562Z","repository":{"id":211179599,"uuid":"728452006","full_name":"misterdebug/laravel-file-encrypter","owner":"misterdebug","description":"LaraFileEncrypter: A Laravel package enabling secure and seamless management of encrypted files without the need for persistent key storage.","archived":false,"fork":false,"pushed_at":"2023-12-11T19:45:17.000Z","size":9,"stargazers_count":32,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T18:01:36.783Z","etag":null,"topics":["composer-package","decryption","encryption","encryption-decryption","file","laravel","laravel-file-encrypter","laravel-package","laravel10","password-based-encryption"],"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/misterdebug.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-07T01:08:35.000Z","updated_at":"2025-05-03T00:29:31.000Z","dependencies_parsed_at":"2024-09-18T16:35:50.081Z","dependency_job_id":"7bd6ce3e-3e58-454b-a00e-a994fee67945","html_url":"https://github.com/misterdebug/laravel-file-encrypter","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"b346ea0ba45f6327481eae3d84297a89f0d54617"},"previous_names":["misterdebug/laravel-file-encrypter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/misterdebug/laravel-file-encrypter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Flaravel-file-encrypter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Flaravel-file-encrypter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Flaravel-file-encrypter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Flaravel-file-encrypter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/misterdebug","download_url":"https://codeload.github.com/misterdebug/laravel-file-encrypter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Flaravel-file-encrypter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264850755,"owners_count":23673232,"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":["composer-package","decryption","encryption","encryption-decryption","file","laravel","laravel-file-encrypter","laravel-package","laravel10","password-based-encryption"],"created_at":"2024-09-24T13:51:32.967Z","updated_at":"2025-07-11T16:13:15.476Z","avatar_url":"https://github.com/misterdebug.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaraFileEncrypter: Secure your files in Laravel with AES-256 encryption, without persistent key storage hassle.\n\n![image](https://github.com/misterdebug/laravel-file-encrypter/assets/23297600/4beeebb4-d064-4d09-9c81-876d5dbdde69)\n\n\nLaraFileEncrypter is a Laravel package, designed to enhance file security in your applications. With a straightforward integration, it enables you to easily implement AES-256 encryption. What sets LaraFileEncrypter apart is its unique approach: delivering maximum security without the need for key storage. Now, securing your files becomes a straightforward process, ensuring data confidentiality without added complexity.\n\n## How does it work?\n\nLaraFileEncrypter simplifies file security by eliminating the need to manage encryption keys. Instead, the process relies on the use of a user-chosen password.\n\nWhen encrypting a file, LaraFileEncrypter generates an encryption key based on the provided password. It's this key, derived from the password, that is used to secure your files using the AES-256 algorithm.\n\nThis approach removes the necessity of storing or managing separate encryption keys. By choosing a robust password, you ensure effective protection of your files without the complexity associated with traditional key management. \n\n## Pros and cons\n\n| Pros                                               | Cons                                                     |\n|----------------------------------------------------|----------------------------------------------------------|\n| No key storage                                      | Loss of password leads to unrecoverable file              |\n| Each user can encrypt their files with a unique password | AES keys potentially less robust than truly random methods |\n| No modifications needed on the files infrastructure or database side | Potentially predictable keys                             |\n\n\nConvinced ? 🙂\n\nIf you find this project useful, please consider giving it a star⭐. It helps me prioritize and focus on keeping project up-to-date. Thank you for your support!\n\n## Installation\n\n``` composer require mrdebug/lara-file-encrypter ```\n\n## Usage\n\nThis package provides a facade called `LaraFileEncrypter`.\n\n### Encrypt a file\n\nThe `encryptFile` method `public function encryptFile(string $filePath, string $rawPassword)` locates a file and replaces its existing content with his encrypted content using the provided password. The password must be provided in raw text.\n\nExample :\n```php \nLaraFileEncrypter::encryptFile(\n  storage_path('app/files/secret-file.pdf'),\n  'mysecurerawpassword'\n);\n```\n\nYou can add a salt :\n```php \nLaraFileEncrypter::encryptFile(\n  storage_path('app/files/secret-file.pdf'),\n  'mysecurerawpassword'.$salt\n);\n```\n\n### Decrypt a file\n\nThe `LaraFileEncrypter` facade provides two methods for decrypting a file. One method streamDownload (`decryptAndStreamDownloadFile()`) the file, while the other decrypts the file's content (`decryptContentFile()`).\n\n```php \npublic function decryptAndStreamDownloadFile(string $filePath, string $rawPassword)\n```\n\nand\n\n```php\npublic function decryptContentFile(string $filePath, string $rawPassword)\n```\n\nExamples : \n\n```php\nLaraFileEncrypter::decryptAndStreamDownloadFile(\n  storage_path('app/files/secret-file.pdf'),\n  'mysecurerawpassword'\n);\n```\n\nand \n\n```php\nLaraFileEncrypter::decryptContentFile(\n  storage_path('app/files/secret-file.pdf'),\n  'mysecurerawpassword'\n);\n```\n\n You must, of course, provide the same password as used in the encryption step.\n \n\n## License\n\nThis package is licensed under the [license MIT](http://opensource.org/licenses/MIT).\n\n## Other Projects\n\nExplore my other projects on GitHub:\n\n- **[Crud Generator Laravel](https://github.com/misterdebug/crud-generator-laravel)**: Create a Laravel 10 CRUD in a few seconds\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisterdebug%2Flaravel-file-encrypter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisterdebug%2Flaravel-file-encrypter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisterdebug%2Flaravel-file-encrypter/lists"}