Crypt_Blowfish
[ class tree: Crypt_Blowfish ] [ index: Crypt_Blowfish ] [ all elements ]

Class: Crypt_Blowfish_PHP

Source Location: /Crypt_Blowfish-1.1.0RC2/Blowfish/PHP.php

Class Overview

Crypt_Blowfish
   |
   --Crypt_Blowfish_PHP

Common class for PHP-only implementations


Author(s):

Version:

  • 1.1.0RC2

Copyright:

  • 2005-2008 Matthew Fonda

Variables

Methods


Child classes:

Inherited Variables

Inherited Methods

Class: Crypt_Blowfish

Crypt_Blowfish::Crypt_Blowfish()
Crypt_Blowfish Constructor Initializes the Crypt_Blowfish object (in EBC mode), and sets the secret key
Crypt_Blowfish::decrypt()
Decrypts an encrypted string
Crypt_Blowfish::encrypt()
Encrypts a string
Crypt_Blowfish::factory()
Crypt_Blowfish object factory
Crypt_Blowfish::getBlockSize()
Returns the algorithm's block size
Crypt_Blowfish::getIVSize()
Returns the algorithm's IV size
Crypt_Blowfish::getMaxKeySize()
Returns the algorithm's maximum key size
Crypt_Blowfish::init()
Deprecated init method - init is now a private method and has been replaced with _init
Crypt_Blowfish::isReady()
Deprecated isReady method
Crypt_Blowfish::setKey()
Sets the secret key The key must be non-zero, and less than or equal to 56 characters (bytes) in length.

Class Details

[line 42]
Common class for PHP-only implementations


[ Top ]


Class Variables

$_iv_required =  false

[line 66]

Whether the IV is required
  • Access: protected

Type:   boolean


[ Top ]

$_keyHash =  null

[line 74]

Hash value of last used key
  • Access: protected

Type:   string


[ Top ]

$_P = array()

[line 50]

P-Array contains 18 32-bit subkeys
  • Access: protected

Type:   array


[ Top ]

$_S = array()

[line 58]

Array of four S-Blocks each containing 256 32-bit entries
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 86]

Crypt_Blowfish_PHP __construct( [string $key = null], [string $iv = null], string $mode)

Crypt_Blowfish_PHP Constructor Initializes the Crypt_Blowfish object, and sets the secret key
  • Access: protected

Overridden in child classes as:

Crypt_Blowfish_CBC::__construct()
Class constructor
Crypt_Blowfish_ECB::__construct()
Class constructor

Parameters:

string   $key     
string   $mode     operating mode 'ecb' or 'cbc'
string   $iv     initialization vector

[ Top ]

setKey   [line 203]

boolean|PEAR_Error setKey( string $key, [string $iv = null])

Sets the secret key The key must be non-zero, and less than or equal to 56 characters (bytes) in length.

If you are making use of the PHP mcrypt extension, you must call this method before each encrypt() and decrypt() call.

  • Return: Returns TRUE on success, PEAR_Error on failure
  • Todo: Fix the caching of the key
  • Access: public

Overrides Crypt_Blowfish::setKey() (Sets the secret key The key must be non-zero, and less than or equal to 56 characters (bytes) in length.)

Parameters:

string   $key     
string   $iv     8-char initialization vector (required for CBC mode)

[ Top ]

_binxor   [line 117]

float _binxor( integer|float $l, integer|float $r)

Workaround for XOR on certain systems
  • Access: protected

Parameters:

integer|float   $l     
integer|float   $r     

[ Top ]

_decipher   [line 164]

void _decipher( int &$Xl, int &$Xr)

Deciphers a single 64-bit block
  • Access: protected

Parameters:

int   &$Xl     
int   &$Xr     

[ Top ]

_encipher   [line 132]

void _encipher( int &$Xl, int &$Xr)

Enciphers a single 64-bit block
  • Access: protected

Parameters:

int   &$Xl     
int   &$Xr     

[ Top ]


Documentation generated on Sat, 30 Aug 2008 18:00:08 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.