Skip to content

Length characters

tpkarras edited this page May 14, 2025 · 1 revision

Length characters are UTF-8 characters that when converted to ISO10646-1 represent the total length of bytes in the string that follows. Length characters are used to indicate the lengths for the following types of strings.

  1. GCM/CCM tag when using GCM/CCM mode.
  2. Initialization Vector if the cipher supports it.
  3. The encrypted data.

A size array is used to indicate the length of bytes of each size character. The size array is required to be created and populated before decrypting data.

More information on ISO10646-1/UTF-8 and how it works can be found here.

Depending on the framework/language version, your framework/language may have tools to convert a UTF-8 character to an ISO10646-1 integer and vice versa. If however your framework/language version does not have a tool to convert from/to UTF-8/ISO10646-1, you will have to create your own function using the information provided in the link.

Clone this wiki locally