A keychain is a set of encryption rules, called keys. A key includes an algorithm, a key string, and the send/receive time. The algorithm and key string are used to encrypt and decrypt packets. The send and receive time indicate that during the period, packets are sent and received using the algorithm and key string.
A key includes an algorithm, a key string, and the send/receive time. The keychain support algorithms such as MD5, SHA-1, SHA-256, HMAC-MD5, HMAC-SHA1-12, and HMAC-SHA1-20. An application must support the algorithm configured in the keychain if the keychain is applied to the application. The key string is a string configured by users.
The active time includes the active send time and the active receive time. The device dynamically changes keys by setting the send and receive time. Keys are classified into the following types:
A MAC is a character string. The MAC is calculated from data packets and key string using the algorithm.
Keychain time has an absolute time mode and a periodic time mode.
Absolute time mode uses the Coordinated Universal Time (UTC) format.
Periodic time mode sets a specific time period during which a keychain functions. Periodic time mode includes the following types:
Only one time mode can be specified in a keychain. The time mode must be specified when the keychain is created. The send time and receive time of the key are configured based on the time mode of the keychain.
If no key is configured in a period, no send key is active in that period. Therefore, applications do not send authentication packets to each other. A default send key can be configured to prevent this situation. When no other send keys are active, the default send key takes effect.
When the send key on the device changes, the receive key on the receiving end must be changed. A delay may occur when keys change due to time asynchronization. Packets may be lost during this period. To prevent this situation, a smooth transit is needed in the receive key change. The smooth transit time is called the receive tolerance time.
The receive tolerance time only takes effect on the receive key and can be configured on each keychain. As shown in Figure 1, when the receive tolerance time is configured, the start receive time is advanced and the end receive time is delayed.
TCP applications are connected using TCP authentication. TCP uses enhanced TCP authentication options to send TCP authentication packets.