classes-Com-Tecnick-Pdf-Encrypt-Type-AESnopad

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

AESnopad

in package

Com\Tecnick\Pdf\Encrypt\Type\AESnopad

AES no-padding

Tags
since
2011-05-23
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2011-2024 Nicola Asuni - Tecnick.com LTD

license

http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)

link
https://github.com/tecnickcom/tc-lib-pdf-encrypt

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
throws
Exception

in case of error.

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.

On this page
 

© 2004-2024 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy