mcrypt_decrypt
(PHP 4 >= 4.0.2, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)
mcrypt_decrypt — Decrypts crypttext with given parameters
警告 この関数は PHP 7.1.0 で 非推奨となり、PHP 7.2.0 で削除 されました。この関数に頼らないことを強く推奨します。
説明
mcrypt_decrypt
( string $cipher
, string $key
, string $data
, string $mode
[, string $iv
] ) : string|false
Decrypts the data
and returns the unencrypted data.
パラメータ
cipher
MCRYPT_暗号名
定数のいずれか、 あるいはアルゴリズム名をあらわす文字列。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
andmode
. If the size of the data is not n * blocksize, the data will be padded with '\0
'. mode
- 定数
MCRYPT_MODE_モード名
、あるいは文字列 "ecb", "cbc", "cfb", "ofb", "nofb" ,"stream" のいずれか。 iv
- CBC, CFB, OFB モードおよび STREAM モードのいくつかのアルゴリズムの初期化の際に使用されます。 指定した IV のサイズがそのモードでサポートされていない場合、 あるいは IV を必要とするモードで IV が指定されなかった場合は、 この関数は警告を発して
false
を返します。
返り値
Returns the decrypted data as a string 失敗した場合に false
を返します.
変更履歴
バージョン | 説明 |
---|---|
5.6.0 | Invalid key and iv sizes
are no longer accepted. mcrypt_decrypt() will now throw
a warning and return |