Hashing and storage objects, Roblockcipher – BrightSign Object Reference Manual (FW 5.1) User Manual

Page 138

Advertising
background image

130

HASHING AND STORAGE OBJECTS

roBlockCipher

This object provides a means for symmetric block encryption. It currently supports AES and CBC ciphers, at block sizes of
128, 192, or 256 bits.

Object Creation: The roBlockCipher object is created with an associative array representing a set of parameters.

CreateObject("roBlockCipher", parameters As roAssociativeArray)

The associative array should contain the following parameters:

mode: "aes-128-cbc", "aes-192-cbc", or "aes-256-cbc"

padding: "zero" or "pkcs7". The object defaults to zero padding if this parameter is omitted.


Padding is required for inputs that are not an exact multiple of the cipher block size. Specifying "zero" will add padding
only when needed, while specifying "pkcs7" always adds padding, even if the data is already a multiple of the block size
(in this case, an entire block will be added). PKCS#7 padding is automatically removed upon decryption, and zero
padding will be retained since there are no means to unambiguously distinguish pad values from data.

Interfaces: ifBlockCipher

The ifBlockCipher interface provides the following:

SetIV(iv As Object) As Void: Sets the Initialization Vector (IV) for CBC (Cipher-Block-Chaining) modes. If
the supplied IV is shorter than required, then it will be zero padded (passing an empty string will set the vector to all

Advertising