[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/phpseclib/phpseclib/phpseclib/Crypt/ -> Rijndael.php (summary)

Pure-PHP implementation of Rijndael. Uses mcrypt, if available/possible, and an internal implementation, otherwise.

Author: Jim Wigginton <[email protected]>
Copyright: 2008 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
File Size: 1061 lines (45 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Rijndael:: (15 methods):
  __construct()
  setKeyLength()
  setKey()
  setBlockLength()
  isValidEngineHelper()
  encryptBlock()
  decryptBlock()
  setup()
  setupKey()
  subWord()
  getTables()
  getInvTables()
  setupInlineCrypt()
  encrypt()
  decrypt()


Class: Rijndael  - X-Ref

Pure-PHP implementation of Rijndael.

__construct($mode)   X-Ref
Default Constructor.

param: string $mode

setKeyLength($length)   X-Ref
Sets the key length.

Valid key lengths are 128, 160, 192, 224, and 256.

Note: phpseclib extends Rijndael (and AES) for using 160- and 224-bit keys but they are officially not defined
and the most (if not all) implementations are not able using 160/224-bit keys but round/pad them up to
192/256 bits as, for example, mcrypt will do.

That said, if you want be compatible with other Rijndael and AES implementations,
you should not setKeyLength(160) or setKeyLength(224).

Additional: In case of 160- and 224-bit keys, phpseclib will/can, for that reason, not use
the mcrypt php extension, even if available.
This results then in slower encryption.

param: int $length

setKey($key)   X-Ref
Sets the key.

Rijndael supports five different key lengths

param: string $key

setBlockLength($length)   X-Ref
Sets the block length

Valid block lengths are 128, 160, 192, 224, and 256.

param: int $length

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

encryptBlock($in)   X-Ref
Encrypts a block

param: string $in
return: string

decryptBlock($in)   X-Ref
Decrypts a block

param: string $in
return: string

setup()   X-Ref
Setup the self::ENGINE_INTERNAL $engine

(re)init, if necessary, the internal cipher $engine and flush all $buffers
Used (only) if $engine == self::ENGINE_INTERNAL

_setup() will be called each time if $changed === true
typically this happens when using one or more of following public methods:

- setKey()

- setIV()

- disableContinuousBuffer()

- First run of encrypt() / decrypt() with no init-settings

{@internal setup() is always called before en/decryption.}

{@internal Could, but not must, extend by the child Crypt_* class}


setupKey()   X-Ref
Setup the key (expansion)


subWord($word)   X-Ref
Performs S-Box substitutions

param: int $word
return: array

getTables()   X-Ref
Provides the mixColumns and sboxes tables

return: array &$tables

getInvTables()   X-Ref
Provides the inverse mixColumns and inverse sboxes tables

return: array &$tables

setupInlineCrypt()   X-Ref
Setup the performance-optimized function for de/encrypt()


encrypt($plaintext)   X-Ref
Encrypts a message.

param: string $plaintext
return: string

decrypt($ciphertext)   X-Ref
Decrypts a message.

param: string $ciphertext
return: string



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer