PaddedBlockCipher class abstract

All padded block ciphers conform to this interface.

A padded block cipher is a wrapper around a BlockCipher that allows padding the last procesed block (when encrypting) in the following way:

*If it is smaller than the blockSize it will be padded to blockSize bytes. *If it is equal to the blockSize a pad block will be added.

When decrypting, a PaddedBlockCipher also removes the padding from the last cipher text block.

It is advised to use method process as it is much easier than making the correct calls to processBlock and doFinal which are different depending on whether you are encrypting or decrypting and also depending on the data length being a multiple of the cipher's block size.

Implemented types
Implementers

Constructors

PaddedBlockCipher(String algorithmName)
Create the padded block cipher specified by the standard algorithmName.
factory

Properties

algorithmName String
Get this algorithm's standard name.
no setterinherited
blockSize int
Get this ciphers's block size.
no setterinherited
cipher BlockCipher
Get the underlying BlockCipher used by this cipher.
no setter
hashCode int
The hash code for this object.
no setterinherited
padding Padding
Get the underlying Padding used by this cipher.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

doFinal(Uint8List inp, int inpOff, Uint8List out, int outOff) int
Process the last block of data given by inp and starting at offset inpOff and pad it as explained in this interface's description.
init(bool forEncryption, CipherParameters? params) → void
Init the cipher with its initialization params. The type of CipherParameters depends on the algorithm being used (see the documentation of each implementation to find out more).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process(Uint8List data) Uint8List
Process a whole block of data at once, returning the result in a byte array.
override
processBlock(Uint8List inp, int inpOff, Uint8List out, int outOff) int
Process a whole block of data given by inp and starting at offset inpOff.
inherited
reset() → void
Reset the cipher to its original state.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited