PHP code example of noorani-mm / secure-image

1. Go to this page and download the library: Download noorani-mm/secure-image 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/ */

    

noorani-mm / secure-image example snippets



return [
    // Other providers... 
    \NooraniMm\SecurePicture\Providers\SecureImageProvider::class,
];

'providers' => [
    // Other providers...
    \NooraniMm\SecurePicture\Providers\SecureImageProvider::class,
    ]

use \NooraniMm\SecurePicture\Facades\SecureImage;

$encrypted_content = SecureImage::encrypt('picture.jpg');

use NooraniMm\SecurePicture\Facades\SecureImage;

SecureImage::storeAsEncrypted('picture.jpg', 'encrypted.jpg');

use \NooraniMm\SecurePicture\Facades\SecureImage;
$encrypted_data = file_get_contents('encrypted.jpg');
$decrypted_content = SecureImage::decrypt($encrypted_data);

use \NooraniMm\SecurePicture\Facades\SecureImage;

$encrypted_content = file_get_contents('encrypted.jpg');
SecureImage::storeAsDecrypted($encrypted_content, 'output.jpg');

use NooraniMm\SecurePicture\Facades\SecureImage;

$decrypted_data = SecureImage::decryptByPath('encrypted.jpg');

use \NooraniMm\SecurePicture\Facades\SecureImage;

SecureImage::decryptedByPathAndStore('encrypted.jpg', 'output.jpg');