PHPackages                             assghard/aes-file-encription - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. assghard/aes-file-encription

ActiveLibrary

assghard/aes-file-encription
============================

PHP AES file encription package

13.2kPHP

Since Feb 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/assghard/aes-file-encription)[ Packagist](https://packagist.org/packages/assghard/aes-file-encription)[ RSS](/packages/assghard-aes-file-encription/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP7+ AES 256 file encription vendor package
============================================

[](#php7-aes-256-file-encription-vendor-package)

Vendor PHP package. Working on PHP 7+

> Based on AES File Encryption:

Installation
------------

[](#installation)

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

How to use
----------

[](#how-to-use)

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

### Encrypt file:

[](#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:

[](#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

[](#deprecated-functions)

- mcrypt\_encrypt: This function has been DEPRECATED as of PHP 7.1.0. Relying on this function is highly discouraged - WORK IN PROGRESS
- if you have PHP 7.1+ install mcrypt extension. Source:

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

#### Source: PHP AES File Encryption ()

[](#source-php-aes-file-encryption-httpsgithubcomphilios33php-aes-file-encryption)

#### PHP implementation of the open source aes crypt file format

[](#php-implementation-of-the-open-source-aes-crypt-file-format)

File specification is described here [https://www.aescrypt.com/aes\_file\_format.html](https://www.aescrypt.com/aes_file_format.html)

Introduction
------------

[](#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
--------

[](#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 &amp; encryption keys are transparent to the user.

Compatibility
-------------

[](#compatibility)

This library writes version 2 of the file specification defined at [https://www.aescrypt.com/aes\_file\_format.html](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.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b91333587646cff624e5b17959370962f01f0bdc36987b963e784dbd1d19c29f?d=identicon)[assghard](/maintainers/assghard)

---

Top Contributors

[![assghard](https://avatars.githubusercontent.com/u/11836150?v=4)](https://github.com/assghard "assghard (24 commits)")

### Embed Badge

![Health badge](/badges/assghard-aes-file-encription/health.svg)

```
[![Health](https://phpackages.com/badges/assghard-aes-file-encription/health.svg)](https://phpackages.com/packages/assghard-aes-file-encription)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
