{"id":17866719,"url":"https://github.com/malusevdevelopment/laravel-crypto","last_synced_at":"2026-02-27T00:20:01.606Z","repository":{"id":52814653,"uuid":"282963319","full_name":"MalusevDevelopment/laravel-crypto","owner":"MalusevDevelopment","description":"Laravel wrapper for common hashing algorithms used in web applications","archived":false,"fork":false,"pushed_at":"2025-03-12T23:56:07.000Z","size":1008,"stargazers_count":17,"open_issues_count":9,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T11:35:07.635Z","etag":null,"topics":["algorithm","base64","base64url","blake2b","blake2b-hash-algorithm","cryptography","hashing","hashing-algorithms","laravel","programmers","random-generation","sha256"],"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/MalusevDevelopment.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["CodeLieutenant"],"ko-fi":"codelieutenant"}},"created_at":"2020-07-27T17:08:25.000Z","updated_at":"2025-01-10T08:32:56.000Z","dependencies_parsed_at":"2024-02-05T00:24:19.220Z","dependency_job_id":"f0ff8620-719c-4157-8cf2-86fe986e119e","html_url":"https://github.com/MalusevDevelopment/laravel-crypto","commit_stats":null,"previous_names":["brossquad/laravelcrypto","codelieutenant/laravel-crypto","malusevdevelopment/laravel-crypto"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalusevDevelopment%2Flaravel-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalusevDevelopment%2Flaravel-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalusevDevelopment%2Flaravel-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalusevDevelopment%2Flaravel-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MalusevDevelopment","download_url":"https://codeload.github.com/MalusevDevelopment/laravel-crypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244764642,"owners_count":20506671,"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":["algorithm","base64","base64url","blake2b","blake2b-hash-algorithm","cryptography","hashing","hashing-algorithms","laravel","programmers","random-generation","sha256"],"created_at":"2024-10-28T09:38:46.025Z","updated_at":"2026-02-27T00:19:56.562Z","avatar_url":"https://github.com/MalusevDevelopment.png","language":"PHP","readme":"# Laravel Crypto\n\n[![Run Tests](https://github.com/dmalusev/laravel-crypto/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/dmalusev/laravel-crypto/actions/workflows/test.yml)\n[![GitHub issues](https://img.shields.io/github/issues/malusev998/LaravelCrypto?label=Github%20Issues)](https://github.com/malusev998/LaravelCrypto/issues)\n[![GitHub stars](https://img.shields.io/github/stars/malusev998/LaravelCrypto?label=Github%20Stars)](https://github.com/malusev998/LaravelCrypto/stargazers)\n[![GitHub license](https://img.shields.io/github/license/malusev998/LaravelCrypto?label=Licence)](https://github.com/malusev998/LaravelCrypto)\n\n## What's Laravel Crypto and why should I use it?\n\nLaravel Crypto is a library that provides easy to use API for most common cryptographic functions.\nIt is designed to be easy to use and secure. It uses the best and most secure algorithms available today.\n\nLaravel's default encryption is secure, but it is slow. Laravel Crypto provides faster and more secure algorithms for\nencryption and hashing.\nIt's drop in replacement for Laravel's `EncryptionServiceProvider` and it uses `libsodium` under the hood.\nAs long as you use default laravel encryption, you don't need to change anything in your code.\n\n## Getting started\n\n### Installing\n\n```shell script\ncomposer require codelieutenant/laravel-crypto\n```\n\n### Publishing config file\n\n```shell script\nphp artisan vendor:publish --provider=\"CodeLieutenant\\LaravelCrypto\\ServiceProvider\"\n```\n\n### Replacing Laravel's EncryptionServiceProvider with LaravelCrypto's ServiceProvider\n\nIn order to activate this package, you need to replace Laravel's `EncryptionServiceProvider`\nwith `LaravelCryptoServiceProvider`.\n\nIn `config/app.php` replace `Illuminate\\Encryption\\EncryptionServiceProvider::class`\nwith `CodeLieutenant\\LaravelCrypto\\ServiceProvider::class`\nDepending on the laravel version you are using, you can do it in two ways.\n\nLaravel 9.0 and above:\n\n```php\nuse CodeLieutenant\\LaravelCrypto\\ServiceProvider as LaravelCryptoServiceProvider;\nuse Illuminate\\Encryption\\EncryptionServiceProvider as LaravelEncryptionServiceProvider;\n\n// ...\n'providers' =\u003e ServiceProvider::defaultProviders()\n+    -\u003ereplace([\n+        LaravelEncryptionServiceProvider::class =\u003e LaravelCryptoServiceProvider::class,\n+    ])\n    -\u003emerge([\n     // ...\n    ])\n    -\u003etoArray(),\n\n// ...\n```\n\nLaravel 8.0:\n\n```php\nuse CodeLieutenant\\LaravelCrypto\\ServiceProvider as LaravelCryptoServiceProvider;\n\n'providers' =\u003e [\n    // ...\n-   Illuminate\\Encryption\\EncryptionServiceProvider::class,\n+   LaravelCryptoServiceProvider::class,\n    // ...\n],\n```\n\n### Configuration\n\nIn order to use Laravel Crypto, you need to change `cipher` in the `config/app.php` file.\nPossible values:\n\n**Unique to Laravel Crypto:**\n\n- Sodium_AES256GCM\n- Sodium_XChaCha20Poly1305\n- Sodium_AEGIS128 (Planned on php8.4)\n- Sodium_AEGIS256 (Planned on php8.4)\n\n**Coming from Laravel Encryption (supported as LaravelCrypto falls back to EncryptionServiceProvider implementation):**\n\n- AES-256-GCM\n- AES-128-GCM\n- AES-256-CBC (default)\n- AES-128-CBC\n\n```php\n'cipher' =\u003e 'Sodium_AES256GCM',\n```\n\n### Generating Keys\n\nFor encryption Laravel command `php artisan key:generate` is good and can be used, but since this package\ncan be used for hashing and signing the data, command for generating keys is provided.\n\n```shell script\nphp artisan crypto:keys\n```\n\nIt generates backwards compatible keys for laravel `cipher` configuration and keys for `Sodium` algorithms.\nThere are multiple option for this command, you can check them by running `php artisan crypto:keys --help`,\nso this command can be used as a drop in replacement for `key:generate`.\n\n### Using in existing laravel project\n\nThis package does not provide backward compatibility with Laravel's default encryption (if configuration is changed).\nIf you want to use Laravel Crypto in an existing project, you need to re-encrypt all your data.\n","funding_links":["https://github.com/sponsors/CodeLieutenant","codelieutenant"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalusevdevelopment%2Flaravel-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalusevdevelopment%2Flaravel-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalusevdevelopment%2Flaravel-crypto/lists"}