3 * The ECB (Electronic CodeBook) mode implementation
7 * @category PHPCryptLib
10 * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
11 * @copyright 2011 The Authors
12 * @license http://www.opensource.org/licenses/mit-license.html MIT License
13 * @version Build @@version@@
16 namespace CryptLib\Cipher\Block\Mode
;
19 * The ECB (Electronic CodeBook) mode implementation
21 * @category PHPCryptLib
24 * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
26 class ECB
extends \CryptLib\Cipher\Block\AbstractMode
{
29 * Decrypt the data using the supplied key, cipher and initialization vector
31 * @param string $data The data to decrypt
33 * @return string The decrypted data
35 protected function decryptBlock($data) {
36 return $this->cipher
->decryptBlock($data);
40 * Encrypt the data using the supplied key, cipher and initialization vector
42 * @param string $data The data to encrypt
44 * @return string The encrypted data
46 protected function encryptBlock($data) {
47 return $this->cipher
->encryptBlock($data);