PHP code example of fyre / encryption

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

    

fyre / encryption example snippets


use Fyre\Encryption\EncryptionManager;

$encryptionManager = new EncryptionManager($container, $config);

$container->singleton(EncryptionManager::class);

$encryptionManager = $container->use(EncryptionManager::class);

$encrypter = $encryptionManager->build($options);

$encryptionManager->clear();

$config = $encryptionManager->getConfig($key);

$config = $encryptionManager->getConfig();

$hasConfig = $encryptionManager->hasConfig($key);

$isLoaded = $encryptionManager->isLoaded($key);

$encryptionManager->setConfig($key, $options);

$encryptionManager->unload($key);

$encrypter = $encryptionManager->use($key);

$decrypted = $encrypter->decrypt($data, $key);

$encrypted = $encrypter->encrypt($data, $key);

$key = $encrypter->generateKey();

$encrypter = $encryptionManager->use('openssl');

$container->use(Config::class)->set('Encryption.openssl', $options);

$encrypter = $encryptionManager->use();

$container->use(Config::class)->set('Encryption.default', $options);