McryptCipher

Implements \Joomla\CMS\Crypt\CipherInterface

Crypt cipher for mcrypt algorithm encryption, decryption and key generation.

abstract deprecated
since

3.0.0

deprecated

4.0 Without replacment use CryptoCipher

Methods

__construct

Constructor.

__construct() 
since

3.0.0

throws

\RuntimeException

decrypt

Method to decrypt a data string.

decrypt(string $data, \Joomla\CMS\Crypt\Key $key) : string
since

3.0.0

throws

\InvalidArgumentException

Arguments

$data

stringThe encrypted string to decrypt.

$key

\Joomla\CMS\Crypt\KeyThe key object to use for decryption.

Response

stringThe decrypted data string.

encrypt

Method to encrypt a data string.

encrypt(string $data, \Joomla\CMS\Crypt\Key $key) : string
since

3.0.0

throws

\InvalidArgumentException

Arguments

$data

stringThe data string to encrypt.

$key

\Joomla\CMS\Crypt\KeyThe key object to use for encryption.

Response

stringThe encrypted data string.

generateKey

Method to generate a new encryption key object.

generateKey(array $options = array()) : \Joomla\CMS\Crypt\Key
since

3.0.0

throws

\InvalidArgumentException

Arguments

$options

arrayKey generation options.

Response

\Joomla\CMS\Crypt\Key

pbkdf2

PBKDF2 Implementation for deriving keys.

pbkdf2(string $p, string $s, integer $kl, integer $c = 10000, string $a = 'sha256') : string
link

https://en.wikipedia.org/wiki/PBKDF2

http://www.ietf.org/rfc/rfc2898.txt

since

3.0.0

Arguments

$p

stringPassword

$s

stringSalt

$kl

integerKey length

$c

integerIteration count

$a

stringHash algorithm

Response

stringThe derived key.

Properties

type

The mcrypt cipher constant.

link

https://secure.php.net/manual/en/mcrypt.ciphers.php

since

3.0.0

Type(s)

integer

mode

The mcrypt block cipher mode.

keyType

The Crypt key type for validation.

since

3.0.0

Type(s)

string