XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
pcrypt_blowfish Class Reference

Public Member Functions

 _blowfish_crypt (&$Xl, &$Xr)
 
 _blowfish_decrypt (&$Xl, &$Xr)
 
 _decrypt ($block)
 
 _encrypt ($block)
 
 _F ($x)
 
 _init ($key)
 
 pcrypt_blowfish ($key)
 

Public Attributes

 $blocksize = 8
 
 $parray
 
 $sbox0
 
 $sbox1
 
 $sbox2
 
 $sbox3
 

Detailed Description

Class Blowfish extends PCrypt Class This class is a implementation of the Blowfish Crypt Algorithm to use with PCrypt Class. Based on Bruce Schneier Code in Applied Cryptography Book

Definition at line 43 of file blowfish.php.

Member Function Documentation

pcrypt_blowfish::_blowfish_crypt ( $Xl,
$Xr 
)

This functions encrypt the block.

private

Parameters
int$Xlleft uInt32 part of the block
int$Xrright uInt32 part of the block
Returns
void

Definition at line 281 of file blowfish.php.

References $i, and _F().

Referenced by _encrypt(), and _init().

Here is the call graph for this function:

Here is the caller graph for this function:

pcrypt_blowfish::_blowfish_decrypt ( $Xl,
$Xr 
)

This method decrypt the block.

private

Parameters
int$Xlleft uInt32 part of the block
int$Xrright uInt32 part of the block
Returns
void

Definition at line 310 of file blowfish.php.

References $i, and _F().

Referenced by _decrypt().

Here is the call graph for this function:

Here is the caller graph for this function:

pcrypt_blowfish::_decrypt (   $block)

This method is called by pcrypt class.

This method decrypt the cipher block and return the new.

public

Parameters
string$blockthe encrypted block to be decrypted
Returns
string the plain text block

Definition at line 433 of file blowfish.php.

References $data, and _blowfish_decrypt().

Here is the call graph for this function:

pcrypt_blowfish::_encrypt (   $block)

This method is called by pcrypt class.

This method encrypt the block and return the new block.

public

Parameters
string$blockthe block to be encrypted
Returns
string the block encrypted

Definition at line 414 of file blowfish.php.

References $data, and _blowfish_crypt().

Here is the call graph for this function:

pcrypt_blowfish::_F (   $x)

The F function defined in Blowfish paper.

Divide the block in 4 parts and execute the function

private

Parameters
int$xthe block
Returns
int $y the new block

Definition at line 340 of file blowfish.php.

Referenced by _blowfish_crypt(), and _blowfish_decrypt().

Here is the caller graph for this function:

pcrypt_blowfish::_init (   $key)

This function initialize the subkeys.

public

Parameters
string$keythe key used to encrypt and decrypt
Returns
void

Definition at line 363 of file blowfish.php.

References $data, $i, and _blowfish_crypt().

Referenced by pcrypt_blowfish().

Here is the call graph for this function:

Here is the caller graph for this function:

pcrypt_blowfish::pcrypt_blowfish (   $key)

Methods The Constructor of the class.

This class make a copy of the $sboxs and $parray and init the subkeys.

public

Parameters
string$keythe key used to encrypt and decrypt
Returns
void

Definition at line 265 of file blowfish.php.

References _init().

Here is the call graph for this function:

Member Data Documentation

int pcrypt_blowfish::$blocksize = 8

Block size in bytes

public

Definition at line 253 of file blowfish.php.

array pcrypt_blowfish::$parray
Initial value:
= array(
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,
0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b)

P-Array consists of 18 32-bit subkeys

private

Definition at line 243 of file blowfish.php.

pcrypt_blowfish::$sbox0

Definition at line 56 of file blowfish.php.

pcrypt_blowfish::$sbox1

Definition at line 102 of file blowfish.php.

pcrypt_blowfish::$sbox2

Definition at line 147 of file blowfish.php.

pcrypt_blowfish::$sbox3

Definition at line 192 of file blowfish.php.


The documentation for this class was generated from the following file: