3 * The interface that all block ciphers must implement
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
;
19 * The interface that all block ciphers must implement
21 * @category PHPCryptLib
24 * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
30 * Get a list of supported ciphers by this cipher.
32 * @return array An array of supported cipher names (strings)
34 public static function getSupportedCiphers();
37 * Decrypt a block of data using the supplied string key.
39 * Note that the supplied data should be the same size as the block size of
40 * the cipher being used.
42 * @param string $data The data to decrypt
44 * @return string The result decrypted data
46 public function decryptBlock($data);
49 * Encrypt a block of data using the supplied string key.
51 * Note that the supplied data should be the same size as the block size of
52 * the cipher being used.
54 * @param string $data The data to encrypt
56 * @return string The result encrypted data
58 public function encryptBlock($data);
61 * Get the block size for the current initialized cipher.
63 * @return int The block size for the current cipher
65 public function getBlockSize();
68 * Get the key size for the current initialized cipher
70 * @return int The key size for the current cipher
72 public function getKeySize();
75 * Get the string name of the current cipher instance.
77 * @return string The current instantiated cipher
79 public function getCipher();
82 * Set the key to be used in this instance
84 * @param string $key The key the data will be encrypted with
88 public function setKey($key);