[ Index ]

PHP Cross Reference of DokuWiki




/vendor/phpseclib/phpseclib/phpseclib/Crypt/ -> DES.php (summary)

Pure-PHP implementation of DES. Uses mcrypt, if available, and an internal implementation, otherwise.

Author: Jim Wigginton
Copyright: 2007 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
Link: http://phpseclib.sourceforge.net
File Size: 1392 lines (69 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

DES:: (8 methods):

Class: DES  - X-Ref

Pure-PHP implementation of DES.

__construct($mode)   X-Ref
Default Constructor.

param: string $mode

isValidEngineHelper($engine)   X-Ref
Test for engine validity

This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()

return: bool
see: \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine()
param: int $engine

setKey($key)   X-Ref
Sets the key.

Keys must be 64-bits long or 8 bytes long.

DES also requires that every eighth bit be a parity bit, however, we'll ignore that.

see: \phpseclib3\Crypt\Common\SymmetricKey::setKey()
param: string $key

encryptBlock($in)   X-Ref
Encrypts a block

return: string
see: \phpseclib3\Crypt\Common\SymmetricKey::encryptBlock()
see: \phpseclib3\Crypt\Common\SymmetricKey::encrypt()
see: self::encrypt()
param: string $in

decryptBlock($in)   X-Ref
Decrypts a block

return: string
see: \phpseclib3\Crypt\Common\SymmetricKey::decryptBlock()
see: \phpseclib3\Crypt\Common\SymmetricKey::decrypt()
see: self::decrypt()
param: string $in

processBlock($block, $mode)   X-Ref
Encrypts or decrypts a 64-bit block

$mode should be either self::ENCRYPT or self::DECRYPT.  See
{@link http://en.wikipedia.org/wiki/Image:Feistel.png Feistel.png} to get a general
idea of what this function does.

return: string
see: self::encryptBlock()
see: self::decryptBlock()
param: string $block
param: int $mode

setupKey()   X-Ref
Creates the key schedule

see: \phpseclib3\Crypt\Common\SymmetricKey::setupKey()

setupInlineCrypt()   X-Ref
Setup the performance-optimized function for de/encrypt()

see: \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt()