note 112512 added to function.mdecrypt-generic

From: Date: Tue, 25 Jun 2013 07:16:26 +0000
Subject: note 112512 added to function.mdecrypt-generic
Groups: php.notes 
Request: Send a blank email to php-notes+get-195343@lists.php.net to get a copy of this message
For all those of you which are "surprised" by the padding (even though it is mentioned in the description of the method) please do not just "strip away everything which I do not understand". The approach with rtrim, rtrim "\0", removing all charcodes < 16, etc. are all wrong. The PKCS #7 padding works just as described in RFC 5652. To remove it, just look at the last byte of the message, and it will tell you how many bytes to remove. For example, if the last byte is equal to \0A, then remove 10 bytes. ---- Server IP: 69.147.83.199 Probable Submitter: 78.8.147.90 ---- Manual Page -- http://php.net/manual/en/function.mdecrypt-generic.php Edit -- https://master.php.net/note/edit/112512 Del: integrated -- https://master.php.net/note/delete/112512/integrated Del: useless -- https://master.php.net/note/delete/112512/useless Del: bad code -- https://master.php.net/note/delete/112512/bad+code Del: spam -- https://master.php.net/note/delete/112512/spam Del: non-english -- https://master.php.net/note/delete/112512/non-english Del: in docs -- https://master.php.net/note/delete/112512/in+docs Del: other reasons-- https://master.php.net/note/delete/112512 Reject -- https://master.php.net/note/reject/112512 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195343) next »