PHP code example of benjaminstout / php-crypt

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

    

benjaminstout / php-crypt example snippets


use BenjaminStout\PHPCrypt\Crypt;

$this->Crypt = new Crypt('<library>', '<key>');

$this->Crypt->encrypt('string');

$this->Crypt->decrypt('eNcRyPtEd');

  $this->Crypt = new Crypt('Openssl');
  

  $this->Crypt = new Crypt('Openssl', 'KeY123');
  

  $this->Crypt = new Crypt('Openssl', [
      'keyPathOpenssl' => '/path/to/openssl.key',
  ]);
  

  Crypt::setKeyPath('Openssl', '/path/to/openssl.key');