Crypt
[ class tree: Crypt ] [ index: Crypt ] [ all elements ]

Class: Crypt_CBC

Source Location: /Crypt_CBC-1.0.0/CBC.php

Class Overview

PEAR
   |
   --Crypt_CBC

Class to emulate Perl's Crypt::CBC module


Author(s):

Version:

  • $Revision: 1.7 $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 49]
Class to emulate Perl's Crypt::CBC module

Blowfish support that is compatable with Perl requires libmcrypt >= 2.4.9. If you are using libmcrypt <= 2.4.8, Blowfish encryption will work, but your data will not be readable by Perl scripts. It will work "internally" .. i.e. this class will be able to encode/decode the data.

Blowfish support that is compatable with PHP applications using libmcrypt <= 2.4.8 requies you to use 'BLOWFISH-COMPAT' when specifying the cipher. Check the libmcrypt docs when in doubt.

This class no longer works with libmcrypt 2.2.x versions.

NOTE: the cipher names in this class may change depending on how the author of libcrypt decides to name things internally.

  • Author: Colin Viebrock <colin@easydns.com>
  • Version: $Revision: 1.7 $
  • Access: public


[ Top ]


Class Variables

$blocksize =

[line 83]

blocksize of cipher

Type:   string


[ Top ]

$cipher =

[line 65]

used cipher

Type:   string


[ Top ]

$deinit_function =

[line 77]

crypt deinit function, for backwards compatability

Type:   string


[ Top ]

$header_spec =  'RandomIV'

[line 108]

header

Type:   string


[ Top ]

$keyhash =

[line 95]

mangled key

Type:   string


[ Top ]

$keysize =

[line 89]

keysize of cipher

Type:   int


[ Top ]

$known_ciphers = array (
        'DES'               => MCRYPT_DES,
        'BLOWFISH'          => MCRYPT_BLOWFISH,
        'BLOWFISH-COMPAT'   => MCRYPT_BLOWFISH_COMPAT,
    )

[line 55]

supported procedures

Type:   array


[ Top ]

$rand_source =  MCRYPT_RAND

[line 102]

source type of the initialization vector for creation

possible types are MCRYPT_RAND or MCRYPT_DEV_URANDOM or MCRYPT_DEV_RANDOM


Type:   int


[ Top ]

$TD =

[line 71]

crypt resource, for 2.4.x

Type:   string


[ Top ]



Method Detail

Crypt_CBC (Constructor)   [line 136]

$return Crypt_CBC( $key $key, [$cipher $cipher = 'DES'])

Constructor $key is the key to use for encryption. $cipher can be DES, BLOWFISH or BLOWFISH-COMPAT
  • Return: either a PEAR error or true
  • Access: public

Parameters:

$key   $key   —  encryption key
$cipher   $cipher   —  which algorithm to use, defaults to DES

[ Top ]

_Crypt_CBC (Destructor)   [line 201]

void _Crypt_CBC( )

Destructor

[ Top ]

decrypt   [line 269]

$clear decrypt( $crypt $crypt)

Decryption method
  • Return: plaintext, or PEAR error
  • Access: public

Parameters:

$crypt   $crypt   —  encrypted text

[ Top ]

encrypt   [line 218]

$crypt encrypt( $clear $clear)

Encryption method
  • Return: encrypted text, or PEAR error
  • Access: public

Parameters:

$clear   $clear   —  plaintext

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:25:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.