mcrypt_decrypt

(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)

mcrypt_decryptDecrypts crypttext with given parameters

Advertencia

Esta función ha sido declarada OBSOLETA a partir de PHP 7.1.0 y será ELIMINADA a partir de PHP 7.2.0. Su uso está totalmente desaconsejado.

Descripción

mcrypt_decrypt(
    string$cipher,
    string$key,
    string$data,
    string$mode,
    string$iv = ?
): string|false

Decrypts the data and returns the unencrypted data.

Parámetros

cipher

Una de las constantes MCRYPT_nombredelcifrado, o el nombre del 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

Una de las constantes MCRYPT_MODE_nombredelmodo, o una de las siguientes strings: "ecb", "cbc", "cfb", "ofb", "nofb" o "stream".

iv

Utilizado para la inicialización en los modos CBC, CFB, OFB, y en algunos algoritmos en el modo STREAM. Si el tamañlo del IV proporcionado no está soportado por el modo de encadenamiento o no se proporcionó ninún IV, y el modo de encadenamiento requiere uno, la función emitirá una advertencia y devolverá false.

Valores devueltos

Returns the decrypted data as a string o false en caso de error.

Ver también

To Top