UnionOfRAD/lithium — Issue #209: lithium\security\Password does not use the BF and XDES constants
Author: stensi
Created: 2011-12-07 23:16:01+00:00
State: open

The 'lithium\security\Password' class has the constants BF and XDES, which are the default number of iterations for their respective encryption process. These constants are not used though.

I would expect that they were intended to be used in the protected salt methods. So this:

```
protected static function _genSaltBf($count = 10) {
$count = (integer) $count;
$count = ($count < 4 || $count > 31) ? 10 : $count;
```

Would be changed to this:

```
protected static function _genSaltBf($count = BF) {
$count = (integer) $count;
$count = ($count < 4 || $count > 31) ? BF : $count;
```

And this:

```
protected static function _genSaltXDES($count = 18) {
$count = (integer) $count;
$count = ($count < 1 || $count > 24) ? 16 : $count;
```

Would be changed to this:

```
protected static function _genSaltXDES($count = XDES) {
$count = (integer) $count;
$count = ($count < 1 || $count > 24) ? XDES : $count;
```