note 116309 added to function.mcrypt-create-iv

From: Date: Wed, 10 Dec 2014 19:32:21 +0000
Subject: note 116309 added to function.mcrypt-create-iv
Groups: php.notes 
Request: Send a blank email to php-notes+get-201106@lists.php.net to get a copy of this message
Block ciphers, at their core, are a pair of transformation algorithms, called transforms. One encrypts, one decrypts - in some cases the algorithms are one and the same, but that's not important. A block transform takes a fixed-length block of plaintext, transforms it using a secret key of some chosen size, and produces an identical-length block of ciphertext. Or, of course, vice versa (decryption). The security model of a block cipher is, simplistically at least, defined to be "if you encrypt one block of plaintext with a randomly chosen key, it will be computationally infeasible for an attacker with knowledge of only the ciphertext (i.e. he does not know the key) to discover information about the contents of the plaintext". The reality is slightly different - there are also clauses around knowing part of the plaintext and not being able to discover any more of it - but that's another story. Once you start encrypting more than one block of plaintext using the same block transform and the same key, all bets are off. In the Electronic Codebook (ECB) cipher mode, each block of plaintext is independently transformed using the same key. This leads to a problem: identical plaintext blocks produce identical ciphertext blocks, when the same key is used. This means that "patterns" in the data can be seen, especially in data formats that have repeating patterns or long sequences of identical data. This is best described visually, with an ECB-encrypted bitmap. See the Wikipedia article on ECB for a demonstration of this. ---- Server IP: 72.52.91.14 Probable Submitter: 99.149.221.8 ---- Manual Page -- http://php.net/manual/en/function.mcrypt-create-iv.php Edit -- https://master.php.net/note/edit/116309 Del: integrated -- https://master.php.net/note/delete/116309/integrated Del: useless -- https://master.php.net/note/delete/116309/useless Del: bad code -- https://master.php.net/note/delete/116309/bad+code Del: spam -- https://master.php.net/note/delete/116309/spam Del: non-english -- https://master.php.net/note/delete/116309/non-english Del: in docs -- https://master.php.net/note/delete/116309/in+docs Del: other reasons-- https://master.php.net/note/delete/116309 Reject -- https://master.php.net/note/reject/116309 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201106) next »