Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/cch/www/pear/Crypt/HCEMD5.php
PEAR Repository -

Crypt_HCEMD5

Crypt_HCEMD5

 

private class Crypt_HCEMD5

 

Public Method Summary

void

Crypt_HCEMD5(string $key, [ string $rand ])

Creates a Crypt_HCEMD5 object.
string

encrypt(string $data)

Encrypt a block of data.
string

decrypt(string $data)

Decrypt a block of data.
string

encodeMime(string $data)

Encrypt a block of data after MIME-encoding it.
string

decodeMime(string $data)

Decrypt a block of data and then MIME-decode it.
void

encodeMimeSelfRand(string $data)

Encrypt a block of data after MIME-encoding it, and include the
string

decodeMimeSelfRand(string $data)

Decrypt a block of data and then MIME-decode it, using the

Private Method Summary

string

binmd5(string $string)

Implment md5 hashing in php, though use the mhash() function if it is available.
string

array2pack(array $array)

Turn an array into a binary packed string.
void

newKey(string $round)

Generate a new key for a new encryption block.

Private Field Summary

unknown

$key

The first key to use. This should be a shared secret.
unknown

$rand

The second key to use. This should be a randomly generated

Public Method Details

Crypt_HCEMD5

public void Crypt_HCEMD5( string $key, [ string $rand ] )

  Creates a Crypt_HCEMD5 object.

Parameter
string $key
The shared secret key
string $rand = >>null<<
(optional) The randomly generated key
Returns void


encrypt

public string encrypt( string $data )

  Encrypt a block of data.

Parameter
string $data
The data to encrypt.
Returns string

The encrypted binary data.


decrypt

public string decrypt( string $data )

  Decrypt a block of data.

Parameter
string $data
The data to decrypt.
Returns string

The decrypted binary data.


encodeMime

public string encodeMime( string $data )

  Encrypt a block of data after MIME-encoding it.

Parameter
string $data
The data to encrypt.
Returns string

The encrypted mime-encoded data.


decodeMime

public string decodeMime( string $data )

  Decrypt a block of data and then MIME-decode it.

Parameter
string $data
The data to decrypt.
Returns string

The decrypted mime-decoded data.


encodeMimeSelfRand

public void encodeMimeSelfRand( string $data )

  Encrypt a block of data after MIME-encoding it, and include the
random hash in the final output in plaintext so it can be
retrieved and decrypted with only the secret key by
decodeMimeSelfRand().

Parameter
string $data
The data to encrypt.
Returns void


decodeMimeSelfRand

public string decodeMimeSelfRand( string $data )

  Decrypt a block of data and then MIME-decode it, using the
random key stored in beginning of the ciphertext generated by
encodeMimeSelfRand().

Parameter
string $data
The data to decrypt, in the format: randkey#encrypted_data.
Returns string

The decrypted, mime-decoded data.


Private Method Details

binmd5

private string binmd5( string $string )

  Implment md5 hashing in php, though use the mhash() function if it is available.

Parameter
string $string
The string to hash.
Returns string

The md5 mhash of the string.


array2pack

private string array2pack( array $array )

  Turn an array into a binary packed string.

Parameter
array $array
The array to pack.
Returns string

The binary packed representation of the array.


newKey

private void newKey( string $round )

  Generate a new key for a new encryption block.

Parameter
string $round
The basis for the key.
Returns void


Private Field Details

$key

private unknown $key

>>unknown<<


$rand

private unknown $rand

>>unknown<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta