Patent Description:
There currently do not exist any standard solutions for authenticated encrypted reliable point-to-point communication between processors on a single PCB or, more generally, within a single device. Such entities are often communicated via media such as Serial Peripheral Interface (SPI), universal asynchronous receiver-transmitter (UART) or similar and either receive no protection at all or are protected with ad-hoc custom solutions, such as encrypting messages using a block cipher in an unauthenticated mode with an appended message authentication code (MAC).

However, unprotected communication leaves systems vulnerable to allowing attackers with physical access to the device to intercept, modify and retransmit traffic, resulting in extraction of secrets, reverse engineering of device functions and serving as a steppingstone to mount more complex attacks. This is particularly a concern in automotive applications because modern vehicles' electronic control systems play a crucial role in safety, as well as often communicating data to central servers.

Currently, ad-hoc solutions built upon block ciphers in unauthenticated modes are used in some circumstances. However, MAC codes carry the risk of misapplication of cryptographic primitives, resulting in protocol weaknesses that can be efficiently attacked (e.g. random or pseudo-random number reuse or using the same key for encryption and for authentication). For example, some proposed techniques reuse session keys for both encryption and MAC, which leaves communications vulnerable to attack. At the same time, there is no connection reliability guarantees. As such, any lost messages are not automatically retransmitted and are simply lost.

Accordingly, there remains a need to address the above shortcomings in communications.

United States Patent Application <CIT> discloses tamper-resistant and scalable mutual authentication for machine-to-machine devices.

European Patent Application <CIT> provides a method of securely connecting a first device to a second device using a third party authentication server coupled to the second device.

According to a first aspect, there is provided a method for securely transmitting data between at least a first and second processing unit, according to claim <NUM>.

In this way, a method for secure inter-processor communication may be provided, such as communication between processing units within a single printed circuit board or electronic control unit using simple serial links such as UART or SPI. Advantageously, by provisioning each processing unit with the Shared Secure Key, fast establishment of session keys may be achieved, even when using low performance microcontrollers. This thereby allows for a secure communication link to be established quickly (e.g. within <NUM> of milliseconds) after power up. Moreover, in the arrangement, both processing units are equivalent peers, and hence the protocol may be implemented without the concept of a client and server.

According to a second aspect, there is provided a first processing unit for secure communication with a second processing unit, according to claim <NUM>.

According to a third aspect, there is provided non-transient computer readable medium comprising instructions which, when executed by a processor, implement a method according to claim <NUM>.

Illustrative embodiments will now be described with reference to the accompanying drawings in which:.

The present invention concerns a secure peer to peer communication protocol for inter-processor communications. The protocol includes two phases of operation. In a first, authentication, phase the peers establish session keys and authenticate each other. This authentication phase is shown in <FIG> and <FIG>. In a second phase, the peer-to-peer communications are established for exchanging data. In this data exchange phase, the protocol uses an Authenticated Encryption with Associated Data (AEAD) scheme to provide authenticity, integrity and confidentiality guarantees.

In this connection, communications are transmitted using a plurality of frames, with each frame designating an outer protocol unit that includes the fields related to encryption and authentication. Each frame contains a packet representing an inner protocol unit that is transmitted in an encrypted form within AEAD frames.

The procedure is implemented between two peer devices, identified as A and B in <FIG>. Both devices are provided during manufacturing with a Shared Symmetric Key (SSK).

In the authentication phase, A sends an AUTH_CHALLENGE frame to B. This authentication frame contains a <NUM>-bit random number, CHALLENGEA→B. B also sends an AUTH_CHALLENGE frame to A, containing a <NUM>-bit random number, CHALLENGEB→A. A and B both have different <NUM>-byte node identifiers (IDs), IDA and IDB, which are also provided to each other during manufacture.

The node IDs may be configured statically during compiling. If AES-GCM is used as the AEAD cipher, then the fixed field value that is used in the Initialisation Vector (IV) construction may also be used as a Node ID. The Node ID values are different for each Processing Unit in the link. The Node IDs are used to prevent reflection attacks during the authentication phase by ensuring that the keys KVRFY(B) and KSIGN(B) are different, even if an attacker were to reflect A's challenge frame back to A. They also ensure that data encryption keys in both directions are different in the unlikely case that the challenges generated by both A and B are identical.

A uses (IDA ∥ IDB ∥ CHALLENGEA→B ∥ _CHALLENGEwhere ∥ denotes concatenation, and a KDF keyed with SSK to derive a session key for reception from B and an ephemeral authentication key for challenge response verification from B:.

A uses (IDB ∥ IDA ∥ CHALLENGEB→A ∥ CHALLENGEA→B) and a KDF keyed with SSK to derive a session key for transmission to B and an ephemeral authentication key for challenge response calculation to B:.

B uses (IDB ∥ IDA ∥ CHALLENGEB→A ∥ CHALLENGEA→B) and a KDF keyed with SSK to derive a session key for reception from A and an ephemeral authentication key for challenge response verification from A:.

The keys KVRFY (A) and KDEC(A) derived by B are the same as the keys KSIGN(B) and KENC(B), respectively, derived by A for transmission to B.

B uses (IDA ∥ IDB ∥ CHALLENGEA→B ∥ CHALLENGEB→A) and a KDF keyed with SSK to derive a session key for transmission to A and an ephemeral authentication key for challenge response calculation to A:.

These keys KSIGN(A) and KENC(A) derived by B are the same as the keys KVRFY(B) and KDEC(B), respectively, derived by A for reception from B.

B sends an AUTH_RESPONSE frame to A. It contains unencrypted RESPONSEB→A ← CMAC (KSIGN(A),CHALLENGEA→B).

A verifies B using the RESPONSEB→A contained in the AUTH_RESPONSE frame sent by B. Verification is performed by comparing if the received CMAC contained therein matches a corresponding CMAC generated from the first authentication challenge frame using the corresponding KVRFY(B) (i.e. RESPONSEB→A = CMAC (KVRFY(B),CHALLENGEA→B)).

If the verification succeeds, then host A trusts the identity of host B (A trusts that B knows the SSK). A sends an AUTH_RESPONSE frame to B. It contains unencrypted RESPONSEA→B ← CMAC (KSIGN(B),CHALLENGEB→A).

B similarly verifies A by comparing if the received CMAC contained therein matches a corresponding CMAC generated from the first authentication challenge frame using the corresponding KVRFY(A) (i.e. RESPONSEA→B (CMAC (KVRFY(A), CHALLENGEB→A). If the verification succeeds, then host B trusts the identity of host A (B trusts that A knows the SSK).

During the authentication phase, the processing units are configured to implement a timeout procedure. For example, after generating an AUTH _CHALLENGE in response to a received AUTH _CHALLENGE frame, a processing unit shall start an anti-scanning timeout of an implementation-defined, randomized length, but not shorter than, for example, <NUM> second. The purpose of this timeout is to protect the entropy of the RNG and to prevent potential brute-force attacks against the key generation algorithm. The random component of this timeout will ensure that in case challenges pass each other "in the wire", while the peers have different understanding of which challenges are valid, the challenges will eventually desynchronize and the authentication will get unblocked. A particular host processing unit will inhibit sending new AUTH _CHALLENGE frames until the anti-scanning timeout has elapsed. If a host does not receive an AUTH_CHALLENGEframe within an implementation-defined timeout after sending its own challenge, it shall generate and send a new challenge. If a host does not receive an AUTH _RESPONSE frame within an implementation-defined timeout, it shall discard all authentication data, such as challenges both sent and received, and start anew by sending a freshly-generated AUTH_CHALLENGE. The challenge and response timeout durations shall be set longer than the anti-scanning timeout to avoid blocking session establishment due to inability of peers to respond to each other before challenge and response timeouts expire. If a host receives an AUTH _RESPONSE frame without receiving a prior AUTH _CHALLENGE frame, it can be identified as an indication that the AUTH _CHALLENGE frame was sent by the peer and lost (among other reasons, it is possible that the receiving party was not ready to receive yet). When this happens, the host shall reset the authentication state machine, wait for the anti-scanning timeout to elapse and start anew by sending a freshly-generated AUTH_CHALLENGE. It is possible that the response timeout on the peer will expire before the anti-scanning timeout on the host - in that case the peer will be the first to send a new AUTH_CHALLENGE. A host receiving a new AUTH_CHALLENGEframe while expecting an AUTH _RESPONSE frame shall discard all authentication data, accept the new challenge and respond with its own fresh AUTH_CHALLENGE followed by an AUTH_RESPONSE, provided that the anti-scanning timeout has elapsed.

Once the authentication phase has completed and both peer processing units are verified, data frames may then be transmitted between them using the respective first and second session keys. The data frames are constructed in such a way, that their LEN and FRAME ID fields are authenticated by the AEAD protocol but not encrypted, thus achieving confidentiality, integrity and authenticity for DATA frames, while providing plaintext visibility compatible with frame types not requiring AEAD encryption such as AUTH _CHALLENGE and AUTH_RESPONSE.

On initialising communications, a first peer device out of A and B will initiate a new key exchange when the number of AEAD scheme invocations with a given key approaches a defined maximum value. The first peer will then stop using keys and close the session when the number of AEAD scheme invocations reaches the defined maximum value. For AES-GCM the maximum number of invocations is not larger than <NUM><NUM>, although the implementation may be configured to perform re-keying earlier. This satisfies the cryptographic requirements for the AES-GCM scheme in the selected configuration of Initialization Vector (IV) length and construction, key length and tag length.

The above said, re-keying shall not reset the sequence and acknowledge numbers, as it would introduce ambiguity in case there are packets pending for retransmission or unacknowledged. Instead, the transmitter increments the SEQ number with each new packet transmitted, except for ACK_ONLY packets. The sequence and acknowledge numbers shall not roll over into the MSb. The receiver shall drop a packet that carries a SEQ number different from the expected number and respond with a packet with the NACK bit set. The transmitter shall buffer the packets sent and wait for their acknowledgement. A packet shall be considered acknowledged, if a packet carrying ACK number equal to or greater than its SEQ number is received.

The transmitter shall retransmit unacknowledged packets. The size of the queue of packets waiting for acknowledgement is application-specific and, in this embodiment, has no maximum length defined at the protocol level and has a minimum length of one packet. The number of packets that can be sent without receiving an acknowledgement shall be configured in accordance with the buffering capability of the receiver processing unit.

When retransmitting unacknowledged packets, the transmitter shall update the ACK number they carry to reflect the most recent SEQ number received. A host that has no data to send shall acknowledge packets using an ACK_ONLY packet. The SEQ number in ACK_ONLY packets shall remain the same as used in the preceding packet. No ACK_ONLY packets shall be sent in response to ACK_ONLY packets. The DATA field in ACK_ONLY packets shall be empty. ACK_ONLY packets shall have the PKT_ID field set to 0x0000.

The processing unit transmitting packets may cease to retransmit packets in case the acknowledge response does not arrive within a predetermined time. This retransmission timeout period may be set depending on the application. The implementation may provide a packet-individual timeout, indicating when it does not make sense any more to try to retransmit.

Upon reception of a packet with the NACK bit set, a host shall retransmit all packets sent since the last acknowledged packet. If the packets are no longer available for retransmission, the host shall resynchronize by utilizing the FORCE bit.

The FORCE bit shall only cause forward jumps in the sequence. The receiver must not move backwards in the sequence, as it would risk accepting the same packet twice. This reaction to the FORCE bit requires a different approach to resynchronization when one of the peers is reset. A peer that has been reset shall keep in the acknowledge queue at most one transmitted packet until it has received the first packet from the other side. Upon reception of the first packet, the peer shall adjust its sequence and acknowledge numbers to match the numbers from the received packet.

Accordingly, with the above arrangement, confidentiality, integrity and authenticity needs may be addressed by applying an Authenticated Encryption with Associated Data (AEAD) cryptographic scheme to protocol data units (PDUs). The issue of connection reliability is addressed using retransmissions with sequence numbers and acknowledgments. Advantageously, the protocol can be applied in any situation where two peers with pre-shared keys need to establish bi-directional reliable communication with confidentiality, integrity and authenticity guarantees. The protocol is especially suited to cases where complex high-level protocols such as (Transport Layer Security) TLS or Internet Protocol Security (IPsec) are not practical due to e.g. limited performance or limited resources of the communicating peers or low throughput of the communication channel.

The protocol establishes session keys that are derived from a shared secret that is provided out-of-band to both communicating peers. The session key establishment process employs random nonces generated using True Random Number Generators (RNGs) and provides mutual authentication of the peers. The session key establishment process protects against nonce/key pair reuse in the case of device reset. The protocol can also accommodate various AEAD schemes, such as ChaCha20-Poly1305 and Salsa20-Poly1305, as well as GCM, CCM and EAX with block ciphers including AES, Camellia and Twofish. This use of an established AEAD scheme eliminates the issues that might otherwise be associated with the potentially incorrect application of individual cryptographic primitives.

Claim 1:
A method for securely transmitting data between at least a first and second processing unit, each having stored a Shared Secure Key and a respective identifier, ID, and the ID of the other processing unit, the method comprising:
transmitting a first authentication challenge from the first processing unit to the second processing unit, wherein the first authentication challenge comprises at least a first random number;
transmitting a second authentication challenge from the second processing unit to the first processing unit, where the second authentication challenge comprises a second random number;
generating a first session key and a first authentication key at the first processing unit using the first and second authentication challenges and the stored Shared Secure Key;
generating a second session key and a second authentication key at the second processing unit using the first and second authentication challenges and the stored Shared Secure Key;
transmitting a first authentication response from the first processing unit to the second processing unit, the first authentication response comprising a first authentication code generated from the second authentication challenge using the first authentication key; and
verifying the first processing unit at the second processing unit when the received first authentication code matches a local authentication code generated from the second authentication challenge using the second authentication key;
if verified, transmitting data from the second processing unit to the first processing unit using the second session key.