encryptByPassword() public method
Encrypts data using a password.
Derives keys for encryption and authentication from the password using PBKDF2 and a random salt, which is deliberately slow to protect against dictionary attacks. Use encryptByKey() to encrypt fast using a cryptographic key rather than a password. Key derivation time is determined by $derivationIterations, which should be set as high as possible. The encrypted data includes a keyed message authentication code (MAC) so there is no need to hash input or output data. > Note: Avoid encrypting with passwords wherever possible. Nothing can protect against poor-quality or compromised passwords.
See also:
public string encryptByPassword ( $data, $password ) | ||
---|---|---|
$data | string |
The data to encrypt |
$password | string |
The password to use for encryption |
return | string |
The encrypted data |
Please login to continue.