[prev in list] [next in list] [prev in thread] [next in thread]
List: php-doc-bugs
Subject: [DOC-BUGS] Doc #68930 [Opn->Nab]: Completely wrong example in comments
From: mazzanet () php ! net
Date: 2015-01-29 2:10:25
Message-ID: 201501290210.t0T2APAo020733 () sgrv20 ! php ! net
[Download RAW message or body]
Edit report at https://bugs.php.net/bug.php?id=68930&edit=1
ID: 68930
Updated by: mazzanet@php.net
Reported by: vlajos at gmail dot com
Summary: Completely wrong example in comments
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
Operating System: any
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Not a bug.
User notes have vote up and vote down buttons which you can use to show other users \
of a note's value. You could also write your own note explaining these issues for \
other user's reference.
Previous Comments:
------------------------------------------------------------------------
[2015-01-28 10:21:23] vlajos at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/ref.mcrypt
---
This comment has several issues:
http://php.net/manual/en/ref.mcrypt.php#99263
1.
This code snippet can strip the trailing characters when decrypting if
they match with the padding character.
It shouldn't strip more characters when decrypting than
ord(substr($dec, strlen($dec)-1,1))
Because otherwise it removes the additional characters from the original
string. (If they match accidentally.)
2.
The IV is completely useless here:
The IV is ignored in ECB mode as this mode does not require it. You will
need to have the same IV (think: starting point) both at encryption and
decryption stages, otherwise your encryption will fail.
The first point can lead corruptions, so I suggest to remove this comment. (I send an \
email already to the original author a few days ago.)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68930&edit=1
--
PHP Documentation Bugs Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic