phpseclib/phpseclib — pull request #97 by petrich (2013-04-30 10:49:12+00:00)
Title: Twofish.php

Hi all...
as mentioned last time... i'm finished with the Twofish implementation for phpseclib (Blowfish is also nearly ready... 80%)

The code architectur and the Crypt_Twofish() object behavior is the same as from the other ciphers.

It's nearly fast as the AES/Rijndael cipher, works in INTERNAL_MODE oder in MCRYPT_MODE.

Strong tested against other Twofish reference -implementation, works on all php version from 4 to 5.x on any plattform Win/Mac/*nix 32/64bit.

Terra... could you especially check setPassword() ... is the default salt and the $key-length (256bit) ok so?

Usage:
```php
include('Crypt/Twofish.php');
define('CRYPT_TWOFISH_MODE', CRYPT_TWOFISH_MODE_INTERNAL);
// define('CRYPT_TWOFISH_MODE', CRYPT_TWOFISH_MODE_MCRYPT);

$Twofish = new Crypt_Twofish(CRYPT_TWOFISH_MODE_ECB);
$Twofish->setKey('12345678901234567890123456789012');
echo $Twofish->decrypt($Twofish->encrypt('1234567890-1234567890'));
```

From my side... its ready to merge.
Greetings :-)