(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)
mcrypt_decrypt — Decrypts crypttext with given parameters
This function has been DEPRECATED as of PHP 7.1.0 and REMOVED as of PHP 7.2.0. Relying on this function is highly discouraged.
$cipher
, string $key
, string $data
, string $mode
[, string $iv
] ) : string|false
Decrypts the data
and returns the unencrypted data.
cipher
Uma das constantes MCRYPT_ciphername
, ou o nome do algoritmo como string.
key
The key with which the data was encrypted. If the provided key size is
not supported by the cipher, the function will emit a warning and return false
data
The data that will be decrypted with the given cipher
and mode
. If the size of the data is not n * blocksize,
the data will be padded with '\0
'.
mode
Uma das constantes MCRYPT_MODE_modename
, ou uma das strings: "ecb", "cbc", "cfb", "ofb", "nofb" ou "stream".
iv
Utilizado para a inicialização dos modos CBC, CFB, OFB, e em alguns algoritmos em modo STREAM. Se o tamanho do IV fornecido não for surportado no modo chaining ou um IV não for fornecido para um modo chaining que necessite, a função emitirá um warning e refornará false
.
Returns the decrypted data as a string ou false
em caso de falha.
Versão | Descrição |
---|---|
5.6.0 |
Invalid key and iv sizes
are no longer accepted. mcrypt_decrypt() will now throw
a warning and return false if the inputs are invalid. Previously keys and
IVs were padded with '\0 ' bytes to the next valid size.
|