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

Public Member Functions

__construct()

Configure the new object, setting the mode and key.

public

Parameters
[$mode]integer
[$key]integer
Returns
void
 __construct ($mode=null, $key=null)
 
__toString()

Overload of the object conversion to string.

public void

Returns
string
 __toString ()
 
__set()

Properties write methods.

Parameters
$propertystring
$valuemixed
Returns
void
 __set ($property, $value)
 
__get()

Properties read methods.

Parameters
$keystring
Returns
void
 __get ($property)
 
encrypt()

Encrypt the data using the current returning mode.

public

Parameters
$datamixed
Returns
string
 encrypt ($data)
 
decrypt()

Decrypt the data using the current returning mode. NOTE: You must use the same $_mode of the creation process.

public

Parameters
$cryptstring
Returns
string
 decrypt ($crypt)
 

Static Public Member Functions

supportedModes()

Return the list containing all supported modes.

public

Parameters
void
Returns
void
static supportedModes ()
 
_isSupportedMode()

Checks if $mode is a valid returning mode of the class.

public

Parameters
$modeinteger
Returns
void
static _isSupportedMode ($mode)
 

Public Attributes

const MODE_B64 = 1
 
const MODE_BIN = 0
 
const MODE_HEX = 2
 

Protected Member Functions

_setMode()

Set the current returning mode of the class.

protected

Parameters
$modeinteger
Returns
void
 _setKey ($key)
 
 _setMode ($mode)
 
_encodeHexadecimal()

Encode the data using hexadecimal chars.

protected

Parameters
$datamixed
Returns
string
 _encodeHexadecimal ($data)
 
_decodeHexadecimal()

Decode hexadecimal strings.

protected

Parameters
$datastring
Returns
string
 _decodeHexadecimal ($hexcrypt)
 

Private Attributes

$_key

The private key used in the cryptography method. NOTE: This value should be as strange as possible.

private

 $_key = __CLASS__
 
$_mode

The returning mode of the cryptography method.

private

 $_mode = Crypt::MODE_HEX
 

Detailed Description

Definition at line 22 of file crypt.php.

Constructor & Destructor Documentation

Crypt::__construct (   $mode = null,
  $key = null 
)

Definition at line 66 of file crypt.php.

Member Function Documentation

Crypt::__get (   $property)

Definition at line 118 of file crypt.php.

References $_key, and $_mode.

Crypt::__set (   $property,
  $value 
)

Definition at line 101 of file crypt.php.

References _setKey(), and _setMode().

Here is the call graph for this function:

Crypt::__toString ( )

Definition at line 82 of file crypt.php.

Crypt::_decodeHexadecimal (   $hexcrypt)
protected

Definition at line 265 of file crypt.php.

References $data, and $i.

Referenced by decrypt().

Here is the caller graph for this function:

Crypt::_encodeHexadecimal (   $data)
protected

Definition at line 246 of file crypt.php.

References $data, and $i.

Referenced by encrypt().

Here is the caller graph for this function:

static Crypt::_isSupportedMode (   $mode)
static

Definition at line 200 of file crypt.php.

References supportedModes().

Referenced by _setMode().

Here is the call graph for this function:

Here is the caller graph for this function:

Crypt::_setKey (   $key)
protected

Definition at line 215 of file crypt.php.

Referenced by __set().

Here is the caller graph for this function:

Crypt::_setMode (   $mode)
protected

Definition at line 230 of file crypt.php.

References _isSupportedMode().

Referenced by __set().

Here is the call graph for this function:

Here is the caller graph for this function:

Crypt::decrypt (   $crypt)

Definition at line 160 of file crypt.php.

References $data, $i, _decodeHexadecimal(), MODE_B64, and MODE_HEX.

Here is the call graph for this function:

Crypt::encrypt (   $data)

Definition at line 136 of file crypt.php.

References $data, $i, _encodeHexadecimal(), MODE_B64, and MODE_HEX.

Here is the call graph for this function:

static Crypt::supportedModes ( )
static

Definition at line 181 of file crypt.php.

References MODE_B64, MODE_BIN, and MODE_HEX.

Referenced by _isSupportedMode().

Here is the caller graph for this function:

Member Data Documentation

Crypt::$_key = __CLASS__
private

Definition at line 42 of file crypt.php.

Referenced by __get().

Crypt::$_mode = Crypt::MODE_HEX
private

Definition at line 52 of file crypt.php.

Referenced by __get().

const Crypt::MODE_B64 = 1

Definition at line 28 of file crypt.php.

Referenced by decrypt(), encrypt(), and supportedModes().

const Crypt::MODE_BIN = 0

Definition at line 27 of file crypt.php.

Referenced by supportedModes().

const Crypt::MODE_HEX = 2

Definition at line 29 of file crypt.php.

Referenced by decrypt(), TextCleaner\decrypt(), encrypt(), TextCleaner\encrypt(), and supportedModes().


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