Class Cbc
- Aws\Crypto\Cipher\Cbc implements Aws\Crypto\Cipher\CipherMethod
- Namespace: Aws\Crypto\Cipher
- Deprecated
- Located at Crypto/Cipher/Cbc.php
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.
Methods Summary
- __construct ( string $iv, int $keySize = 256 )
-
getOpenSslName ( )
Returns an identifier recognizable by
openssl_*
functions, such asaes-256-cbc
oraes-128-ctr
. -
getAesName ( )
Returns an AES recognizable name, such as 'AES/GCM/NoPadding'.
-
getCurrentIv ( )
Returns the IV that should be used to initialize the next block in encrypt or decrypt.
-
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.
-
seek ( int $offset, int $whence = SEEK_SET )
Adjust the return of this::getCurrentIv to reflect a seek performed on the encryption stream using this IV object.
-
update ( string $cipherTextBlock )
Take account of the last cipher text block to adjust the return of this::getCurrentIv
Methods Details
__construct ( string $iv, integer $keySize = 256 )
Parameters
string | $iv | Base Initialization Vector for the cipher. |
integer | $keySize = 256 | Size of the encryption key, in bits, that will be used. |
Exceptions
InvalidArgumentException Thrown if the passed iv does not match the iv length required by the cipher. |
string getOpenSslName ( )
Returns an identifier recognizable by openssl_*
functions, such as
aes-256-cbc
or aes-128-ctr
.
Returns
string |
Implementation of
string getAesName ( )
Returns an AES recognizable name, such as 'AES/GCM/NoPadding'.
Returns
string |
Implementation of
string getCurrentIv ( )
Returns the IV that should be used to initialize the next block in encrypt or decrypt.
Returns
string |
Implementation of
boolean 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.
Returns
boolean |
Implementation of
seek ( integer $offset, integer $whence = SEEK_SET )
Adjust the return of this::getCurrentIv to reflect a seek performed on the encryption stream using this IV object.
Parameters
integer | $offset | |
integer | $whence = SEEK_SET |
Exceptions
LogicException Thrown if the requested seek is not supported by this IV implementation. For example, a CBC IV only supports a full rewind ($offset === 0 && $whence === SEEK_SET) |
Implementation of
update ( string $cipherTextBlock )
Take account of the last cipher text block to adjust the return of this::getCurrentIv
Parameters
string | $cipherTextBlock |
Implementation of
Constants summary
integer |
BLOCK_SIZE
|
#
16
|