Initializes an instance of KeyOrPassword from a password.
public static createFromPassword ( string $password ) : |
||
$password | string | |
return |
/** * Decrypts a ciphertext to a string with a password, using a slow key * derivation function to make password cracking more expensive. * * @param string $ciphertext * @param string $password * @param bool $raw_binary * * @throws Ex\EnvironmentIsBrokenException * @throws Ex\WrongKeyOrModifiedCiphertextException * * @return string */ public static function decryptWithPassword($ciphertext, $password, $raw_binary = false) { return self::decryptInternal($ciphertext, KeyOrPassword::createFromPassword($password), $raw_binary); }
/** * Decrypts the contents of one resource into another with a password, using * a slow key derivation function to make password cracking more expensive. * * @param resource $inputHandle * @param resource $outputHandle * @param string $password * * @throws Defuse\Crypto\Exception\EnvironmentIsBrokenException * @throws Defuse\Crypto\Exception\IOException * @throws Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException */ public static function decryptResourceWithPassword($inputHandle, $outputHandle, $password) { self::decryptResourceInternal($inputHandle, $outputHandle, KeyOrPassword::createFromPassword($password)); }