2017 © Pedro Peláez
 

symfony-bundle crypto-bundle

dterranovaCryptoBundle

image

dterranova/crypto-bundle

dterranovaCryptoBundle

  • Wednesday, September 21, 2016
  • by davidterranova
  • Repository
  • 1 Watchers
  • 1 Stars
  • 271 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

dterranova/crypto-bundle

This bundle provide file encryption with AES-256 Cipher The amount of memory used is independant of the file you encrypt., (*1)

Workflow

Encryption

The original file is read by the chunk_file_size and the encryption is done on this amount of data A folder is created in the temp_folder with the name of the original encrypted file Each encrypted part are written in this folder, (*2)

Decryption

By passing the original file name to the decryptFile method, the cryptoBundle use the corresponding folder with encrypted parts of the file to rebuild the original file, (*3)

Installation

  • Add to your composer file

``` json { "require": { ... "dterranova/crypto-bundle": "dev-master" } ... }, (*4)


- Update your vendors `php composer.phar update` - Add to your AppKernel ``` php // app/AppKernel.php public function registerBundles() { return array( // ... new dterranova\Bundle\CryptoBundle\dterranovaCryptoBundle(), // ... ); }
  • Add to your app/config/config.yml

``` yml, (*5)

app/config/config.yml

dterranova_crypto: temp_folder: "%kernel.root_dir%/../web/YOUR_TEMP_FOLDER" chunk_file_size: 2 # The size (in Mb) of chunked files, more it is big more it will consume memory, (*6)


## Usage - Encrypt a file ``` php $cryto = $this->get("dterranova_crypto.crypto_adapter"); $crypto->encryptFile(ABSOLUTE_FILE_PATH, KEY);
  • Decrypt a file php $cryto = $this->get("dterranova_crypto.crypto_adapter"); $crypto->decryptFile(ABSOLUTE_FILE_PATH, KEY, true); // The same absolute file path

The Versions

21/09 2016

dev-master

9999999-dev https://github.com/davidterranova/dterranovaCryptoBundle

dterranovaCryptoBundle

  Sources   Download

MIT

The Requires

 

file encryption memory constant