@@ -52,6 +52,16 @@ caller is designing their application under. If you are unsure where to store
52
52
` $key ` , consult with a professional cryptographer to get help designing your
53
53
application.
54
54
55
+ Please note that ** encryption does not, and is not intended to, hide the
56
+ * length* of the data being encrypted.** For example, it is not safe to encrypt
57
+ a field in which only a small number of different-length values are possible
58
+ (e.g. "male" or "female") since it would be possible to tell what the plaintext
59
+ is by looking at the length of the ciphertext. In order to do this safely, it is
60
+ your responsibility to, before encrypting, pad the data out to the length of the
61
+ longest string that will ever be encrypted. This way, all plaintexts are the
62
+ same length, and no information about the plaintext can be gleaned from the
63
+ length of the ciphertext.
64
+
55
65
### File::decryptFile($inputFilename, $outputFilename, Key $key)
56
66
57
67
** Description:**
@@ -155,6 +165,16 @@ value of `$password` may be leaked out to an attacker through the stack trace.
155
165
We recommend configuring PHP to never output stack traces (either displaying
156
166
them to the user or saving them to log files).
157
167
168
+ Please note that ** encryption does not, and is not intended to, hide the
169
+ * length* of the data being encrypted.** For example, it is not safe to encrypt
170
+ a field in which only a small number of different-length values are possible
171
+ (e.g. "male" or "female") since it would be possible to tell what the plaintext
172
+ is by looking at the length of the ciphertext. In order to do this safely, it is
173
+ your responsibility to, before encrypting, pad the data out to the length of the
174
+ longest string that will ever be encrypted. This way, all plaintexts are the
175
+ same length, and no information about the plaintext can be gleaned from the
176
+ length of the ciphertext.
177
+
158
178
### File::decryptFileWithPassword($inputFilename, $outputFilename, $password)
159
179
160
180
** Description:**
@@ -268,6 +288,16 @@ caller is designing their application under. If you are unsure where to store
268
288
` $key ` , consult with a professional cryptographer to get help designing your
269
289
application.
270
290
291
+ Please note that ** encryption does not, and is not intended to, hide the
292
+ * length* of the data being encrypted.** For example, it is not safe to encrypt
293
+ a field in which only a small number of different-length values are possible
294
+ (e.g. "male" or "female") since it would be possible to tell what the plaintext
295
+ is by looking at the length of the ciphertext. In order to do this safely, it is
296
+ your responsibility to, before encrypting, pad the data out to the length of the
297
+ longest string that will ever be encrypted. This way, all plaintexts are the
298
+ same length, and no information about the plaintext can be gleaned from the
299
+ length of the ciphertext.
300
+
271
301
### File::decryptResource($inputHandle, $outputHandle, Key $key)
272
302
273
303
** Description:**
@@ -374,6 +404,16 @@ value of `$password` may be leaked out to an attacker through the stack trace.
374
404
We recommend configuring PHP to never output stack traces (either displaying
375
405
them to the user or saving them to log files).
376
406
407
+ Please note that ** encryption does not, and is not intended to, hide the
408
+ * length* of the data being encrypted.** For example, it is not safe to encrypt
409
+ a field in which only a small number of different-length values are possible
410
+ (e.g. "male" or "female") since it would be possible to tell what the plaintext
411
+ is by looking at the length of the ciphertext. In order to do this safely, it is
412
+ your responsibility to, before encrypting, pad the data out to the length of the
413
+ longest string that will ever be encrypted. This way, all plaintexts are the
414
+ same length, and no information about the plaintext can be gleaned from the
415
+ length of the ciphertext.
416
+
377
417
### File::decryptResourceWithPassword($inputHandle, $outputHandle, $password)
378
418
379
419
** Description:**
0 commit comments