[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Source view] [Print] [Project Stats]
Pure-PHP implementation of RC2. Uses mcrypt, if available, and an internal implementation, otherwise.
Author: | Patrick Monnerat <[email protected]> |
License: | http://www.opensource.org/licenses/mit-license.html MIT License |
File Size: | 669 lines (22 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
RC2:: (11 methods):
__construct()
isValidEngineHelper()
setKeyLength()
getKeyLength()
setKey()
encrypt()
decrypt()
encryptBlock()
decryptBlock()
setupKey()
setupInlineCrypt()
__construct($mode) X-Ref |
Default Constructor. param: string $mode |
isValidEngineHelper($engine) X-Ref |
Test for engine validity This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() param: int $engine return: bool |
setKeyLength($length) X-Ref |
Sets the key length. Valid key lengths are 8 to 1024. Calling this function after setting the key has no effect until the next \phpseclib3\Crypt\RC2::setKey() call. param: int $length in bits |
getKeyLength() X-Ref |
Returns the current key length return: int |
setKey($key, $t1 = false) X-Ref |
Sets the key. Keys can be of any length. RC2, itself, uses 8 to 1024 bit keys (eg. strlen($key) <= 128), however, we only use the first 128 bytes if $key has more then 128 bytes in it, and set $key to a single null byte if it is empty. param: string $key param: int|boolean $t1 optional Effective key length in bits. |
encrypt($plaintext) X-Ref |
Encrypts a message. Mostly a wrapper for \phpseclib3\Crypt\Common\SymmetricKey::encrypt, with some additional OpenSSL handling code param: string $plaintext return: string $ciphertext |
decrypt($ciphertext) X-Ref |
Decrypts a message. Mostly a wrapper for \phpseclib3\Crypt\Common\SymmetricKey::decrypt, with some additional OpenSSL handling code param: string $ciphertext return: string $plaintext |
encryptBlock($in) X-Ref |
Encrypts a block param: string $in return: string |
decryptBlock($in) X-Ref |
Decrypts a block param: string $in return: string |
setupKey() X-Ref |
Creates the key schedule |
setupInlineCrypt() X-Ref |
Setup the performance-optimized function for de/encrypt() |
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |