PHP code example of kitlabs / kit-crypt-bundle

1. Go to this page and download the library: Download kitlabs/kit-crypt-bundle 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/ */

    

kitlabs / kit-crypt-bundle example snippets

 php

// app/AppKernel.php
 
// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
 
            new Kit\CryptBundle\KitCryptBundle(),
        );
 
        // ...
    }
 
    // ...
}
 php
/**
 * 
 * @var \Kit\CryptBundle\Service\OpensslService $opensslService
 */
$opensslService = $this->get('kit_crypt.openssl');
$encrypt = $opensslService->encrypt('lcp0578', 'data_api'); //public function encrypt($string, $name = 'default', $iv = null)
dump($encrypt);
dump($opensslService->decrypt($encrypt, 'data_api')); //public function decrypt($string, $name = 'default', $iv = null)
function cryptoJsAesDecrypt($passphrase, $ct, $iv, $s)
function cryptoJsAesEncrypt($passphrase, $value)