[ Index ] |
PHP Cross Reference of DokuWiki |
[Source view] [Print] [Project Stats]
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 |
DES:: (8 methods):
__construct()
isValidEngineHelper()
setKey()
encryptBlock()
decryptBlock()
processBlock()
setupKey()
setupInlineCrypt()
__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() see: \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() param: int $engine return: bool |
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 see: \phpseclib3\Crypt\Common\SymmetricKey::encryptBlock() see: \phpseclib3\Crypt\Common\SymmetricKey::encrypt() see: self::encrypt() param: string $in return: string |
decryptBlock($in) X-Ref |
Decrypts a block see: \phpseclib3\Crypt\Common\SymmetricKey::decryptBlock() see: \phpseclib3\Crypt\Common\SymmetricKey::decrypt() see: self::decrypt() param: string $in return: string |
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. see: self::encryptBlock() see: self::decryptBlock() param: string $block param: int $mode return: string |
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() |