PHP code example of sham3r / cipher-bsk

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

    

sham3r / cipher-bsk example snippets



    ipherBsk\CipherBsk;

    $message = "Hajee Mohammad Danesh Science and Technology University";
    $key = "Hstu@5200";
    
    $cipherBsk = new CipherBsk();

    $encryptedMessage = $cipherBsk->encrypt($message, $key);
    echo "Encrypted Message: $encryptedMessage\n";
    
    $decryptedMessage = $cipherBsk->decrypt($encryptedMessage, $key);
    echo "Decrypted Message: $decryptedMessage\n";
    
    // Example output:
    // Encrypted Message: 7B4D5249784F285E6433232166594C6A5A5A3322532A7C4E4F72697D2B4C52515F7400753644674061576C254E47724635612920714C6A21
    // Decrypted Message: Hajee Mohammad Danesh Science and Technology University