﻿<?xml version='1.0' encoding='utf-8'?>
<rfc version="3" ipr="trust200902" docName="draft-pq-secchannel-00" submissionType="IETF" category="info" xml:lang="en" indexInclude="true">

<front>
<title abbrev="PQ-SecChannel">PQ-SecChannel Protocol Specification</title><seriesInfo value="draft-pq-secchannel-00" stream="IETF" status="informational" name="Internet-Draft" />
<author initials="K." surname="Fan" fullname="Kai Fan"><organization>Xidian University</organization><address><postal><city>Xi'an</city><region>Shaanxi</region><country>China</country>
</postal><email>kfan@mail.xidian.edu.cn</email>
</address></author><author initials="R." surname="Su" fullname="Ruidan Su"><organization>Xidian University</organization><address><postal><city>Xi'an</city><region>Shaanxi</region><country>China</country>
</postal><email>rdsu@xidian.edu.cn</email>
</address></author><author initials="X." surname="Ma" fullname="Xuyang Ma"><organization>Xidian University</organization><address><postal><city>Xi'an</city><region>Shaanxi</region><country>China</country>
</postal><email>24151213690@stu.xidian.edu.cn</email>
</address></author><author initials="R." surname="Yang" fullname="Ruiqi Yang"><organization>Xidian University</organization><address><postal><city>Xi'an</city><region>Shaanxi</region><country>China</country>
</postal><email>yrq@stu.xidian.edu.cn</email>
</address></author><date year="2026" month="August" day="13" />
<area>Internet</area>
<workgroup />
<keyword>PQ-SecChannel</keyword>
<keyword>post-quantum</keyword>
<keyword>cryptography</keyword>

<abstract>
<t>This document specifies the PQ-SecChannel cryptographic protocol, which defines a secure interactive channel consisting of a Transport Authentication Protocol and a Connection Protocol. The protocol is designed to provide confidentiality, integrity, and mutual authentication in the presence of quantum computing threats.
PQ-SecChannel incorporates standardized post-quantum cryptographic algorithms, including lattice-based KEMs and signatures (e.g., Kyber and Dilithium), Chinese post-quantum candidate algorithms (e.g., Aigis), and code-based KEMs (e.g., HQC), together with SM4-GCM for AEAD (Authenticated Encryption with Associated Data) and SM3 for hashing and key derivation.
This specification is derived from the Chinese national cryptography standard draft "PQ-SecChannel Cryptographic Protocol Specification", adapted into IETF Internet-Draft style for international review and potential interoperability consideration. The protocol content also references the Secure Shell architecture (<xref target="RFC4251"/>, <xref target="RFC4252"/>, <xref target="RFC4253"/>, and <xref target="RFC4254"/>) and the Chinese SSH cryptographic protocol specification <xref target="GMT0129"/>.</t>
</abstract>

</front>

<middle>

<section anchor="sec-1-introduction"><name>Introduction</name>
<t>PQ-SecChannel is a protocol suite composed of a Transport Authentication Protocol and a Connection Protocol. It aims to provide quantum-resistant secure network services over unreliable or untrusted networks. The protocol is applicable not only to traditional TCP connections, but also to other reliable byte streams, enabling secure applications such as sftp and scp.</t>
<t>This document specifies the PQ-SecChannel secure interactive cryptographic protocol, including the encrypted Transport Authentication Protocol, the Connection Protocol, and the methods for using cryptographic algorithms within the protocol. It is applicable to the development and testing of PQ-SecChannel server and client products.</t>
<t>This document defines the two core components of PQ-SecChannel:</t>
<t>1.The Transport Authentication Protocol, which establishes a secure communication channel, performs mutual authentication of the server and client users, and provides confidentiality and integrity protection.</t>
<t>2.The Connection Protocol, which multiplexes the encrypted channel into multiple logical channels and provides services such as interactive login sessions, remote command execution, and TCP/IP and X11 forwarding.</t>
</section>

<section anchor="sec-2-conventions-and-terminology"><name>Conventions and Terminology</name>
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals.</t>
<t>Additional terms and abbreviations used in this document :</t>

<ul>
<li><t>CR: Carriage Return.</t>
</li>
<li><t>LF: Line Feed.</t>
</li>
<li><t>SP: Space character.</t>
</li>
<li><t>LZ77: A general-purpose data compression algorithm (Lempel-Ziv 77).</t>
</li>
<li><t>UTF-8: 8-bit Unicode Transformation Format.</t>
</li>
<li><t>KEM: Key Encapsulation Mechanism.</t>
</li>
<li><t>IV: Initialization Vector.</t>
</li>
<li><t>MAC: Message Authentication Code.</t>
</li>
<li><t>PKI: Public Key Infrastructure.</t>
</li>
<li><t>PQ-SecChannel: Post-Quantum Secure Channel (secure interactive protocol).</t>
</li>
<li><t>HASH: The negotiated cryptographic hash function (SM3 in this specification).</t>
</li>
</ul>
<t>All multi-byte integers are transmitted in network byte order (big-endian). Algorithm identifiers used in this document MUST conform to GB/T 33560 <xref target="GBT33560"/>. Terminology defined in GM/Z 4001 <xref target="GMZ4001"/> applies to this document.</t>
<t>Basic data types used in this document are as follows:</t>

<ul>
<li><t>int8 / uint8 / byte: 1-byte signed / unsigned integer.</t>
</li>
<li><t>uint32 / uint64: 4-byte / 8-byte unsigned integer.</t>
</li>
<li><t>bool: Boolean value (1 = TRUE, 0 = FALSE).</t>
</li>
<li><t>string: Arbitrary-length binary string, preceded by a uint32 length; length 0 denotes an empty string.</t>
</li>
<li><t>mpint: Multiple-precision integer in two's complement form, stored as a string.</t>
</li>
<li><t>name-list: A string containing a comma-separated list of ASCII names.</t>
</li>
</ul>
</section>

<section anchor="sec-3-protocol-overview"><name>Protocol Overview</name>

<section anchor="sec-3-1-protocol-layers"><name>Protocol Layers</name>
<t>PQ-SecChannel operates as a two-layer protocol suite:</t>

<ol>
<li><t>Transport Authentication Protocol: The foundation of PQ-SecChannel. It establishes a secure communication channel and authenticates both communicating parties, ensuring confidentiality, integrity, and authenticity of data in transit. It supports multiple post-quantum algorithms, including lattice-based encryption (e.g., Kyber), lattice-based signatures (e.g., Dilithium), and Chinese post-quantum candidates (e.g., Aigis). The protocol may run over TCP or other reliable data streams. It uses PKI-based authentication and a strict algorithm negotiation mechanism so that both parties select the strongest mutually supported algorithms.</t>
</li>
<li><t>Connection Protocol: Runs above the Transport Authentication Protocol. It multiplexes the encrypted channel into multiple logical channels and provides network services such as interactive shells and port forwarding. All data transfer and service requests on this layer are protected by the keys and algorithms established by the transport layer.</t>
</li>
</ol>
</section>

<section anchor="sec-3-2-threat-model"><name>Threat Model</name>
<t>PQ-SecChannel is designed to resist:</t>

<ul>
<li><t>Eavesdropping (confidentiality)</t>
</li>
<li><t>Message tampering (integrity)</t>
</li>
<li><t>Man-in-the-middle attacks (mutual authentication)</t>
</li>
<li><t>Quantum adversaries capable of breaking classical public-key cryptography</t>
</li>
</ul>
<t>It assumes a reliable underlying transport (e.g., TCP) and does not provide comprehensive protection against denial-of-service attacks. The protocol assumes that long-term private keys are protected and that certificate validation is performed according to PKI practices.</t>
</section>
</section>

<section anchor="sec-4-transport-authentication-protocol"><name>Transport Authentication Protocol</name>

<section anchor="sec-4-1-protocol-overview"><name>Protocol Overview</name>
<t>The Transport Authentication Protocol runs over TCP/IP or another reliable byte stream and may serve as the foundation for multiple secure network services. It provides encryption, mutual authentication between server and client, integrity protection via AEAD, and optional compression. Key exchange methods, cipher algorithms, and hash algorithms are all negotiated. Because SM4-GCM (AEAD) is used, a separate MAC algorithm is not negotiated or applied.</t>
<t>The server SHOULD configure an authentication timeout. If the client fails to complete authentication within the configured time, the connection SHOULD be closed. The RECOMMENDED timeout is 10 minutes, and it MUST NOT exceed 30 minutes. The server SHOULD limit the number of authentication attempts by a client within one session. When a client fails authentication more than 20 consecutive times, the server SHOULD disconnect.</t>
<t>The transport-layer connection is initiated by the client. Communication uses predefined message numbers, including but not limited to:</t>
<t>PQ-SecChannel_MSG_DISCONNECT</t>
<t>PQ-SecChannel_MSG_SERVICE_REQUEST</t>
<t>PQ-SecChannel_MSG_SERVICE_ACCEPT</t>
<t>PQ-SecChannel_MSG_KEXAUTH_INIT</t>
<t>PQ-SecChannel_MSG_NEWKEYS_AUTH_SUCCESS</t>
<t>PQ-SecChannel_MSG_KEX_AUTH_REQUEST</t>
<t>PQ-SecChannel_MSG_KEX_AUTH_REPLY</t>
<t>PQ-SecChannel_MSG_KEX_AUTH</t>
<t>A typical message flow is: version exchange; mutual PQ-SecChannel_MSG_KEXAUTH_INIT; PQ-SecChannel_MSG_KEX_AUTH_REQUEST / REPLY / AUTH; mutual PQ-SecChannel_MSG_NEWKEYS_AUTH_SUCCESS; then PQ-SecChannel_MSG_SERVICE_REQUEST / ACCEPT.</t>
</section>

<section anchor="sec-4-2-version-exchange"><name>Version Exchange</name>
<t>This document defines transport-layer protocol version 1.0. After the network connection is established, both parties MUST send a version identification string in the following format:</t>
<t>CPQ-SecChannel-&lt;protoversion&gt;-&lt;softwareversion&gt;[SP &lt;comments&gt;]&lt;CR&gt;&lt;LF&gt;</t>
<t>Example:</t>
<t>CPQ-SecChannel-1.0-MyPQ-SecChannel3.3 This is comment&lt;CR&gt;&lt;LF&gt;</t>
<t>Where:</t>

<ul>
<li><t>CPQ-SecChannel is the short name used by this specification.</t>
</li>
<li><t>&lt;protoversion&gt;: MUST be "1.0" for this specification.</t>
</li>
<li><t>&lt;softwareversion&gt;: implementation-defined software name and version; MUST NOT contain SP or hyphen ("-").</t>
</li>
<li><t>&lt;comments&gt;: optional. If present, it MUST be separated from &lt;softwareversion&gt; by SP.</t>
</li>
<li><t>Character set: printable US-ASCII; maximum length 255 bytes including &lt;CR&gt;&lt;LF&gt;.</t>
</li>
</ul>
<t>The server MAY send additional UTF-8 lines terminated by &lt;CR&gt;&lt;LF&gt; before its version string (e.g., to display an error before disconnect). Clients MUST be able to process these lines and MAY ignore them or display them to the user. Key exchange begins immediately after the version identification strings are exchanged.</t>
</section>

<section anchor="sec-4-3-algorithm-negotiation"><name>Algorithm Negotiation</name>
<t>After version exchange, both parties send a PQ-SecChannel_MSG_KEXAUTH_INIT message containing lists of supported algorithms. The first name in each list is the preferred algorithm. Each party selects the first algorithm that also appears in the peer's list.</t>
<t>The PQ-SecChannel_MSG_KEXAUTH_INIT payload format is:</t>
<t>Field Type</t>
<t>PQ-SecChannel_MSG_KEXAUTH_INIT byte</t>
<t>cookie byte[16]</t>
<t>kex_algorithms name-list</t>
<t>server_host_key_algorithms name-list</t>
<t>encryption_algorithms_client_to_server name-list</t>
<t>encryption_algorithms_server_to_client name-list</t>
<t>compression_algorithms_client_to_server name-list</t>
<t>compression_algorithms_server_to_client name-list</t>
<t>languages_client_to_server name-list</t>
<t>languages_server_to_client name-list</t>
<t>first_kex_packet_follows bool</t>
<t>reserved uint32</t>

<ul>
<li><t>cookie: 16-byte random value generated by the sender so that neither party alone can fully determine the final keying material.</t>
</li>
<li><t>kex_algorithms: Key encapsulation algorithms. Supported values include "kyber" (and may include additional KEMs such as aigis-enc and hqc as negotiated).</t>
</li>
<li><t>server_host_key_algorithms: Host-key / signature algorithms used for authentication (e.g., Dilithium).</t>
</li>
<li><t>encryption_algorithms_*: Symmetric encryption algorithms (see Cryptographic Algorithms). SM4-GCM is REQUIRED.</t>
</li>
<li><t>compression_algorithms_*: Compression algorithms.</t>
</li>
<li><t>languages_*: Language tags; SHOULD be empty unless language negotiation is required.</t>
</li>
<li><t>first_kex_packet_follows: TRUE if a guessed key-exchange packet follows; otherwise FALSE.</t>
</li>
<li><t>reserved: MUST be set to 0 and reserved for future use.</t>
</li>
</ul>
<t>After PQ-SecChannel_MSG_KEXAUTH_INIT is exchanged, key agreement and authentication proceed according to the negotiated algorithms and MAY require additional packet exchanges.</t>
</section>

<section anchor="sec-4-4-key-exchange-and-authentication"><name>Key Exchange and Authentication</name>
<t>Key agreement defines how session keys for encryption and authentication are generated and how the server and client mutually authenticate. After algorithm agreement, both parties compute session keys and use them to protect subsequent packets.</t>

<ol spacing="compact">
<li>Client sends:</li>
</ol>
<t>PQ-SecChannel_MSG_KEX_AUTH_REQUEST || user_name || random_client</t>
<t>where random_client is an 8-byte random value.</t>

<ol spacing="compact" start="2">
<li>Server responds:</li>
</ol>
<t>PQ-SecChannel_MSG_KEX_AUTH_REPLY || challenge || server_sign_cert ||</t>
<t>server_enc_cert || random_server || sign</t>
<t>challenge is a server authentication parameter; server_sign_cert and</t>
<t>server_enc_cert are string-encoded server signature and encryption</t>
<t>certificates. sign is a signature under the server signature private</t>
<t>key over the following concatenation (in order):</t>
<t>user_name || random_client || random_server ||</t>
<t>public_key_algorithm_name || server_sign_cert || server_enc_cert</t>

<ol spacing="compact" start="3">
<li>After verifying the server signature and certificates, the client</li>
</ol>
<t>generates a 32-byte random shared secret K, encapsulates it under the</t>
<t>server encryption-certificate public key to obtain ciphertext ct, and</t>
<t>sends:</t>
<t>PQ-SecChannel_MSG_KEX_AUTH || response || public_key_algorithm ||</t>
<t>client_sign_cert || ct</t>
<t>where public_key_algorithm_name is "Dilithium", and response is a</t>
<t>signedData value produced with the client signature private key over:</t>
<t>user_name || public_key_algorithm_name || client_sign_cert || ct</t>

<ol spacing="compact" start="4">
<li>The server verifies the client signature and certificate, then</li>
</ol>
<t>decapsulates ct to recover K.</t>

<ol spacing="compact" start="5">
<li>After successful authentication, both sides compute the session hash:</li>
</ol>
<t>H = HASH(random_client || random_server || certificate || K)</t>
<t>Key agreement produces a shared secret K and a session hash H. The first exchange hash H of a connection is also used as the session_id. Once established, session_id MUST NOT change until the connection is closed.</t>
<t>Authentication Failure</t>
<t>If the server rejects authentication, it sends:</t>
<t>PQ-SecChannel_MSG_USERAUTH_FAILURE || partial_success(bool)</t>
<t>Based on supported authentication methods, authentication_that_can_continue is "certificate". If the server disconnects after failure, partial_success is FALSE; otherwise TRUE. Whether to disconnect depends on server policy and client behavior (e.g., repeated failures within the timeout).</t>
<t>Authentication Success</t>
<t>On success, the server sends:</t>
<t>PQ-SecChannel_MSG_USERAUTH_SUCCESS || prompt(string)</t>
<t>The client MAY send multiple authentication requests without waiting for prior responses. The server MUST process each request completely and, for failures, send PQ-SecChannel_MSG_USERAUTH_FAILURE before continuing. After PQ-SecChannel_MSG_USERAUTH_SUCCESS, further authentication requests MUST be ignored; other requests are passed to upper-layer protocols, and the requested service SHOULD be started.</t>
<t>Authentication Banner</t>
<t>At any time from request until success, the server MAY send:</t>
<t>PQ-SecChannel_MSG_USERAUTH_BANNER || message(UTF-8 string)</t>
<t>The client SHOULD display message (which MAY contain multiple lines separated by &lt;CR&gt;&lt;LF&gt;) and MAY ignore it. Banner messages MAY be used for errors or operational guidance.</t>
</section>

<section anchor="sec-4-5-message-packet-format"><name>Message Packet Format</name>
<t>After the version identification strings are exchanged, all subsequent data uses the following packet format:</t>
<t>Field Type</t>
<t>packet_length uint32</t>
<t>padding_length byte</t>
<t>payload byte[n1]</t>
<t>padding byte[n2]</t>
<t>Where:</t>

<ul>
<li><t>packet_length: length in bytes of the packet, excluding packet_length itself.</t>
</li>
<li><t>padding_length: length of padding in bytes.</t>
</li>
<li><t>n1 = packet_length - padding_length - 1; payload MAY be compressed if compression was negotiated.</t>
</li>
<li><t>n2 = padding_length. Padding MUST be random, at least 4 bytes and at most 255 bytes, such that packet_length || padding_length || payload || padding is a multiple of the cipher block length. This protocol uses SM4-GCM.</t>
</li>
<li><t>Because SM4-GCM provides authenticated encryption, a separate mac field is NOT used and MUST NOT be present in data packets.</t>
</li>
</ul>
<t>Clients and servers MUST be able to process packets whose uncompressed payload is 2^16 bytes or less.</t>
</section>

<section anchor="sec-4-6-data-encryption-and-integrity"><name>Data Encryption and Integrity</name>
<t>When encryption is in effect, packet_length, padding_length, payload, and padding MUST be encrypted with the negotiated algorithm and session key.</t>
<t>Encryption algorithms:</t>

<ul spacing="compact">
<li>SM4-GCM: REQUIRED. SM4 block cipher in GCM mode (AEAD).</li>
</ul>
<t>Integrity:</t>
<t>Integrity and authenticity of each packet are provided by the AEAD tag of SM4-GCM. A separate MAC algorithm and mac field are not used because SM4-GCM already provides integrity (cf. GB/T 15852.1 <xref target="GBT15852"/>).</t>
<t>The packet sequence number is a uint32 maintained independently by each side (starting at 0, wrapping after the maximum uint32 value). The sequence number is not transmitted in the packet and MUST be authenticated as Additional Authenticated Data (AAD) in the AEAD operation.</t>
<t>AEAD modes (SM4-GCM) MUST authenticate the packet sequence number as associated data.</t>
</section>

<section anchor="sec-4-7-compression"><name>Compression</name>
<t>If compression is negotiated, the payload is compressed with the negotiated algorithm before encryption. packet_length is computed over the compressed payload. Server and client MAY use different compression algorithms.</t>
<t>Supported algorithms:</t>

<ul>
<li><t>zlib: LZ77 compression (OPTIONAL)</t>
</li>
<li><t>none: No compression (OPTIONAL)</t>
</li>
</ul>
</section>

<section anchor="sec-4-8-public-key-and-certificate-format"><name>Public Key and Certificate Format</name>

<ul>
<li><t>Public keys: Encoded per GB/T 43207 <xref target="GBT43207"/> and transmitted using Base64.</t>
</li>
<li><t>Certificates: Format per GM/T 0014 <xref target="GMT0014"/> and transmitted using Base64. Certificate validation MUST follow PKI practices.</t>
</li>
</ul>
</section>

<section anchor="sec-4-9-session-key-derivation"><name>Session Key Derivation</name>
<t>Using shared secret K and session hash H, derive:</t>

<ul>
<li><t>Client-to-Server IV: HASH(K || H || "A" || session_id)</t>
</li>
<li><t>Server-to-Client IV: HASH(K || H || "B" || session_id)</t>
</li>
<li><t>Client-to-Server Enc Key: HASH(K || H || "C" || session_id)</t>
</li>
<li><t>Server-to-Client Enc Key: HASH(K || H || "D" || session_id)</t>
</li>
</ul>
<t>K is encoded as an mpint, the label ("A" through "D") is a single byte, and session_id is the original first exchange hash H. Keys are truncated to the required length for SM4-GCM. In this specification, HASH is SM3. Separate MAC keys are not derived because SM4-GCM provides integrity protection.</t>
</section>

<section anchor="sec-4-10-key-delivery-and-re-exchange"><name>Key Delivery and Re-Exchange</name>
<t>Key agreement ends when both parties have sent PQ-SecChannel_MSG_NEWKEYS_AUTH_SUCCESS. That message is protected with the old keys and algorithms. All messages sent after it MUST use the new keys and algorithms.</t>
<t>Except while a key exchange is already in progress, sending PQ-SecChannel_MSG_KEXINIT begins re-keying. Upon receiving PQ-SecChannel_MSG_KEXINIT, a party MUST respond with its own PQ-SecChannel_MSG_KEXINIT. Re-keying uses the previous session keys and algorithms until completion. Encryption and compression algorithms do not change until re-keying finishes. Processing is the same as the initial exchange except that session_id is preserved. Some or all algorithms and the server certificate MAY change. All keys and IVs are recomputed, and compression/encryption contexts are reset.</t>
<t>Re-keying SHOULD occur after 1 GB of data or 1 hour of connection time, whichever comes first. It MUST occur before 100 GB or 24 hours, whichever comes first. Application data MAY continue after PQ-SecChannel_MSG_NEWKEYS_AUTH_SUCCESS. Key exchange does not affect protocols above the transport layer.</t>
</section>

<section anchor="sec-4-11-service-request-and-acceptance"><name>Service Request and Acceptance</name>
<t>After key agreement, the client MAY request a service identified by name:</t>
<t>PQ-SecChannel_MSG_SERVICE_REQUEST || service_name</t>
<t>If the server rejects the request, it MAY send PQ-SecChannel_MSG_DISCONNECT and close the connection. If the server supports and permits the service, it MUST respond:</t>
<t>PQ-SecChannel_MSG_SERVICE_ACCEPT || service_name</t>
<t>The Connection Protocol service_name is "PQ-SecChannel". Other services (e.g., "sftp", "scp") MAY be defined in extensions.</t>
</section>

<section anchor="sec-4-12-disconnect"><name>Disconnect</name>
<t>At any stage, either party MAY send a disconnect packet:</t>
<t>PQ-SecChannel_MSG_DISCONNECT || reason_code(uint32) || description(UTF-8)</t>
<t>Defined reason_code values:</t>

<ul>
<li><t>1: Server refused connection</t>
</li>
<li><t>2: Protocol error</t>
</li>
<li><t>3: Key exchange failed</t>
</li>
<li><t>4: Reserved</t>
</li>
<li><t>5: MAC error</t>
</li>
<li><t>6: Compression / decompression error</t>
</li>
<li><t>7: Service not available</t>
</li>
<li><t>8: Protocol version not supported</t>
</li>
<li><t>9: Host key not present</t>
</li>
<li><t>10: Connection lost</t>
</li>
<li><t>11: Application-specific reason</t>
</li>
<li><t>12: Too many connections</t>
</li>
<li><t>13: User canceled authentication</t>
</li>
<li><t>14: Authentication method not supported</t>
</li>
<li><t>15: Illegal user name</t>
</li>
</ul>
<t>After sending or receiving this message, the connection SHOULD be closed.</t>
</section>
</section>

<section anchor="sec-5-connection-protocol"><name>Connection Protocol</name>

<section anchor="sec-5-1-channel-multiplexing"><name>Channel Multiplexing</name>
<t>The Connection Protocol runs over the authenticated transport layer. It provides interactive login sessions, remote command execution, TCP/IP forwarding, and X11 forwarding. The service_name is "PQ-SecChannel".</t>
<t>Message numbers used by the Connection Protocol include:</t>
<t>PQ-SecChannel_MSG_GLOBAL_REQUEST</t>
<t>PQ-SecChannel_MSG_REQUEST_SUCCESS</t>
<t>PQ-SecChannel_MSG_REQUEST_FAILURE</t>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN</t>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN_CONFIRMATION</t>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN_FAILURE</t>
<t>PQ-SecChannel_MSG_CHANNEL_WINDOW_ADJUST</t>
<t>PQ-SecChannel_MSG_CHANNEL_DATA</t>
<t>PQ-SecChannel_MSG_CHANNEL_EOF</t>
<t>PQ-SecChannel_MSG_CHANNEL_CLOSE</t>
<t>A connection channel represents a login session or forwarded connection. Both server and client MAY open channels. Multiple channels are multiplexed over one connection. Channels are identified by channel numbers that MAY differ at each endpoint. When opening a channel, the sender provides its local channel number; subsequent packets carry the recipient's channel number.</t>
</section>

<section anchor="sec-5-2-channel-management"><name>Channel Management</name>

<ul spacing="compact">
<li>Open Channel:</li>
</ul>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN || channel_type(ASCII string) ||</t>
<t>sender_channel_id(uint32) || initial_window_size(uint32) ||</t>
<t>maximum_packet_size(uint32)</t>

<ul spacing="compact">
<li>Open Confirmation:</li>
</ul>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN_CONFIRMATION ||</t>
<t>recipient_channel_id(uint32) || sender_channel_id(uint32) ||</t>
<t>initial_window_size(uint32) || maximum_packet_size(uint32)</t>

<ul spacing="compact">
<li>Open Failure:</li>
</ul>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN_FAILURE ||</t>
<t>recipient_channel_id(uint32) || reason(uint32) ||</t>
<t>description(UTF-8) || language(tag)</t>
<t>reason values:</t>

<ul>
<li><t>PQ-SecChannel_OPEN_ADMINISTRATIVELY_PROHIBITED</t>
</li>
<li><t>PQ-SecChannel_OPEN_CONNECT_FAILED</t>
</li>
<li><t>PQ-SecChannel_OPEN_UNKNOWN_CHANNEL_TYPE</t>
</li>
<li><t>PQ-SecChannel_OPEN_RESOURCE_SHORTAGE</t>
</li>
</ul>
</section>

<section anchor="sec-5-3-data-flow-control"><name>Data Flow Control</name>
<t>The amount of data that may be sent is governed by a window. Parties use window-adjust messages to increase the maximum transferable amount. The window size MUST NOT exceed the range of uint32.</t>

<ul spacing="compact">
<li>Window Adjustment:</li>
</ul>
<t>PQ-SecChannel_MSG_CHANNEL_WINDOW_ADJUST ||</t>
<t>recipient_channel_id(uint32) || size(uint32)</t>

<ul spacing="compact">
<li>Data Transmission:</li>
</ul>
<t>PQ-SecChannel_MSG_CHANNEL_DATA ||</t>
<t>recipient_channel_id(uint32) || data(string)</t>

<ul spacing="compact">
<li>EOF:</li>
</ul>
<t>PQ-SecChannel_MSG_CHANNEL_EOF || recipient_channel_id(uint32)</t>
<t>Sent when a party will send no more data on the channel. The recipient NEED NOT reply, or MAY reply with the same message.</t>

<ul spacing="compact">
<li>Close:</li>
</ul>
<t>PQ-SecChannel_MSG_CHANNEL_CLOSE || recipient_channel_id(uint32)</t>
<t>Either party MAY close a channel. The recipient NEED NOT reply.</t>
<t>Flow control uses a credit-based window. The initial window size is implementation-defined.</t>
</section>
</section>

<section anchor="sec-6-cryptographic-algorithms"><name>Cryptographic Algorithms</name>

<section anchor="sec-6-1-asymmetric-algorithms"><name>Asymmetric Algorithms</name>
<t>PQ-SecChannel uses Kyber and Dilithium as primary asymmetric algorithms for post-quantum identity authentication, key exchange, and data signatures.</t>

<ul>
<li><t>Kyber: A lattice-based KEM used to exchange session keys securely. A public/private key pair is generated; the public key encapsulates shared secrets and the private key decapsulates them.</t>
</li>
<li><t>Dilithium: A lattice-based digital signature algorithm used to verify message integrity and sender identity.</t>
</li>
</ul>
<t>Supplemental candidate algorithms:</t>

<ul>
<li><t>Aigis-enc / Aigis-sign: Chinese post-quantum candidates based on (M)LWE and (M)SIS. Aigis-enc is an efficient KEM; Aigis-sign is a compact signature scheme with smaller public keys, ciphertexts, and signatures than Kyber/Dilithium in some parameter sets, suitable for constrained environments.</t>
</li>
<li><t>HQC (Hamming Quasi-Cyclic): A code-based KEM whose security relies on decoding under Hamming weight. As a NIST alternate candidate, HQC offers very small public keys and is suitable for bandwidth-constrained scenarios, at the cost of larger ciphertexts and somewhat lower performance.</t>
</li>
</ul>
</section>

<section anchor="sec-6-2-symmetric-algorithms"><name>Symmetric Algorithms</name>
<t>PQ-SecChannel uses SM4-GCM as the symmetric AEAD cipher for protecting key-exchange and application data. Implementations MUST use key lengths that provide adequate resistance against Grover's algorithm (RECOMMENDED: 256-bit effective symmetric strength where applicable).</t>

<ul spacing="compact">
<li>SM4-GCM: REQUIRED</li>
</ul>
</section>

<section anchor="sec-6-3-hash-function"><name>Hash Function</name>

<ul spacing="compact">
<li>SM3: REQUIRED for hashing, integrity checks, and key derivation (256-bit output).</li>
</ul>
</section>

<section anchor="sec-6-4-key-types"><name>Key Types</name>
<t>Server Keys</t>
<t>Server keys are asymmetric key pairs that MUST be quantum-resistant, including a signature key pair and an encapsulation (encryption) key pair.</t>

<ul>
<li><t>Signature key pair: Generated by the server cryptographic module, RECOMMENDED to use Dilithium. The public key MAY be embedded in a certificate issued by a CA for client verification of server identity.</t>
</li>
<li><t>Encapsulation key pair: Used for key exchange authentication and data protection, using Kyber as the KEM. The encapsulation public key is also embedded in a CA-issued certificate.</t>
</li>
</ul>
<t>Client Keys</t>
<t>Client keys are asymmetric signature key pairs that MUST be quantum-resistant. The signature key pair is generated by the client cryptographic module, RECOMMENDED to use Dilithium. The client public key MAY be embedded in a CA-issued certificate for server verification of client identity.</t>
<t>Transport-Layer Session Keys</t>
<t>Transport-layer session keys are symmetric keys used to encrypt and decrypt communication data, ensuring confidentiality and integrity in transit. Session keys are jointly established by the server and client as specified in Session Key Derivation.</t>
</section>
</section>

<section anchor="sec-7-security-considerations"><name>Security Considerations</name>

<section anchor="sec-7-1-quantum-resistance"><name>Quantum Resistance</name>
<t>The core security objective of PQ-SecChannel is to resist threats from large-scale quantum computers, including Shor's algorithm against classical public-key cryptosystems and Grover's algorithm against symmetric search.</t>
<t>Asymmetric cryptography in this protocol relies on PQC problems believed to be hard for both classical and quantum adversaries (Module-LWE / Module-SIS for Kyber, Dilithium, and Aigis; coding problems for HQC). Symmetric cryptography mandates 256-bit keys so that Grover search remains at approximately 2^128 work. Quantum resistance is knowledge-relative; long-term security depends on ongoing cryptanalysis and the ability to update algorithms.</t>
</section>

<section anchor="sec-7-2-forward-secrecy"><name>Forward Secrecy</name>
<t>PQ-SecChannel provides forward secrecy through ephemeral key exchange. Each key exchange (initial and re-keying) derives session key material from freshly generated values (including the 32-byte secret K encapsulated under the server encryption public key). Even if long-term identity private keys are later compromised, past session keys cannot be recovered if ephemeral secrets were securely discarded.</t>
</section>

<section anchor="sec-7-3-authentication-and-identity-binding"><name>Authentication and Identity Binding</name>
<t>Server and client identities are bound to public keys via digital certificates issued by trusted CAs or otherwise provisioned through trusted channels. Implementations MUST perform full certificate chain validation during key exchange, including signature validity, validity period, key usage, and identity matching (Subject / SAN). Implementations SHOULD support OCSP or CRL revocation checking; in high-security environments, revocation checking MUST be enabled.</t>
</section>

<section anchor="sec-7-4-replay-and-mitm-protection"><name>Replay and MitM Protection</name>

<ul>
<li><t>Cookie randomness in PQ-SecChannel_MSG_KEXAUTH_INIT prevents trivial replay of prior handshake messages.</t>
</li>
<li><t>Session keys depend on random_client, random_server, certificates, and K, ensuring per-session freshness.</t>
</li>
<li><t>Mutual signatures over algorithm- and identity-binding fields prevent undetected MitM and downgrade attacks.</t>
</li>
<li><t>Authentication timeouts and attempt limits mitigate online guessing and stalled handshake abuse.</t>
</li>
</ul>
</section>

<section anchor="sec-7-5-side-channel-resistance"><name>Side-Channel Resistance</name>
<t>Implementations MUST defend against side-channel attacks. Operations that depend on secret data (KEM encapsulate/decapsulate and signature generation/verification) MUST be constant-time. Implementers SHOULD use well-audited cryptographic libraries with side-channel countermeasures.</t>
</section>
</section>

<section anchor="sec-8-iana-considerations"><name>IANA Considerations</name>

<section anchor="sec-8-1-registration-of-protocol-identifier"><name>Registration of Protocol Identifier</name>
<t>IANA is requested to register "PQ-SecChannel" as a service name / transport protocol identifier in the "Service Name and Transport Protocol Port Number Registry", with default port TBD.</t>
</section>

<section anchor="sec-8-2-new-message-numbers"><name>New Message Numbers</name>
<t>IANA is requested to allocate message numbers for the following messages:</t>
<t>Message Name Value</t>
<t>PQ-SecChannel_MSG_DISCONNECT XX</t>
<t>PQ-SecChannel_MSG_SERVICE_REQUEST XX</t>
<t>PQ-SecChannel_MSG_SERVICE_ACCEPT XX</t>
<t>PQ-SecChannel_MSG_KEXAUTH_INIT XX</t>
<t>PQ-SecChannel_MSG_NEWKEYS_AUTH_SUCCESS XX</t>
<t>PQ-SecChannel_MSG_KEX_AUTH_REQUEST XX</t>
<t>PQ-SecChannel_MSG_KEX_AUTH_REPLY XX</t>
<t>PQ-SecChannel_MSG_KEX_AUTH XX</t>
<t>PQ-SecChannel_MSG_USERAUTH_FAILURE XX</t>
<t>PQ-SecChannel_MSG_USERAUTH_SUCCESS XX</t>
<t>PQ-SecChannel_MSG_USERAUTH_BANNER XX</t>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN XX</t>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN_CONFIRMATION XX</t>
<t>PQ-SecChannel_MSG_CHANNEL_OPEN_FAILURE XX</t>
<t>PQ-SecChannel_MSG_CHANNEL_WINDOW_ADJUST XX</t>
<t>PQ-SecChannel_MSG_CHANNEL_DATA XX</t>
<t>PQ-SecChannel_MSG_CHANNEL_EOF XX</t>
<t>PQ-SecChannel_MSG_CHANNEL_CLOSE XX</t>
</section>

<section anchor="sec-8-3-algorithm-identifiers"><name>Algorithm Identifiers</name>
<t>IANA is requested to register the following algorithm names where applicable:</t>
<t>kex_algorithms: kyber, aigis-enc, hqc</t>
<t>publickey_algorithms: dilithium, aigis-sign</t>
<t>encryption_algorithms: SM4-GCM</t>
<t>compression_algorithms: zlib, none</t>
</section>

<section anchor="sec-8-4-no-further-actions"><name>No Further Actions</name>
<t>No other IANA actions are required at this time.</t>
</section>
</section>

</middle>

<back>

<references anchor="sec-9-references"><name>References</name>

<references anchor="sec-9-1-normative-references"><name>Normative References</name>
<reference anchor="RFC2119">
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner"><organization /></author>
<date year="1997" month="March" />
</front>
<seriesInfo name="BCP" value="14" />
<seriesInfo name="RFC" value="2119" />

</reference>
<reference anchor="RFC8174">
<front>
<title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
<author initials="B." surname="Leiba" fullname="Barry Leiba"><organization /></author>
<date year="2017" month="May" />
</front>
<seriesInfo name="BCP" value="14" />
<seriesInfo name="RFC" value="8174" />

</reference>
<reference anchor="GMT0014">
<front>
<title>Digital Certificate Authentication System Cryptographic Protocol Specification</title>
<author><organization>State Cryptography Administration (SCA)</organization></author>
<date year="2012" />
</front>
<seriesInfo name="GM/T" value="0014" />

</reference>
<reference anchor="GMT0128">
<front>
<title>Datagram Transport Layer Security Protocol Specification</title>
<author><organization>State Cryptography Administration (SCA)</organization></author>
<date year="2021" />
</front>
<seriesInfo name="GM/T" value="0128" />

</reference>
<reference anchor="GMT0129">
<front>
<title>SSH Cryptographic Protocol Specification</title>
<author><organization>State Cryptography Administration (SCA)</organization></author>
<date year="2021" />
</front>
<seriesInfo name="GM/T" value="0129" />

</reference>
<reference anchor="GBT15852">
<front>
<title>Information technology - Security techniques - Message authentication codes - Part 1: Mechanisms using a block cipher</title>
<author><organization>Standardization Administration of China (SAC)</organization></author>
</front><seriesInfo name="GB/T" value="15852.1" />

</reference>
<reference anchor="GBT33560">
<front>
<title>Information security technology - Cryptographic application identifier specification</title>
<author><organization>Standardization Administration of China (SAC)</organization></author>
</front><seriesInfo name="GB/T" value="33560" />

</reference>
<reference anchor="GBT43207">
<front>
<title>Information security technology - Information system cryptographic application design guide</title>
<author><organization>Standardization Administration of China (SAC)</organization></author>
</front><seriesInfo name="GB/T" value="43207" />

</reference>
<reference anchor="GMZ4001">
<front>
<title>Cryptography terminology</title>
<author><organization>State Cryptography Administration (SCA)</organization></author>
</front><seriesInfo name="GM/Z" value="4001" />

</reference>
</references>

<references anchor="sec-9-2-informative-references"><name>Informative References</name>
<reference anchor="RFC4251">
<front>
<title>The Secure Shell (SSH) Protocol Architecture</title>
<author initials="T." surname="Ylonen" fullname="Tatu Ylonen"><organization /></author>
<author initials="C." surname="Lonvick" fullname="Chris Lonvick"><organization /></author>
<date year="2006" month="January" />
</front>
<seriesInfo name="RFC" value="4251" />

</reference>
<reference anchor="RFC4252">
<front>
<title>The Secure Shell (SSH) Authentication Protocol</title>
<author initials="T." surname="Ylonen" fullname="Tatu Ylonen"><organization /></author>
<author initials="C." surname="Lonvick" fullname="Chris Lonvick"><organization /></author>
<date year="2006" month="January" />
</front>
<seriesInfo name="RFC" value="4252" />

</reference>
<reference anchor="RFC4253">
<front>
<title>The Secure Shell (SSH) Transport Layer Protocol</title>
<author initials="T." surname="Ylonen" fullname="Tatu Ylonen"><organization /></author>
<author initials="C." surname="Lonvick" fullname="Chris Lonvick"><organization /></author>
<date year="2006" month="January" />
</front>
<seriesInfo name="RFC" value="4253" />

</reference>
<reference anchor="RFC4254">
<front>
<title>The Secure Shell (SSH) Connection Protocol</title>
<author initials="T." surname="Ylonen" fullname="Tatu Ylonen"><organization /></author>
<author initials="C." surname="Lonvick" fullname="Chris Lonvick"><organization /></author>
<date year="2006" month="January" />
</front>
<seriesInfo name="RFC" value="4254" />

</reference>
</references>
</references>

<section anchor="acknowledgments" numbered="false"><name>Acknowledgments</name>
<t>The authors would like to thank the members of the IRTF Crypto Forum Research Group (CFRG) and related IETF security working groups for feedback. This document is based on the Chinese national cryptography standard draft for PQ-SecChannel and acknowledges the contributions of the Cryptography Industry Standardization Technical Committee and the designers of the Aigis, Kyber, Dilithium, and HQC algorithms.</t>
</section>

</back>

</rfc>