Crypto.BalKeyEncryptBuffer

This command is a special version of the Crypto.EncryptBuffer command which always uses a customer key to encrypt a buffer of data and inserts a Crypto-Key at a desired position before encryption.

The key to insert has to be specified in the EmbeddedKeyIndex parameter. In this case, the 10 Byte Key will, on the one hand, replace the data at the EmbeddedKeyPos position, and on the other hand, replace the last two Bytes by a CRC (16-bit, 8404B, MSB encoded) that is generated on the data contained in Buffer.

Properties

Parameters (request frame)

Name Type/Size Description
KeyVersion Integer (8 bits) 2: use SkipJack Key, 3: Use AES Key.
EmbeddedKeyIndex Integer (8 bits) Index of the embedded key to insert in the data (value != 0x00). No key is inserted when this parameter is set to 0x00.
EmbeddedKeyPos Integer (8 bits) If an embedded key is specified, this value specifies the position where to include the key.
Length of Buffer Integer (8 bits) Length of Buffer in bytes
Buffer Raw data Data buffer to encrypt.
Length of InitialVector Integer (8 bits) Length of InitialVector in bytes
InitialVector Raw data Initial vector (IV) used for encryption.

Returned values (response frame)

Name Type/Size Description
Length of EncryptedBuffer Integer (8 bits) Length of EncryptedBuffer in bytes
EncryptedBuffer Raw data Buffer after encryption.
Length of NextInitialVector Integer (8 bits) Length of NextInitialVector in bytes
NextInitialVector Raw data Initial vector to be used as InitialVector parameter in the next call of this command.