Version: current

# Class PasswordEncryptor_LegacyPHPHash

Legacy implementation for SilverStripe 2.1 - 2.3, which had a design flaw in password hashing that caused the hashes to differ between architectures due to floating point precision problems in base_convert(). See http://open.silverstripe.org/ticket/3004

  PasswordEncryptor
  PasswordEncryptor_PHPHash
  PasswordEncryptor_LegacyPHPHash

Package: sapphire\security
Located at sapphire/security/PasswordEncryptor.php

## Methods summary

`public String` | # `encrypt( String $password, String $salt = null, `Member` $member = null )` Return a string value stored in the Member->Password property. The password should be hashed with `PasswordEncryptor::salt()` if applicable. Return a string value stored in the Member->Password property. The password should be hashed with `PasswordEncryptor::salt()` if applicable. #### Parameters $password String $password Cleartext password to be hashed $salt String $salt (Optional) $member Member $member (Optional) #### Returns `String` Maximum of 512 characters. #### Overrides `PasswordEncryptor_PHPHash::encrypt`
`public boolean` | # `compare( String $hash1, String $hash2 )` This usually just returns a strict string comparison, but is necessary for `PasswordEncryptor_LegacyPHPHash`. This usually just returns a strict string comparison, but is necessary for `PasswordEncryptor_LegacyPHPHash`. #### Parameters $hash1 String $hash1 $hash2 String $hash2 #### Returns `boolean` boolean #### Overrides `PasswordEncryptor::compare`

### Methods inherited from PasswordEncryptor_PHPHash

`__construct()`, `getAlgorithm()`

### Methods inherited from PasswordEncryptor

`create_for_algorithm()`, `get_encryptors()`, `register()`, `salt()`, `unregister()`

### Magic methods summary

## Properties summary

### Properties inherited from PasswordEncryptor_PHPHash

`$algorithm`

### Properties inherited from PasswordEncryptor

`$encryptors`

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -