[ Index ] |
PHP Cross Reference of DokuWiki |
[Source view] [Print] [Project Stats]
Pure-PHP implementation of RC4. Uses mcrypt, if available, and an internal implementation, otherwise.
Author: | Jim Wigginton |
Copyright: | 2007 Jim Wigginton |
License: | http://www.opensource.org/licenses/mit-license.html MIT License |
Link: | http://phpseclib.sourceforge.net |
File Size: | 280 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
RC4:: (9 methods):
isValidEngineHelper()
setKeyLength()
setKey()
encrypt()
decrypt()
encryptBlock()
decryptBlock()
setupKey()
crypt()
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 see: \phpseclib3\Crypt\Common\SymmetricKey::__construct() return: bool |
setKeyLength($length) X-Ref |
Sets the key length Keys can be between 1 and 256 bytes long. param: int $length |
setKey($key) X-Ref |
Sets the key length Keys can be between 1 and 256 bytes long. param: string $key |
encrypt($plaintext) X-Ref |
Encrypts a message. param: string $plaintext see: \phpseclib3\Crypt\Common\SymmetricKey::decrypt() see: self::crypt() return: string $ciphertext |
decrypt($ciphertext) X-Ref |
Decrypts a message. $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). At least if the continuous buffer is disabled. param: string $ciphertext see: \phpseclib3\Crypt\Common\SymmetricKey::encrypt() see: self::crypt() return: string $plaintext |
encryptBlock($in) X-Ref |
Encrypts a block param: string $in |
decryptBlock($in) X-Ref |
Decrypts a block param: string $in |
setupKey() X-Ref |
Setup the key (expansion) see: \phpseclib3\Crypt\Common\SymmetricKey::_setupKey() |
crypt($text, $mode) X-Ref |
Encrypts or decrypts a message. param: string $text param: int $mode see: self::encrypt() see: self::decrypt() return: string $text |