AESnopad
in package
Com\Tecnick\Pdf\Encrypt\Type\AESnopad
AES no-padding
Tags
Table of Contents
Constants
- BLOCKSIZE = 16
- Block size (IV length): openssl_cipher_iv_length('aes-256-cbc')
- IVECT = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
- Initialization Vector (16 bytes)
- VALID_CIPHERS = ['aes-128-cbc', 'aes-256-cbc']
- List of valid openssl cyphers for AES encryption.
Methods
- checkCipher() : void
- Check if the cipher is valid and available.
- encrypt() : string
- Encrypt the data
Constants
BLOCKSIZE
Block size (IV length): openssl_cipher_iv_length('aes-256-cbc')
public int BLOCKSIZE = 16
IVECT
Initialization Vector (16 bytes)
public string IVECT = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
VALID_CIPHERS
List of valid openssl cyphers for AES encryption.
public array<string|int,
string> VALID_CIPHERS = ['aes-128-cbc',
'aes-256-cbc']
Methods
checkCipher()
Check if the cipher is valid and available.
public checkCipher(string $cipher)
: void
Parameters
- $cipher : string
-
openSSL cipher name.
Tags
encrypt()
Encrypt the data
public encrypt(string $data,
string $key[,
string $ivect
= self::IVECT
][,
string $mode
= 'aes-256-cbc'
]) : string
Parameters
- $data : string
-
Data string to encrypt
- $key : string
-
Encryption key
- $ivect : string = self::IVECT
-
Initialization vector
- $mode : string = 'aes-256-cbc'
-
Cipher
Return values
string —Encrypted data string.