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

Aviso

Esta função tornou-se DEFASADA a partir do PHP 7.1.0 e foi REMOVIDA a partir do PHP 7.2.0. O uso desta função é fortemente desencorajado.

Descrição

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

Uma das constantes MCRYPT_nome_da_cifra 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_nome_do_modo ou uma das seguintes strings: "ecb", "cbc", "cfb", "ofb", "nofb" ou "stream".

iv

Usado para a inicialização nos modos CBC, CFB, OFB e em alguns algoritmos no modo STREAM. Se o tamanho do IV fornecido não for suportado pelo modo de encadeamento ou nenhum IV for fornecido, mas o modo de encadeamento exigir um, a função emitirá um aviso e retornará false.

Valor Retornado

Returns the decrypted data as a string ou false em caso de falha.

Veja Também

To Top