LegacyCryptor
extends Cryptor
in package
uses
PaddingTrait
Table of Contents
Constants
- BLOCK_SIZE = 16
- CIPHER_ALGO = 'aes-256-cbc'
- CRYPTOR_ID = '0000'
- IV_LENGTH = 16
- STATIC_IV = '0123456789012345'
Properties
- $cipherKey : string
- $useRandomIV : bool
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
Constants
BLOCK_SIZE
public
mixed
BLOCK_SIZE
= 16
CIPHER_ALGO
public
mixed
CIPHER_ALGO
= 'aes-256-cbc'
CRYPTOR_ID
public
mixed
CRYPTOR_ID
= '0000'
IV_LENGTH
public
mixed
IV_LENGTH
= 16
STATIC_IV
protected
mixed
STATIC_IV
= '0123456789012345'
Properties
$cipherKey
protected
string
$cipherKey
$useRandomIV
protected
bool
$useRandomIV
Methods
__construct()
public
__construct(string $key, bool $useRandomIV) : mixed
Parameters
- $key : string
- $useRandomIV : bool
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() : string
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