openssl_encrypt()
function openssl_encrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = '', mixed $tag = null, string $aad = '', int $tag_length = 16): mixed
Encrypts data with a supported AES cipher.
Parameters:
$data(string)$cipher_algo(string)$passphrase(string)$options(int), default0, optional$iv(string), default'', optional$tag(mixed), passed by reference, defaultnull, optional$aad(string), default'', optional$tag_length(int), default16, optional
Returns: mixed
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/openssl_encrypt.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how openssl_encrypt is implemented in the compiler, see the internals page.