[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/phpseclib/phpseclib/phpseclib/Crypt/ -> RC4.php (summary)

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

Defines 1 class

RC4:: (9 methods):
  isValidEngineHelper()
  setKeyLength()
  setKey()
  encrypt()
  decrypt()
  encryptBlock()
  decryptBlock()
  setupKey()
  crypt()


Class: RC4  - X-Ref

Pure-PHP implementation of RC4.

isValidEngineHelper($engine)   X-Ref
Test for engine validity

This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()

return: bool
param: int $engine
see: \phpseclib3\Crypt\Common\SymmetricKey::__construct()

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.

return: string $ciphertext
param: string $plaintext
see: \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
see: self::crypt()

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.

return: string $plaintext
param: string $ciphertext
see: \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
see: self::crypt()

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.

return: string $text
param: string $text
param: int $mode
see: self::encrypt()
see: self::decrypt()