PHP code example of ranabd36 / openssl-encryption

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

    

ranabd36 / openssl-encryption example snippets


OpenSSLEncryption\Providers\OpenSSLEncryptionServiceProvider::class,

OpenSSLEncryption\OpenSSL::class,

php artisan openssl:key-generate

OpenSSL:encrypt('This text need to encrypt');
//This will return an encrypted data

OpenSSL:decrypt('encrypted data');
//This will return plain text/data: This text need to encrypt

php artisan vendor:publish --provider="OpenSSLEncryption\Providers\OpenSSLEncryptionServiceProvider"