Skip to main content

openssl_encrypt()

public static function openssl_encrypt( $text, $encryption_key=null, $cipher_name='aes-256-ctr', $mac_key=null )

Encrypt with AES-256-CTR plus HMAC-SHA-512 hash.

Since: 2.3

Source: common.php:6924

Parameters

NameTypeDefaultDescription
$textstringThe text to encrypt.
$encryption_keystringnullKey for encryption
$cipher_namestring'aes-256-ctr'The cypher name. Default 'aes-256-ctr'.
$mac_keystringnullThe key to be used to generate the hash.

Returns

  • string | false — the encrypted string on success or false on failure