定制 assghard/aes-file-encription 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

assghard/aes-file-encription

Composer 安装命令:

composer require assghard/aes-file-encription

包简介

PHP AES file encription package

README 文档

README

Vendor PHP package. Working on PHP 7+

Based on AES File Encryption: https://github.com/philios33/PHP-AES-File-Encryption

Installation

composer require assghard/aes-file-encription --prefer-dist

How to use

Add library to use: use Assghard\AesFileEncription\FileEncryptionLibrary;

Encrypt file:

$encrypted_file = FileEncryptionLibrary::encryptFile($file_to_encrypt, $_PASSWORD);

  • $file_to_encrypt - relative path to file with filename and extension
  • $encrypted_file - relative path to encrypted file with filename and extension
  • $_PASSWORD (optional) - password/key to encryption security

Decrypt file:

$decrypted_file = pathinfo($filename)['dirname'].'/'.pathinfo($filename)['filename']; $decryptedFile = FileEncryptionLibrary::decryptFile($encrypted_file, $decrypted_file, $_PASSWORD);

  • $encrypted_file - relative path to encrypted file with filename and extension
  • $decrypted_file - relative path to file which will be decrypted with filename and extension
  • $_PASSWORD (optional) - password/key used for encryption
  • $decryptedFile - relative path to decrypted file with original extension
Deprecated functions

=========================================================

Source: PHP AES File Encryption (https://github.com/philios33/php-aes-file-encryption)

PHP implementation of the open source aes crypt file format

File specification is described here https://www.aescrypt.com/aes_file_format.html

Introduction

There are many PHP AES implementations available online which offer AES encryption for data streams. It is possible to utilise these low level libraries to encrypt files, but unless you do everything correctly you can end up with an insecure (or broken) library. This library works at a higher level, depending on a low level AES encryption engine (which you can configure), and implementing the open source aes crypt file format.

Problems

There are many problems to solve when implementing file encryption using a low level library such as mycrpt. Many people incorrectly think you can just encrypt data and shove it in a file. Alas, it is not that simple.

The open source file format handles many issues such as null bytes trimming, file integrity and fast password checking. It even comes with file extension identifiers which allows arbitrary data to be tagged within the AES file (unencrypted).

This library makes it easier for users who are only interested in encrypting and decrypting .aes files with passwords. Other technicalities such as file structure, versions & encryption keys are transparent to the user.

Compatibility

This library writes version 2 of the file specification defined at https://www.aescrypt.com/aes_file_format.html Backwards compatibility with the older two versions (reading old .aes files) is untested. Output .aes files are fully compatible with any software using the AES Crypt standard file format.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-04