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

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

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

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

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

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

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

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

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

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

encryptBlock($in)   X-Ref
Encrypts a block

param: string $in
return: string

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

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

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

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

decryptBlock($in)   X-Ref
Decrypts a block

param: string $in
return: string

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

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