2017 © Pedro Peláez
 

symfony-bundle url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

image

vereschak/url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  • Monday, April 23, 2018
  • by Vereschak
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 18 Versions
  • 1050 % Grown

The README.md

NzoUrlEncryptorBundle

Build Status Total Downloads Latest Stable Version, (*1)

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through the URL to provide more security to the project. Also it prevent users from reading and modifying sensitive data sent through the URL., (*2)

Features include:, (*3)

  • Compatible Symfony version 2, 3 & 4
  • Url Data & parameters Encryption
  • Url Data & parameters Decryption
  • Data Encryption & Decryption
  • Access from Twig by ease
  • Flexible configuration
  • Compatible php version 5 & 7
  • Uses OpenSSL extension

Installation

Through Composer:

Install the bundle:, (*4)

$ composer require vereschak/url-encryptor-bundle

Register the bundle in app/AppKernel.php (Symfony V2 or V3):

``` php // app/AppKernel.php, (*5)

public function registerBundles() { return array( // ... new Nzo\UrlEncryptorBundle\NzoUrlEncryptorBundle(), ); }, (*6)


### Configure your application's config.yml: Configure your secret encryption key: ``` yml # app/config/config.yml (Symfony V2 or V3) # config/packages/nzo_url_encryptor.yaml (Symfony V4) nzo_url_encryptor: secret_key: YourSecretEncryptionKey # optional, max length of 100 characters. secret_iv: YourIvEncryptionKey # optional, max length of 100 characters. cipher_algorithm: # optional, default: 'aes-256-ctr'

Usage

In the twig template:

Use the twig extensions filters or functions to encrypt or decrypt your data:, (*7)

``` html // Filters:, (*8)

Encryption:

<a href="{{path('my-route', {'id': MyId | urlencrypt } )}}"> My link </a>

{{MyVar | urlencrypt }}

Decryption:

<a href="{{path('my-route', {'id': MyId | urldecrypt } )}}"> My link </a>

{{MyVar | urldecrypt }}

// Functions:, (*9)

Encryption:

<a href="{{path('my-path-in-the-routing', {'id': nzoEncrypt('MyID') } )}}"> My link </a>

{{ nzoEncrypt(MyVar) }}

Decryption:

<a href="{{path('my-path-in-the-routing', {'id': nzoDecrypt('MyID') } )}}"> My link </a>

{{ nzoDecrypt(MyVar) }}

#### In the routing.yml: ``` yml # routing.yml my-path-in-the-routing: path: /my-url/{id} defaults: {_controller: MyBundle:MyController:MyFunction}

In the controller with annotation service:

Use the annotation service to decrypt / encrypt automatically any parameter you want, by using the ParamDecryptor / ParamEncryptor annotation service and specifying in it all the parameters to be decrypted/encrypted., (*10)

use Nzo\UrlEncryptorBundle\Annotations\ParamDecryptor;
//...

    /**
     * @ParamDecryptor(params={"id", "bar"})
     */
     public function indexAction($id, $bar)
    {
        // no need to use the decryption service here as the parameters are already decrypted by the annotation service.
        //...
    }



    use Nzo\UrlEncryptorBundle\Annotations\ParamEncryptor;
    //...

        /**
         * @ParamEncryptor(params={"id", "bar"})
         */
         public function indexAction($id, $bar)
        {
            // no need to use the encryption service here as the parameters are already encrypted by the annotation service.
            //...
        }

In the controller without annotation service:

Use the decrypt function of the service to decrypt your data:, (*11)

     public function indexAction($id) 
    {
        $MyId = $this->get('nzo_url_encryptor')->decrypt($id);

        //...
    }

You can also use the encrypt function of the service to encrypt your data:, (*12)

     public function indexAction() 
    {   
        //...

        $Encrypted = $this->get('nzo_url_encryptor')->encrypt($data);
        //...
    }

License

This bundle is under the MIT license. See the complete license in the bundle:, (*13)

See Resources/doc/LICENSE, (*14)

The Versions

23/04 2018

dev-master

9999999-dev

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

The Development Requires

by Danil Vereschak

url security encrypt decrypt encryption link data variable id decryption

28/03 2018

4.2.0

4.2.0.0

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

The Development Requires

url security encrypt decrypt encryption link data variable id decryption

17/08 2017

4.1.0

4.1.0.0

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

The Development Requires

url security encrypt decrypt encryption link data variable id decryption

30/03 2017

4.0

4.0.0.0

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

The Development Requires

url security encrypt decrypt encryption link data variable id decryption

24/09 2016

3.1

3.1.0.0

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

24/06 2016

3.0

3.0.0.0

The NzoUrlEncryptorBundle is a Symfony2/3 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

21/04 2016

2.1

2.1.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

21/04 2016

2.0

2.0.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

02/04 2016

1.9

1.9.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

31/03 2016

1.8

1.8.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

30/03 2016

1.7

1.7.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

22/03 2016

1.6

1.6.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

21/12 2015

1.5

1.5.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

12/05 2015

1.4

1.4.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

18/04 2015

1.3

1.3.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

05/04 2015

1.2

1.2.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

31/01 2015

1.1

1.1.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption

29/01 2015

1.0

1.0.0.0

The NzoUrlEncryptorBundle is a Symfony2 Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

  Sources   Download

MIT

The Requires

 

url security encrypt decrypt encryption link data variable id decryption