[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/Cipher/ -> cast128.php (sommaire)

(pas de description)

Poids: 720 lignes (46 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Horde_Cipher_cast128:: (12 méthodes):
  setKey()
  getBlockSize()
  encryptBlock()
  decryptBlock()
  f1()
  f2()
  f3()
  _formatData()
  _formatKey()
  _keySchedule()
  _split()
  _combine4()


Classe: Horde_Cipher_cast128  - X-Ref

The Cipher_cast128:: class implements the Cipher interface encryption data
using the CAST128 (aka Cast5) algorithm as defined in RFC2144.

$Horde: framework/Cipher/Cipher/cast128.php,v 1.7.12.8 2006/01/01 21:28:10 jan Exp $

Copyright 2002-2006 Mike Cochrane <mike@graftonhall.co.nz>

See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

setKey($key)   X-Ref
Set the key to be used for en/decryption.

param: string $key  The key to use.

getBlockSize()   X-Ref
Return the size of the blocks that this cipher needs.

return: integer  The number of characters per block.

encryptBlock($block, $key = null)   X-Ref
Encrypt a block of data.

param: string $block  The data to encrypt.
param: string $key    The key to use.
return: string  The encrypted output.

decryptBlock($block, $key = null)   X-Ref
Decrypt a block of data.

param: string $block  The data to decrypt.
param: string $key    The key to use.
return: string  The decrypted output.

f1($d, $Km, $Kr)   X-Ref
f1()


f2($d, $Km, $Kr)   X-Ref
f2()


f3($d, $Km, $Kr)   X-Ref
f3()


_formatData($data)   X-Ref
Convert a string into a array of the ordinates of its characters.

param: string $data  Data to convert.
return: array  The converted data.

_formatKey($key)   X-Ref
Converts a text key into an array padded with \0's to a length of 128
bits.

param: string $key  The key to format.
return: array  The padded key.

_keySchedule($key)   X-Ref
Create the complete key shedule.

param: array $key  The key to use.

_split($x)   X-Ref
Unpack the 32 bit value into an array of four 8 bit values.

param: integer $x  32 bit value.
return: array  Four 8 bit values MS to LS.

_combine4($key, $start = 0)   X-Ref
Pack four 8 bit values into one 32 bit value.

param: array $key      Array of 8 bit values.
param: integer $start  Start position in array to get 4 values from.
return: integer  32 bit value.



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7