PHP code example of dtdtechorg / dcryption

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

    

dtdtechorg / dcryption example snippets



DCryption\Cryption;

// Cryption sinfini yaratish
$cipher = new Cryption();

// Shifrlash
$plaintext = "Salom, dunyo!";
$encrypted = $cipher->encrypt($plaintext);
echo "Shifrlangan matn: " . $encrypted . "
";

// Shifrlangan matnni qayta ochish
$decrypted = $cipher->decrypt($encrypted);
echo "Dechifrlangan matn: " . $decrypted . "
";


DCryption\Cryption;

// Cryption sinfini yaratish
$cipher = new Cryption();

// Shifrlash
$plaintext = "Salom, dunyo!";
$encrypted = $cipher->encrypt($plaintext);
echo "Shifrlangan matn: " . $encrypted . "
";

// Shifrlangan matnni qayta ochish
$decrypted = $cipher->decrypt($encrypted);
echo "Dechifrlangan matn: " . $decrypted . "
";

$encrypted = $cipher->encrypt("Salom, dunyo!");
echo $encrypted;  // Shifrlangan matn

$decrypted = $cipher->decrypt($encrypted);
echo $decrypted;  // Asl matn: Salom, dunyo!