Download the PHP package codelieutenant/laravel-crypto without Composer

On this page you can find all versions of the php package codelieutenant/laravel-crypto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-crypto

Laravel Crypto

Run Tests GitHub issues GitHub stars GitHub license

Laravel Crypto provides a simple and easy-to-use API for encrypting, decrypting, hashing, and signing data using modern cryptographic algorithms powered by libsodium.

Why Laravel Crypto?

Requirements

Getting Started

1. Installation

2. Service Provider Registration

In order to activate the package, you need to replace Laravel's default EncryptionServiceProvider with CodeLieutenant\LaravelCrypto\ServiceProvider.

Laravel 11.x & 12.x

In bootstrap/providers.php, replace the default provider:

Laravel 10.x

In config/app.php, replace Illuminate\Encryption\EncryptionServiceProvider::class in the providers array:

3. Configuration

Publish the configuration file:

Update your cipher in config/app.php:

4. Generating Keys

Generate the necessary cryptographic keys:

This will update your .env file with the required keys and generate an EdDSA key pair in storage/keys/.

Usage Overview

Encryption

Uses the standard Laravel Crypt facade but with Sodium algorithms.

File Encryption

Securely encrypt large files using chunked streaming.

Hashing

High-performance hashing using Blake2b.

Signing

Symmetric (HMAC) and Asymmetric (EdDSA) signing.

Eloquent Casting

Store files securely by automatically encrypting and decrypting them on-the-fly via an Eloquent caster.

User Encryption

Securely encrypt user data using their own unique encryption key.

For more details on setting up and using per-user encryption, see the User Encryption documentation.

Performance

Benchmarks conducted on various data sizes (PHP 8.5.1, Sodium extension enabled) on a Macbook M4 Pro 48GB RAM.

1 KiB Payload

Algorithm Encryption Decryption
Laravel AES-256-CBC 8.09 μs 9.98 μs
Laravel AES-256-GCM 3.37 μs 5.33 μs
Sodium AES-256-GCM 2.39 μs 2.58 μs
Sodium AEGIS-128L 2.03 μs 2.14 μs
Sodium AEGIS-256 2.06 μs 2.27 μs
Sodium XChaCha20-Poly1305 3.41 μs 3.58 μs

32 KiB Payload

Algorithm Encryption Decryption
Laravel AES-256-CBC 151.01 μs 181.81 μs
Laravel AES-256-GCM 35.81 μs 81.98 μs
Sodium AES-256-GCM 26.93 μs 29.22 μs
Sodium AEGIS-128L 18.23 μs 20.68 μs
Sodium AEGIS-256 18.86 μs 21.82 μs
Sodium XChaCha20-Poly1305 58.40 μs 60.90 μs

1 MiB Payload

Algorithm Encryption Decryption
Laravel AES-256-CBC 5.02 ms 7.57 ms
Laravel AES-256-GCM 1.31 ms 3.94 ms
Sodium AES-256-GCM 1.11 ms 1.88 ms
Sodium AEGIS-128L 0.90 ms 1.60 ms
Sodium AEGIS-256 0.82 ms 1.65 ms
Sodium XChaCha20-Poly1305 2.21 ms 2.90 ms

Sodium-based algorithms provide more consistent performance and are significantly faster for decryption of large payloads compared to Laravel's default implementations. AEGIS algorithms offer top-tier performance on modern hardware.

Documentation

For detailed information, please refer to the following documentation:

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-crypto with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-openssl Version *
ext-sodium Version *
illuminate/collections Version ^10|^11|^12
illuminate/config Version ^10|^11|^12
illuminate/contracts Version ^10|^11|^12
illuminate/encryption Version ^10|^11|^12
illuminate/hashing Version ^10|^11|^12
illuminate/support Version ^10|^11|^12
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codelieutenant/laravel-crypto contains the following files

Loading the files please wait ...