var_dump(openssl_decrypt($wrong, $wrong, $password));
var_dump(openssl_decrypt($encrypted, $wrong, $wrong));
var_dump(openssl_decrypt($wrong, $wrong, $wrong));
-var_dump(openssl_decrypt(array(), $method, $password));
-var_dump(openssl_decrypt($encrypted, array(), $password));
-var_dump(openssl_decrypt($encrypted, $method, array()));
- // invalid using of an authentication tag
- var_dump(openssl_encrypt($data, $method, $password, 0, $iv, $wrong));
?>
--EXPECTF--
Warning: openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended in %s on line %d
Warning: openssl_decrypt(): Unknown cipher algorithm in %s on line %d
bool(false)
--
- Warning: openssl_encrypt(): The authenticated tag cannot be provided for cipher that doesn not support AEAD in %s on line %d
- string(44) "yof6cPPH4mLee6TOc0YQSrh4dvywMqxGUyjp0lV6+aM="
-Warning: openssl_decrypt() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Warning: openssl_decrypt() expects parameter 2 to be string, array given in %s on line %d
-NULL
-
-Warning: openssl_decrypt() expects parameter 3 to be string, array given in %s on line %d
-NULL
// wrong parameters tests
var_dump(openssl_encrypt($data, $wrong, $password));
-var_dump(openssl_encrypt($object, $method, $password));
-var_dump(openssl_encrypt($data, $object, $password));
-var_dump(openssl_encrypt($data, $method, $object));
-var_dump(openssl_encrypt($arr, $method, $object));
-var_dump(openssl_encrypt($data, $arr, $object));
-var_dump(openssl_encrypt($data, $method, $arr));
- // invalid using of an authentication tag
- var_dump(openssl_encrypt($data, $method, $password, 0, $iv, $wrong));
-
// padding of the key is disabled
var_dump(openssl_encrypt($data, $method, $password, OPENSSL_DONT_ZERO_PAD_KEY, $iv));
?>
Warning: openssl_encrypt(): Unknown cipher algorithm in %s on line %d
bool(false)
- Warning: openssl_encrypt(): The authenticated tag cannot be provided for cipher that doesn not support AEAD in %s on line %d
- string(44) "iPR4HulskuaP5Z6me5uImk6BqVyJG73+63tkPauVZYk="
-Warning: openssl_encrypt() expects parameter 1 to be string, object given in %s on line %d
-NULL
-
-Warning: openssl_encrypt() expects parameter 2 to be string, object given in %s on line %d
-NULL
-
-Warning: openssl_encrypt() expects parameter 3 to be string, object given in %s on line %d
-NULL
-
-Warning: openssl_encrypt() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Warning: openssl_encrypt() expects parameter 2 to be string, array given in %s on line %d
-NULL
-
-Warning: openssl_encrypt() expects parameter 3 to be string, array given in %s on line %d
-NULL
--
-Warning: openssl_encrypt(): Key length cannot be set for the cipher method in %s on line %d
+Warning: openssl_encrypt(): Key length cannot be set for the cipher algorithm in %s on line %d
bool(false)