Skip to content

Commit e5ab293

Browse files
authored
Clarify passphrase for openssl_encrypt and openssl_decrypt (#3774)
1 parent 296d45d commit e5ab293

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

reference/openssl/functions/openssl-decrypt.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<methodparam choice="opt"><type>string</type><parameter>aad</parameter><initializer>""</initializer></methodparam>
2020
</methodsynopsis>
2121
<para>
22-
Takes a raw or base64 encoded string and decrypts it using a given method and key.
22+
Takes a raw or base64 encoded string and decrypts it using a given method and passphrase.
2323
</para>
2424

2525
</refsect1>
@@ -49,8 +49,17 @@
4949
<term><parameter>passphrase</parameter></term>
5050
<listitem>
5151
<para>
52-
The key.
52+
The passphrase. If the passphrase is shorter than expected, it is silently padded with
53+
<literal>NUL</literal> characters; if the passphrase is longer than expected, it is
54+
silently truncated.
5355
</para>
56+
<caution>
57+
<simpara>
58+
There is no key derivation function used for <parameter>passphrase</parameter> as its name
59+
might suggest. The only operation used is padding with <literal>NUL</literal> characters
60+
or truncation if the length is different than expected.
61+
</simpara>
62+
</caution>
5463
</listitem>
5564
</varlistentry>
5665
<varlistentry>
@@ -68,7 +77,9 @@
6877
<term><parameter>iv</parameter></term>
6978
<listitem>
7079
<para>
71-
A non-NULL Initialization Vector.
80+
A non-&null; Initialization Vector. If the IV is shorter than expected, it is padded with
81+
<literal>NUL</literal> characters and warning is emitted; if the passphrase is longer
82+
than expected, it is truncated and warning is emitted.
7283
</para>
7384
</listitem>
7485
</varlistentry>

reference/openssl/functions/openssl-encrypt.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<methodparam choice="opt"><type>int</type><parameter>tag_length</parameter><initializer>16</initializer></methodparam>
2121
</methodsynopsis>
2222
<para>
23-
Encrypts given data with given method and key, returns a raw
23+
Encrypts given data with given method and passphrase, returns a raw
2424
or base64 encoded string
2525
</para>
2626
</refsect1>
@@ -53,6 +53,13 @@
5353
<literal>NUL</literal> characters; if the passphrase is longer than expected, it is
5454
silently truncated.
5555
</para>
56+
<caution>
57+
<simpara>
58+
There is no key derivation function used for <parameter>passphrase</parameter> as its name
59+
might suggest. The only operation used is padding with <literal>NUL</literal> characters
60+
or truncation if the length is different than expected.
61+
</simpara>
62+
</caution>
5663
</listitem>
5764
</varlistentry>
5865
<varlistentry>
@@ -70,7 +77,9 @@
7077
<term><parameter>iv</parameter></term>
7178
<listitem>
7279
<para>
73-
A non-NULL Initialization Vector.
80+
The passphrase. If the passphrase is shorter than expected, it is silently padded with
81+
<literal>NUL</literal> characters; if the passphrase is longer than expected, it is
82+
silently truncated.
7483
</para>
7584
</listitem>
7685
</varlistentry>

0 commit comments

Comments
 (0)