Documentation

Cbc
in package
implements CipherMethod

An implementation of the CBC cipher for use with an AesEncryptingStream or AesDecrypting stream.

This cipher method is deprecated and in maintenance mode - no new updates will be released. Please see https://docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information.

Tags
deprecated

Interfaces, Classes and Traits

CipherMethod

Table of Contents

BLOCK_SIZE  = 16
$baseIv  : string
$iv  : string
$keySize  : int
__construct()  : mixed
getAesName()  : string
Returns an AES recognizable name, such as 'AES/GCM/NoPadding'.
getCurrentIv()  : string
Returns the IV that should be used to initialize the next block in encrypt or decrypt.
getOpenSslName()  : string
Returns an identifier recognizable by `openssl_*` functions, such as `aes-256-cbc` or `aes-128-ctr`.
requiresPadding()  : bool
Indicates whether the cipher method used with this IV requires padding the final block to make sure the plaintext is evenly divisible by the block size.
seek()  : mixed
Adjust the return of this::getCurrentIv to reflect a seek performed on the encryption stream using this IV object.
update()  : mixed
Take account of the last cipher text block to adjust the return of this::getCurrentIv

Constants

BLOCK_SIZE

public mixed BLOCK_SIZE = 16

Properties

$baseIv

private string $baseIv

$iv

private string $iv

$keySize

private int $keySize

Methods

__construct()

public __construct(string $iv[, int $keySize = 256 ]) : mixed
Parameters
$iv : string

Base Initialization Vector for the cipher.

$keySize : int = 256

Size of the encryption key, in bits, that will be used.

Tags
throws
InvalidArgumentException

Thrown if the passed iv does not match the iv length required by the cipher.

Return values
mixed —

getAesName()

Returns an AES recognizable name, such as 'AES/GCM/NoPadding'.

public getAesName() : string
Return values
string —

getCurrentIv()

Returns the IV that should be used to initialize the next block in encrypt or decrypt.

public getCurrentIv() : string
Return values
string —

getOpenSslName()

Returns an identifier recognizable by `openssl_*` functions, such as `aes-256-cbc` or `aes-128-ctr`.

public getOpenSslName() : string
Return values
string —

requiresPadding()

Indicates whether the cipher method used with this IV requires padding the final block to make sure the plaintext is evenly divisible by the block size.

public requiresPadding() : bool
Return values
bool —

seek()

Adjust the return of this::getCurrentIv to reflect a seek performed on the encryption stream using this IV object.

public seek(mixed $offset[, mixed $whence = SEEK_SET ]) : mixed
Parameters
$offset : mixed
$whence : mixed = SEEK_SET
Return values
mixed —

update()

Take account of the last cipher text block to adjust the return of this::getCurrentIv

public update(mixed $cipherTextBlock) : mixed
Parameters
$cipherTextBlock : mixed
Return values
mixed —

Search results