PHP code example of sextanet / aduana

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

    

sextanet / aduana example snippets


// Step 1: set a password
\SextaNet\Aduana\Aduana::setPassword('yourSecurePassword');

// Step 2: encrypt your data
return \SextaNet\Aduana\Aduana::encrypt('hello, from Aduana (:');

// Step 1: set a password
\SextaNet\Aduana\Aduana::setPassword('yourSecurePassword');

// Step 2: decrypt your data
return \SextaNet\Aduana\Aduana::decrypt('dWSNOkN6mqxeCH0v3mzbWlJxRDJWTGE1WUxSQnN1eVNlbCtuNzdlOTFWSDUybFJIYVluNGNDMFZ4ajQ9');

\SextaNet\Aduana\Aduana::setPassword('yourSecurePassword');

$array = [
    'your-complex-array' => [
        'another-level' => [
            'yes' => [
                'it works!' => [
                    'no problem!',
                ]
            ]
        ]
    ]
];

return \SextaNet\Aduana\Aduana::encrypt($array);

$decrypted_array = \SextaNet\Aduana\Aduana::decrypt('zwKOVw6zX2Jp8gNdQuE6TWRyNUR4MFFpN2lVaGIyeHZBMUljQXA1d2VuYjFZR3RKVkkzNC9HR25RampMUEQrSTdRbHVOT3VUU2hDL04rVXErSVNRL0FvTlAyMjRWa1pRVjdRS1RuSTFvRFBkRHVjMm9Pbm0ySnVnNnJVPQ==');

var_dump($decrypted_array);

Aduana::🔑('verySecretPassword');

Aduana::🔒('Hello, from Aduana!');

Aduana::🔓('Fvt2y2Q1Y26c1oh1Zr1YpXR2KzJKVlYyZzd5OUFpdEUyNi91MkR1UTMvMmtSbnVtWXhYVk5FU2Z2VWs9');