PHP code example of alphasoft-fr / ascrypto-php

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

    

alphasoft-fr / ascrypto-php example snippets


$plaintext = 'Text to encrypt';
$password = 'secure_password';

$crypto = new AsCrypto();
$ciphertext = $crypto->encrypt($plaintext, $password);
echo $ciphertext;

$ciphertext = 'Encrypted text to decrypt';
$password = 'secure_password';

$crypto = new AsCrypto();
$plaintext = $crypto->decrypt($ciphertext, $password);
echo $plaintext;

$plaintext = 'Texte à chiffrer';
$password = 'mot_de_passe_securise';

$crypto = new AsCrypto();
$ciphertext = $crypto->encrypt($plaintext, $password);
echo $ciphertext;

$ciphertext = 'Texte chiffré à déchiffrer';
$password = 'mot_de_passe_securise';

$crypto = new AsCrypto();
$plaintext = $crypto->decrypt($ciphertext, $password);
echo $plaintext;
bash
composer 
bash
composer