AesCbcCryptor
extends Cryptor
in package
uses
PaddingTrait
Table of Contents
Constants
- BLOCK_SIZE = 16
- CIPHER_ALGO = 'aes-256-cbc'
- CRYPTOR_ID = 'ACRH'
- IV_LENGTH = 16
Properties
- $cipherKey : string
Methods
- __construct() : mixed
- decrypt() : mixed
- depad() : string
- Remove padding from $text using PKCS5Padding schema
- encrypt() : Payload
- getCipherKey() : string
- getIV() : string
- pad() : string
- Pad $text to multiple of $blockSize lenght using PKCS5Padding schema
- getSecret() : string
Constants
BLOCK_SIZE
public
mixed
BLOCK_SIZE
= 16
CIPHER_ALGO
public
mixed
CIPHER_ALGO
= 'aes-256-cbc'
CRYPTOR_ID
public
mixed
CRYPTOR_ID
= 'ACRH'
IV_LENGTH
public
mixed
IV_LENGTH
= 16
Properties
$cipherKey
protected
string
$cipherKey
Methods
__construct()
public
__construct(string $cipherKey) : mixed
Parameters
- $cipherKey : string
decrypt()
public
decrypt(Payload $payload[, string|null $cipherKey = null ]) : mixed
Parameters
- $payload : Payload
- $cipherKey : string|null = null
depad()
Remove padding from $text using PKCS5Padding schema
public
depad(mixed $data, int $blockSize) : string
Parameters
- $data : mixed
- $blockSize : int
Return values
stringencrypt()
public
encrypt(string $text[, string|null $cipherKey = null ]) : Payload
Parameters
- $text : string
- $cipherKey : string|null = null
Return values
PayloadgetCipherKey()
public
getCipherKey([mixed $cipherKey = null ]) : string
Parameters
- $cipherKey : mixed = null
Return values
stringgetIV()
public
getIV() : string
Return values
stringpad()
Pad $text to multiple of $blockSize lenght using PKCS5Padding schema
public
pad(string $text, int $blockSize) : string
Parameters
- $text : string
- $blockSize : int
Return values
stringgetSecret()
protected
getSecret(string $cipherKey) : string
Parameters
- $cipherKey : string