When using the openssl_encrypt()
function in PHP to encrypt a string with AES-256-CBC as the encryption method:
$encrypted = openssl_encrypt($data, "AES-256-CBC", $key, 0, $iv);
I tried different string lengths for $data
, and the resulting length of $encrypted
will increase when $data
reaches a multiple of 16 bytes. But it seems the growth is not steady.
Is there a general formula that relates the length of $data
and $encrypted
?