PHP code example of mblsolutions / mcryptgatewayservice

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

    

mblsolutions / mcryptgatewayservice example snippets


$mcryptService = new MBLSolutions\McryptService('https://example.execute-api.eu-west-1.amazonaws.com', 'prod');

$string = base64_encode('password'); // Encrypted base64 encoded string `password`
$secret = base64_encode('thisisatwentyfourcharkey'); // encryption secret

$result = $mcryptService->encrypt($string, $secret); // Encrypts into 0sQg7vz6S9g=

$mcryptService = new MBLSolutions\McryptService('https://example.execute-api.eu-west-1.amazonaws.com', 'prod');

$encrypted = '0sQg7vz6S9g='; // Encrypted base64 encoded string `password`
$secret = base64_encode('thisisatwentyfourcharkey'); // encryption secret

$result = $mcryptService->decrypt($encrypted, $secret); // Decrypts into cGFzc3dvcmQ=

base64_decode($result); // password