PHP code example of shakib / cakephp-encrypt-decrypt

1. Go to this page and download the library: Download shakib/cakephp-encrypt-decrypt 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/ */

    

shakib / cakephp-encrypt-decrypt example snippets

 php
TypeFactory::map('encrypted', 'EncryptDecrypt\Database\Type\EncryptType');
 php
'Security' => [
    'encryption_key' => env('ENCRYPTION_KEY', 'YOUR-KEY'),
]
 php
public function encryptDecryptAllData()
{
  // columns that are in plain text
  $sourceColumns = ['column1', 'column2']; 	
  // columns that need to be encrypted / decrypted
  $destinationColumns = ['column3', 'column4'];

  return $this->encryptAll($this, $sourceColumns, $destinationColumns);
}
 php
$query->where(['email' => '[email protected]', 'account_number' => 'xxxxxxxxx']);
}