PHP code example of redsd / aesencrypt

1. Go to this page and download the library: Download redsd/aesencrypt library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

redsd / aesencrypt example snippets


For laravel 9.x:
$ composer r 

'providers' => array(
    redsd\AESEncrypt\Database\DatabaseServiceProviderEncrypt::class
)

namespace App\Models;

use redsd\AESEncrypt\Database\Eloquent\ModelEncrypt;

class Person extends ModelEncrypt
{
    /**
     * The attributes that are encrypted.
     *
     * @var array
     */
    protected $fillableEncrypt = [
        'name'
    ];

}

    Schema::create('persons', function (Blueprint $table) {
        // here you do all columns supported by the schema builder
        $table->increments('id')->unsigned;
        $table->string('description', 250)->nullable();
        $table->timestamps();
    });

    // once the table is created use a raw query to ALTER it and add the BLOB, MEDIUMBLOB or LONGBLOB
    DB::statement("ALTER TABLE persons ADD name MEDIUMBLOB after id");

APP_AESENCRYPT_KEY=yourencryptedkey
APP_AESENCRYPT_MODE=aes-256-cbc
bash
php artisan vendor:publish --provider="redsd\AESEncrypt\AesEncryptServiceProvider"