PHPackages                             wubbajack/filecrypt - 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. wubbajack/filecrypt

ActiveLibrary

wubbajack/filecrypt
===================

PHP package for encrypted and decrypting files

0.2.0(10y ago)9291MITPHPPHP &gt;=5.6

Since Jan 2Pushed 10y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (19)Used By (0)

Filecrypt
=========

[](#filecrypt)

A PHP package for encrypting and decrypting files. Also offers the possibility of streaming decryption of file data.

[![Build Status](https://camo.githubusercontent.com/7ae6d1486f7e2da3e2df0859e14b13e202834f9e04c18ca07699df0d3cd712ac/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f77756262616a61636b2f66696c6563727970742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/wubbajack/filecrypt)[![Coverage](https://camo.githubusercontent.com/bc3a381838759d9ee8946278089d92f66881c2e03bee7df6c2f901351057ca62/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f77756262616a61636b2f66696c6563727970742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/wubbajack/filecrypt/code-structure)[![Quality Score](https://camo.githubusercontent.com/4348f967528912acefca6aaa62e9c2a2227f0f748ebb02dff818ec7a98ef7b7b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f77756262616a61636b2f66696c6563727970742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/wubbajack/filecrypt)[![Latest Version on Packagist](https://camo.githubusercontent.com/a373890350009b6a3d5b312d22ed8a9114b84dfbeee765231ed5088ef9e1c606/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77756262616a61636b2f66696c6563727970742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wubbajack/filecrypt)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

DISCLAIMER
----------

[](#disclaimer)

This package is still a work in progress. This means that Method signatures and return values will change over time. Implementation specifics will also change.

If you do wish to use or test this package, do so with care. Everything has been "humanly" tested, still working on writing proper tests.

If you wish to contribute please start of with creating new issues before sending in pull requests.

Info
----

[](#info)

The goal of this project is to offer a simple method of working with encrypted files in PHP. There are some great (shell) tools out there that can do the same thing. But when decrypting streams becomes necessary, I've found it to be more and more difficult to implement properly.

This package uses stream filters for encryption and decryption, using box standard mcrypt ciphers. This allows for streaming decryption.

### *Default encryption*

[](#default-encryption)

By default the package uses the AES encryption standard. This means that files that have been encrypted with this package can be decrypted by any other tool that supports AES, provided you have a string representation of the used Key and IV.

### Installation and Requirements

[](#installation-and-requirements)

You can install the package easily using composer

```
$ composer require wubbajack/filecrypt
```

The minimum requirements are:

- PHP 5.6
- Mcrypt extension

### Test

[](#test)

To test this package just run

```
$ php vendor/bin/phpunit
```

### Examples and usage

[](#examples-and-usage)

Below are some examples on how to use the FileEncrypter class

#### Encrypting files

[](#encrypting-files)

```
