Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Crypto Bundle Laravel Package

dterranova/crypto-bundle

View on GitHub
Deep Wiki
Context7

dterranova/crypto-bundle

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

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

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

Installation

  • Add to your composer file
{
    "require": {
        ...
        "dterranova/crypto-bundle": "dev-master"
    }
    ...
}
  • Update your vendors php composer.phar update

  • Add to your AppKernel

    // app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new dterranova\Bundle\CryptoBundle\dterranovaCryptoBundle(),
            // ...
        );
    }
  • Add to your app/config/config.yml
# 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 

Usage

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

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky