PHP code example of hbnext / encrypt-decrypt-bundle

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

    

hbnext / encrypt-decrypt-bundle example snippets



// config/bundles.php

return [
    //...
     hbNext\EncryptDecryptBundle\EncryptDecryptBundle::class => ['all' => true]
];

    
    use hbNext\EncryptDecryptBundle\services\EncryptionInterface;
    
    private EncryptionInterface $encryption;

    public function __construct(EncryptionInterface $encryption )
    {

        $this->encryption =$encryption;
    }
     $text="mytext";
     $this->encryption->encrypt($text);
     $this->encryption->decrypt(  $this->encryption->encrypt($text));