reference/openssl/functions/openssl-decrypt.xml
9fc8bcc0836f56a98cf432c8f933e0d96c8d680a
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="function.openssl-decrypt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>openssl_decrypt</refname>
...
...
@@ -10,19 +9,19 @@
10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
11
<methodsynopsis>
13
-
<type>string</type><methodname>openssl_decrypt</methodname>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>openssl_decrypt</methodname>
14
13
<methodparam><type>string</type><parameter>data</parameter></methodparam>
15
-
<methodparam><type>string</type><parameter>method</parameter></methodparam>
16
-
<methodparam><type>string</type><parameter>password</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>cipher_algo</parameter></methodparam>
15
+
<methodparam><type>string</type><parameter>passphrase</parameter></methodparam>
17
16
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
18
17
<methodparam choice="opt"><type>string</type><parameter>iv</parameter><initializer>""</initializer></methodparam>
18
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>tag</parameter><initializer>&null;</initializer></methodparam>
19
+
<methodparam choice="opt"><type>string</type><parameter>aad</parameter><initializer>""</initializer></methodparam>
19
20
</methodsynopsis>
20
21
<para>
21
22
Takes a raw or base64 encoded string and decrypts it using a given method and key.
22
23
</para>
23
24

24
-
&warn.undocumented.func;
25
-

26
25
</refsect1>
27
26

28
27
<refsect1 role="parameters">
...
...
@@ -33,23 +32,24 @@
33
32
<term><parameter>data</parameter></term>
34
33
<listitem>
35
34
<para>
36
-
The data.
35
+
The encrypted message to be decrypted.
37
36
</para>
38
37
</listitem>
39
38
</varlistentry>
40
39
<varlistentry>
41
-
<term><parameter>method</parameter></term>
40
+
<term><parameter>cipher_algo</parameter></term>
42
41
<listitem>
43
42
<para>
44
-
The cipher method.
43
+
The cipher method. For a list of available cipher methods, use
44
+
<function>openssl_get_cipher_methods</function>.
45
45
</para>
46
46
</listitem>
47
47
</varlistentry>
48
48
<varlistentry>
49
-
<term><parameter>password</parameter></term>
49
+
<term><parameter>passphrase</parameter></term>
50
50
<listitem>
51
51
<para>
52
-
The password.
52
+
The key.
53
53
</para>
54
54
</listitem>
55
55
</varlistentry>
...
...
@@ -71,6 +71,31 @@
71
71
</para>
72
72
</listitem>
73
73
</varlistentry>
74
+
<varlistentry>
75
+
<term><parameter>tag</parameter></term>
76
+
<listitem>
77
+
<para>
78
+
The authentication tag in AEAD cipher mode. If it is incorrect, the authentication fails and the function returns &false;.
79
+
</para>
80
+
<caution>
81
+
<simpara>
82
+
The length of the <parameter>tag</parameter> is not checked by the function.
83
+
It is the caller's responsibility to ensure that the length of the tag
84
+
matches the length of the tag retrieved when <function>openssl_encrypt</function>
85
+
has been called. Otherwise the decryption may succeed if the given tag only
86
+
matches the start of the proper tag.
87
+
</simpara>
88
+
</caution>
89
+
</listitem>
90
+
</varlistentry>
91
+
<varlistentry>
92
+
<term><parameter>aad</parameter></term>
93
+
<listitem>
94
+
<para>
95
+
Additional authenticated data.
96
+
</para>
97
+
</listitem>
98
+
</varlistentry>
74
99
</variablelist>
75
100
</para>
76
101
</refsect1>
...
...
@@ -86,7 +111,7 @@
86
111
&reftitle.errors;
87
112
<para>
88
113
Emits an <constant>E_WARNING</constant> level error if an unknown cipher algorithm
89
-
is passed via the <parameter>method</parameter> parameter.
114
+
is passed via the <parameter>cipher_algo</parameter> parameter.
90
115
</para>
91
116
<para>
92
117
Emits an <constant>E_WARNING</constant> level error if an empty value is passed
...
...
@@ -106,16 +131,12 @@
106
131
</thead>
107
132
<tbody>
108
133
<row>
109
-
<entry>5.3.3</entry>
110
-
<entry>
111
-
The <parameter>iv</parameter> parameter was added.
112
-
</entry>
134
+
<entry>8.1.0</entry>
135
+
<entry><parameter>tag</parameter> is now nullable.</entry>
113
136
</row>
114
137
<row>
115
-
<entry>5.4.0</entry>
116
-
<entry>
117
-
The <parameter>raw_output</parameter> was changed to <parameter>options</parameter>.
118
-
</entry>
138
+
<entry>7.1.0</entry>
139
+
<entry>The <parameter>tag</parameter> and <parameter>aad</parameter> parameters were added.</entry>
119
140
</row>
120
141
</tbody>
121
142
</tgroup>
...
...
@@ -132,7 +153,6 @@
132
153
</refsect1>
133
154

134
155
</refentry>
135
-

136
156
<!-- Keep this comment at the end of the file
137
157
Local variables:
138
158
mode: sgml
139
159