C API for BALTECH SDK

§ brp_Crypto_EncryptBlock()

brp_errcode brp_Crypto_EncryptBlock ( brp_protocol  protocol,
unsigned  KeyIndex,
brp_buf  KeyValue,
brp_buf  Block,
brp_buf EncryptedBlock,
brp_mempool mempool 
)

This command encrypts an 8-Byte data block given in the Block parameter using the SkipJack algorithm. If KeyIndex is set to 0x00, KeyValue will be used as encryption key. Otherwise, KeyIndex is interpreted as the index of the corresponding entry in the internal key list. KeyIndex = 0x01 denotes configuration value 0x81, KeyIndex = 0x02 denotes configuration value 0x82, etc.

Parameters
[in]protocolused to execute the command
[in]KeyIndexIndex of key to use to encrypt data. KeyIndex must be set to 0x00 if a user- defined key, specified in the KeyValue parameter, should be used for encryption.
[in]KeyValueIf KeyIndex is set to 0x00, this value specifies a user-defined encryption key.
[in]BlockData block to encrypt.
[out]EncryptedBlockEncrypted data block.
[in]mempoolis used to store response data. Maybe NULL to use an internal mempool, in this case the data is only available until another command uses the internal mempool