contao/import — Issue #2979: extend Encryption class
Author: Toflar
Created: 2011-11-29 20:38:32+00:00
State: open
Labels: Feature, framework

The Encryption class is pretty useful to encrypt and decrypt data on the **same** Contao installation.
I would like to use the class to encrypt data on one installation and to decryt again on another.

This is currently not possible because you use the the encriptionKey which should be unique for every installation =)

```
mcrypt_generic_init($this->resTd, md5($GLOBALS['TL_CONFIG']['encryptionKey']), $iv);
```

What do you think of leaving this to the developer?
I'm thinking of something like this:

```
public function encrypt($strValue, $strEncryptionKey=$GLOBALS['TL_CONFIG']['encryptionKey'])
{
[...]
mcrypt_generic_init($this->resTd, md5($strEncryptionKey), $iv);
```

Plus the according adjustments in the whole class, of course =)

--- _Originally created on April 1st, 2011, at 02:52pm (ID 2979)_