Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: c:/www/apache/doc2//pear/Crypt/HCEMD5.php
PEAR 2000/12/03 -

Crypt_HCEMD5

Crypt_HCEMD5

Warning: documentation is missing.

 

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

string

$key

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

$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
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
data to encrypt.
Returns string

The encrypted binary data.


decrypt

public string decrypt( string $data )

  Decrypt a block of data.

Parameter
string $data
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
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
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 beretrieved and decrypted with only the secret key bydecodeMimeSelfRand().

Parameter
string $data
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 byencodeMimeSelfRand().

Parameter
string $data
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
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
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
basis for the key.
Returns void


Private Field Details

$key

private string $key

>><<

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


$rand

private long $rand

>><<

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



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta