Skip to content

v1.1.0-beta

Choose a tag to compare

@Noorani-MM Noorani-MM released this 22 Aug 11:14
· 10 commits to main since this release

Secure picture 🔐

Make your image files secure by this package.

Install package

composer require noorani-mm/secure-image

Laravel 11, installation

In bootstrap\providers.php file add line below.

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

Older Laravel installation

in config/app.php find providers and add line below.

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

How to use 🛠

Encryption

use \NooraniMm\SecurePicture\Facades\SecureImage;

$encrypted_content = SecureImage::encrypt('picture.jpg');
  • If you want to encrypt and store file you should use
use NooraniMm\SecurePicture\Facades\SecureImage;

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

Decryption

use \NooraniMm\SecurePicture\Facades\SecureImage;

$decrypted_content = SecureImage::decrypt('encrypted.jpg');
  • If you want to store decrypted file you should use
use \NooraniMm\SecurePicture\Facades\SecureImage;

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