reference/openssl/functions/openssl-encrypt.xml
9fc8bcc0836f56a98cf432c8f933e0d96c8d680a
...
...
@@ -85,7 +85,7 @@
85
85
<term><parameter>aad</parameter></term>
86
86
<listitem>
87
87
<para>
88
-
Additional authentication data.
88
+
Additional authenticated data.
89
89
</para>
90
90
</listitem>
91
91
</varlistentry>
...
...
@@ -167,7 +167,7 @@ if (in_array($cipher, openssl_get_cipher_methods()))
167
167
</example>
168
168

169
169
<example>
170
-
<title>AES Authenticated Encryption example for PHP 5.6+</title>
170
+
<title>AES Authenticated Encryption example prior to PHP 7.1</title>
171
171
<programlisting role="php">
172
172
<![CDATA[
173
173
<?php
...
...
@@ -187,7 +187,7 @@ $hmac = substr($c, $ivlen, $sha2len=32);
187
187
$ciphertext_raw = substr($c, $ivlen+$sha2len);
188
188
$original_plaintext = openssl_decrypt($ciphertext_raw, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);
189
189
$calcmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);
190
-
if (hash_equals($hmac, $calcmac))//PHP 5.6+ timing attack safe comparison
190
+
if (hash_equals($hmac, $calcmac))// timing attack safe comparison
191
191
{
192
192
echo $original_plaintext."\n";
193
193
}
194
194