[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

Pure-PHP implementation of Blowfish. Uses mcrypt, if available, and an internal implementation, otherwise.

Author: Jim Wigginton
Author: Hans-Juergen Petrich
Copyright: 2007 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
Link: http://phpseclib.sourceforge.net
File Size: 918 lines (47 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Blowfish:: (14 methods):
  __construct()
  setKeyLength()
  isValidEngineHelper()
  setupKey()
  initialize_static_variables()
  bcrypt_hash()
  bcrypt_pbkdf()
  expand0state()
  expandstate()
  encryptBlock()
  encryptBlockHelperFast()
  encryptBlockHelperSlow()
  decryptBlock()
  setupInlineCrypt()


Class: Blowfish  - X-Ref

Pure-PHP implementation of Blowfish.

__construct($mode)   X-Ref
Default Constructor.

param: string $mode

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

Key lengths can be between 32 and 448 bits.

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()

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

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

see: \phpseclib3\Crypt\Common\SymmetricKey::_setupKey()

initialize_static_variables()   X-Ref
Initialize Static Variables


bcrypt_hash($sha2pass, $sha2salt)   X-Ref
bcrypt

return: string
param: string $sha2pass
param: string $sha2salt

bcrypt_pbkdf($pass, $salt, $keylen, $rounds)   X-Ref
Performs OpenSSH-style bcrypt

return: string
param: string $pass
param: string $salt
param: int $keylen
param: int $rounds

expand0state(array $key, array &$sbox0, array &$sbox1, array &$sbox2, array &$sbox3, array &$p)   X-Ref
Key expansion without salt

param: int[] $key
param: int[] $sbox0
param: int[] $sbox1
param: int[] $sbox2
param: int[] $sbox3
param: int[] $p
see: self::_bcrypt_hash()

expandstate(array $data, array $key, array &$sbox0, array &$sbox1, array &$sbox2, array &$sbox3, array &$p)   X-Ref
Key expansion with salt

param: int[] $data
param: int[] $key
param: int[] $sbox0
param: int[] $sbox1
param: int[] $sbox2
param: int[] $sbox3
param: int[] $p
see: self::_bcrypt_hash()

encryptBlock($in)   X-Ref
Encrypts a block

return: string
param: string $in

encryptBlockHelperFast($x0, $x1, array $sbox0, array $sbox1, array $sbox2, array $sbox3, array $p)   X-Ref
Fast helper function for block encryption

return: int[]
param: int $x0
param: int $x1
param: int[] $sbox0
param: int[] $sbox1
param: int[] $sbox2
param: int[] $sbox3
param: int[] $p

encryptBlockHelperSlow($x0, $x1, array $sbox0, array $sbox1, array $sbox2, array $sbox3, array $p)   X-Ref
Slow helper function for block encryption

return: int[]
param: int $x0
param: int $x1
param: int[] $sbox0
param: int[] $sbox1
param: int[] $sbox2
param: int[] $sbox3
param: int[] $p

decryptBlock($in)   X-Ref
Decrypts a block

return: string
param: string $in

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

see: \phpseclib3\Crypt\Common\SymmetricKey::_setupInlineCrypt()