Mcrypt

Extends AbstractAES Implements AesInterface

Mcrypt implementation

deprecated
since

4.0.0

deprecated

4.0.0 will be removed in 5.0.0

package

Application

Methods

decrypt

Decrypt encrypted data

decrypt(string cipherText, string key) : string

Arguments

cipherText

stringEncrypted data

key

stringEncryptionkey

Response

stringPlaintext data

encrypt

Encrypt the data

encrypt(string plainText, string key, string iv = null) : string

Arguments

plainText

stringPlaintext data

key

stringEncryption key

iv

stringIV for the encryption

Response

stringEncrypted data

getBlockSize

Get the block size

getBlockSize() : int

Response

int

getZeroPadding

Returns null bytes to append to the string so that it's zero padded to the specified block size

getZeroPadding(string string, int blockSize) : string
inherited

Arguments

string

stringThe binary string which will be zero padded

blockSize

intThe block size

Response

stringThe zero bytes to append to the string to zero pad it to $blockSize

isSupported

Is this adapter supported?

isSupported() : bool

Response

bool

resizeKey

Trims or zero-pads a key / IV

resizeKey(string key, int size) : null|string
inherited

Arguments

key

stringThe key or IV to treat

size

intThe block size of the currently used algorithm

Response

null|stringNull if $key is null, treated string of $size byte length otherwise

setEncryptionMode

Set the encryption mode

setEncryptionMode(string mode = 'cbc', int strength = 128) : void

Arguments

mode

stringEncryption Mode

strength

intEncryption Strength

Properties

cipherType

Cypher Type

Type(s)

string

cipherMode

Cypher Mode

Type(s)

string