PHP code example of dev-fighters / php-crypter

1. Go to this page and download the library: Download dev-fighters/php-crypter 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/ */

    

dev-fighters / php-crypter example snippets


    $key = Crypter::generateKey()

    $key = **KEY_GENERATED**
    $text = **TEXT_TO_ENCRYPT**
    $crypter = new Crypter($key);
    $encryptedText = $crypter->encrypt($text);

    $key = **KEY_GENERATED**
    $textEncrypted = **TEXT_TO_DECRYPT**
    $crypter = new Crypter($key);
    $encryptedText = $crypter->decrypt($textEncrypted);

    $key = **KEY_GENERATED**
    $text = **TEXT_TO_DECRYPT**
    $crypter = new Crypter($key);
    
    $crypter->isEncrypted($text);
    $crypter->isNotEncrypted($text);

    static function generateKey() : string;
    
    function encrypt(string $textToEncrypt) : string;
    function decrypt(string $textEncrypted) : string;
    
    function isEncrypted(string $textEncrypted) : bool;
    function isNotEncrypted(string $textEncrypted) : bool;
 
    composer