pssht  latest
SSH server library written in PHP
fpoirotte\Pssht\Encryption\Base Class Reference
+ Inheritance diagram for fpoirotte\Pssht\Encryption\Base:

Public Member Functions

 __construct ($iv, $key)
 
 decrypt ($seqno, $data)
 
 encrypt ($seqno, $data)
 

Static Public Member Functions

static getAlgorithm ()
 
static getBlockSize ()
 
static getIVSize ()
 
static getMode ()
 
static getName ()
 Return the name of the algorithm.
 
static isAvailable ()
 
- Static Public Member Functions inherited from fpoirotte\Pssht\Encryption\EncryptionInterface
static getKeySize ()
 

Protected Attributes

 $mcrypt
 mcrypt handle for the cipher.
 

Detailed Description

Abstract base for encryption ciphers.

Definition at line 21 of file Base.php.

Constructor & Destructor Documentation

fpoirotte\Pssht\Encryption\Base::__construct (   $iv,
  $key 
)

Construct an encryption/decryption algorithm.

Parameters
string$ivInitialization vector for the algorithm.
string$keyEncryption/decrytion key.

Implements fpoirotte\Pssht\Encryption\EncryptionInterface.

Definition at line 29 of file Base.php.

Member Function Documentation

fpoirotte\Pssht\Encryption\Base::decrypt (   $seqno,
  $data 
)
final

Decrypt data using the algorithm.

Parameters
int$seqnoSequence number.
string$dataData to decrypt.
Return values
stringDecrypted data.

Implements fpoirotte\Pssht\Encryption\EncryptionInterface.

Definition at line 88 of file Base.php.

fpoirotte\Pssht\Encryption\Base::encrypt (   $seqno,
  $data 
)
final

Encrypt data using the algorithm.

Parameters
int$seqnoSequence number.
string$dataData to encrypt.
Return values
stringEncrypted data.

Implements fpoirotte\Pssht\Encryption\EncryptionInterface.

Definition at line 83 of file Base.php.

Referenced by fpoirotte\Pssht\Encryption\Stream\Arcfour256\__construct().

static fpoirotte\Pssht\Encryption\Base::getAlgorithm ( )
static

Get the name of the algorithm to use.

Return values
stringName of the mcrypt constant representing the algorithm to use for encryption/decryption.
Warning
The return value of this method is the name of the constant for the algorithm to use (eg. "MCRYPT_TRIPLEDES"), not its value.

Implements fpoirotte\Pssht\Encryption\BaseInterface.

Definition at line 93 of file Base.php.

static fpoirotte\Pssht\Encryption\Base::getBlockSize ( )
staticfinal

Get the algorithm's block size.

Return values
intBlock size (in bytes).

Implements fpoirotte\Pssht\Encryption\EncryptionInterface.

Definition at line 75 of file Base.php.

static fpoirotte\Pssht\Encryption\Base::getIVSize ( )
staticfinal

Get the algorithm's IV size.

Return values
intInitialization vector size (in bytes).

Implements fpoirotte\Pssht\Encryption\EncryptionInterface.

Definition at line 67 of file Base.php.

static fpoirotte\Pssht\Encryption\Base::getMode ( )
static

Get the encryption/decryption mode.

Return values
stringName of the cipher encryption/decryption mode to use.
Warning
The return value of this method is the name of the cipher mode, ie. the value of one of the "MCRYPT_MODE_*" constants.

Implements fpoirotte\Pssht\Encryption\BaseInterface.

Definition at line 99 of file Base.php.

static fpoirotte\Pssht\Encryption\Base::isAvailable ( )
staticfinal

Determine whether the algorithm is available.

Return values
booltrue if the algorithm is available, false otherwise.

Implements fpoirotte\Pssht\Algorithms\AvailabilityInterface.

Definition at line 46 of file Base.php.


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