noorani-mm/secure-image 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

noorani-mm/secure-image

最新稳定版本:v1.1.1

Composer 安装命令:

composer require noorani-mm/secure-image

包简介

Make your image files secure by encoding and decoding

README 文档

README

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;
$encrypted_data = file_get_contents('encrypted.jpg');
$decrypted_content = SecureImage::decrypt($encrypted_data);
  • If you want to store decrypted file you should use
use \NooraniMm\SecurePicture\Facades\SecureImage;

$encrypted_content = file_get_contents('encrypted.jpg');
SecureImage::storeAsDecrypted($encrypted_content, 'output.jpg');
  • If you want to decrypt file by path you should use
use NooraniMm\SecurePicture\Facades\SecureImage;

$decrypted_data = SecureImage::decryptByPath('encrypted.jpg');
  • If you want to decrypt and store it by path you should use
use \NooraniMm\SecurePicture\Facades\SecureImage;

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

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-22