Network-on-chip communication encryption method based on national secret algorithm

By using an incremental encryption method based on national cryptographic algorithms, on-chip network communication data is modeled and encrypted, solving the problem of low encryption efficiency in existing technologies, improving the communication security and throughput of NoC, and adapting to more application scenarios.

CN116318802BActive Publication Date: 2025-12-23GUANGDONG UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211674825.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-26
Publication Date
2025-12-23
Estimated Expiration
2042-12-26

Smart Images

  • Figure CN116318802B_ABST
    Figure CN116318802B_ABST
Patent Text Reader

Abstract

The present application provides a network communication encryption method based on a national encryption algorithm, which is aimed at the low encryption efficiency and the limitation of few application scenarios in the prior art, and comprises the following steps: modeling malicious behaviors in target communication, and dividing communication data in the network into plaintext transmission data and encrypted transmission data; incrementally encrypting the encrypted transmission data to obtain incrementally encrypted data; grouping the incrementally encrypted data to obtain ciphertext blocks; combining the ciphertext blocks with the plaintext transmission data to obtain data packets; and transmitting the data packets to a target network interface; after receiving the data packets, the target network interface performs authentication encryption and then decryption to send the data packets to a target IP in the network; the present application uses the national encryption algorithm for incrementally encryption, can consider both data encryption and data integrity verification, and can cope with more security threats and application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of Network-on-Chip communication, and particularly to a Network-on-Chip communication encryption method based on a national secret algorithm. BACKGROUND

[0002] Network-on-Chip (NoC) is the communication backbone between various functional modules in a System on Chip (SOC), and plays a decisive role in the overall performance of the system. NoC design includes network topology, router structure, routing algorithm, etc. However, the security of many mainstream NoCs is very fragile, and even has no security. In order to provide secure and stable communication services for SoC, the data transmitted in NoC needs to be encrypted. There are many modes of malicious attacks, the most common of which are malicious copying, tampering and other attacks. In order to resist such attacks, researchers have designed many NoC data encryption schemes for specific attacks and application scenarios:

[0003] In 2003, Gebotys et al. proposed in the document "A framework for security on NOC technologies" that an encryption module and a key storage module are added to each IP core in the NoC communication network. With this scheme, the data is encrypted for protection, and the unencrypted key can leave the core and the NoC, and access to the key by untrusted software and outside the NoC can be avoided;

[0004] In 2007, Diguet et al. proposed in the document "NoC-centric security of reconfigurable SoC" that instead of adding encryption modules and key storage modules, the encryption module and the key are used only when accessing the NoC. The input data is controlled at the Network Interface (NI), and the application data and the data that need to be protected are transmitted in two Virtual Networks (VNs), and the security of network communication is completed at the NI.

[0005] In 2017, Sepúlveda et al. proposed in the document "Towards protected MPSoC communication for information protection against a malicious NoC" a secure and efficient NI design that can ensure the safe exchange of sensitive data in the presence of security threats. By re-dividing the format of the input data, it can be encrypted using the AES-CTR algorithm, and the SipHash algorithm is used to verify the data integrity.

[0006] The NoC topology design methods described above are based on data security considerations, however, the encryption methods used by these design methods are traditional AES, SHA and other encryption algorithms, which do not meet the security requirements of data encryption and integrity verification. In addition, these design methods are only for data encryption solutions, lack of combination with NoC application scenarios, and encryption efficiency is limited. SUMMARY

[0007] The present application provides an on-chip network communication encryption method based on a national cryptographic algorithm, which considers the optimization of on-chip network traffic characteristics, reduces encryption time consumption, improves throughput, and improves overall performance, to overcome the low encryption efficiency and limited application scenarios of the prior art.

[0008] Specifically, the technical scheme is as follows:

[0009] An on-chip network communication encryption method based on a national cryptographic algorithm, comprising:

[0010] Modeling malicious behavior in target communication, and dividing communication data in the on-chip network into plaintext transport data and encrypted transport data;

[0011] Incrementally encrypting the encrypted transport data to obtain incremental encryption data;

[0012] Grouping the incremental encryption data to obtain a ciphertext block; and combining the ciphertext block with the plaintext transport data to obtain a data packet;

[0013] Transmitting the data packet to a target network interface;

[0014] The target network interface receives the data packet, performs authentication encryption, and then decrypts and sends it to the target IP in the on-chip network.

[0015] The "modeling of malicious behavior" includes:

[0016] One or more of data theft, data tampering, and data leakage.

[0017] The plaintext transport data includes a data header generated by the target network interface.

[0018] The encrypted transport data includes core data to be input to the target network interface.

[0019] The plaintext transport data includes the transmission path of the core data.

[0020] The "incrementally encrypting the encrypted transport data to obtain incremental encryption data" includes:

[0021] The encrypted transport data in plaintext is input into an incremental encryption module, compared with the encrypted transport data in plaintext stored in the module in the last period, and the changed data is obtained;

[0022] The content of the changed data is encrypted, and the incremental encryption data is obtained.

[0023] The step of "incremental encryption" includes:

[0024] The encrypted transport data P i-1 in plaintext input in the last period is saved

[0025] The encrypted transport data P i-1 in plaintext input in the last period is compared with the encrypted transport data Pi input in plaintext in the current period through a comparator, and the comparison result is saved in the memory bitDiff.

[0026] The memory bitDiff is divided according to the block density of the incremental encryption algorithm, and the division result is blocks B[1],..., block B[k];

[0027] All blocks B[1],..., block B[k] are looped, and the blocks with values greater than zero are saved in the data block M i , and the index δ i corresponding to the data block M is set to 1; i = 1, 2,...; k = 1, 2,....

[0028] The data block M i is encrypted through the incremental encryption algorithm, and the incremental encryption data E i in the current period is obtained.

[0029] The "incremental encryption of the encrypted transport data to obtain incremental encryption data" further includes the process of incremental decryption, including:

[0030] The incremental encryption data obtained in the last period is compared with the incremental encryption data obtained in the current period, and the changed data is obtained;

[0031] The content of the changed data is decrypted, and the encrypted transport data in plaintext state in the current period is obtained.

[0032] The "grouping encryption of the incremental encryption data to obtain ciphertext blocks; and combining the ciphertext blocks with the plaintext transport data to obtain data packets" includes:

[0033] The initialization vector, the key, and the incremental encryption data are taken as inputs of the grouping encryption;

[0034] The incremental encryption data is encrypted by the encryption algorithm to generate ciphertext blocks, and the ciphertext blocks are obtained.

[0035] The ciphertext block is combined with the plaintext transmitted data to obtain the data packet.

[0036] The step of "encrypting the incremental encrypted data in groups to obtain ciphertext blocks; and combining the ciphertext blocks with the plaintext transmitted data to obtain a data packet" specifically includes:

[0037] The initialization vector IV, the key K, and the data block M in the incremental encryption data are used. i As input for block encryption;

[0038] The data block M i The ciphertext block C' is generated by encryption using an encryption algorithm. Ciphertext block C' is then combined with the data block M. i Corresponding index δ i Combining them yields the current ciphertext C. i ;

[0039] The current ciphertext C i With the data header H in the plaintext transmitted data i Combined into the data packet.

[0040] The phrase "the target network interface performs authentication and encryption after receiving the data packet" includes:

[0041] The encrypted transmission data input in plaintext is divided into at least one part to obtain data packets;

[0042] Obtain the authentication key Hveri = Encry(K,0) 128 );

[0043] Iterate over all the additional information Y0 = IV||0 of the data groups 31 1 and Y i =incr(Y i-1 );

[0044] The authentication bit is calculated based on the ciphertext C and Y0.

[0045] Electronic devices for on-chip network communication encryption based on national cryptographic algorithms include:

[0046] Storage medium used to store computer programs;

[0047] The processing unit exchanges data with the storage medium and executes the computer program during on-chip network communication to perform the steps of the on-chip network communication encryption method based on the national cryptographic algorithm as described above.

[0048] The present invention has at least the following beneficial effects:

[0049] The method described in the application uses the technical means of incremental encryption, combines the characteristics of high similarity between data in the NoC, can avoid encryption and decryption of repeated content, can significantly reduce the impact of the encryption module on the performance of the NoC; and uses the national encryption algorithm at the same time of incremental encryption, can consider the two functions of data encryption and data integrity verification, and cope with more security threats and application scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0050] In order to more clearly illustrate the technical solutions of the embodiments of the application, the drawings needed to be used in the embodiments will be briefly introduced as follows. It should be understood that the following drawings only show some embodiments of the application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0051] Figure 1 The flowchart of the method described in the application is shown in Figure 1.

[0052] Figure 2 The schematic diagram of the principle of the embodiment described in the application is shown in Figure 2.

[0053] Figure 3 The schematic diagram of the principle of the embodiment described in the application is shown in Figure 2. Figure 2 The schematic diagram of the principle of the embodiment described in the application is shown in Figure 2. DETAILED DESCRIPTION

[0054] Those skilled in the art can understand that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the description of the implementation scenario, or can be changed to be located in one or more devices different from the implementation scenario. The modules of the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0055] To solve the problems of the prior art, the general scheme of the application is: in the on-chip network (NoC) communication, based on the national encryption algorithm, the data transmitted by the NoC is encrypted for a specific threat model. At the same time, combined with the incremental encryption method, the pre-saved ciphertext is used to optimize the encryption speed. Finally, the security level of the NoC communication is improved, and the communication encryption speed is improved.

[0056] Specific embodiment I:

[0057] The application provides an embodiment:

[0058] As Figure 1 The on-chip network communication encryption method based on the national encryption algorithm comprises the following steps:

[0059] (1) Determine the application scenario of the encryption scheme:

[0060] Malicious behaviors in target NoC communication are modeled, including data theft, tampering, and leakage. Data transmitted in the NoC is divided into control and data types, both consisting of a header H and a payload P. The header H is generated from data input to the NoC via the network interface (NI) and contains information such as the data's destination, origin, size, and type. The payload P is the actual data to be transmitted by the IP core, transmitted encrypted. During transmission, the header H transmits data in plaintext, indicating the transmission path for the payload P, which is then transmitted as ciphertext through encryption.

[0061] (2) Incremental encryption and decryption:

[0062] Analysis of traffic characteristics when running the SPLASH-2 test set on a NoC revealed that the maximum difference between consecutive input data within the same test set was 13 bits, with 30% of the data differing by only 1 bit. In this embodiment, incremental encryption is applied to encrypt a large amount of similar consecutive data, which can improve encryption speed, reduce encryption time, and thus increase the throughput of the NoC.

[0063] Specifically, the plaintext payload P is input into the incremental encryption module and compared with the plaintext payload P stored in the previous cycle to obtain the modified data. Encryption is then performed based on the modified data. The number of representatives is The plaintext sequence of the payload P is given by sequence D[i], which is the i-th plaintext. The incremental encryption results of sequence D are E1 and E2; where E1 stores the encryption result of the previous cycle, and E2 is represented as M = M[1],...,M[t], which encrypts only the modified part of the plaintext sequence each time. After each encryption, the encrypted ciphertext is stored in E1, and E2 is cleared to obtain the incrementally encrypted data;

[0064] Similarly, during decryption, the ciphertext sequence of the current period is compared with the ciphertext sequence of the previous period. The changed data is decrypted, and the decryption result is used to replace the corresponding bits of the previous decryption result to obtain the current decryption result.

[0065] (3) Block encryption:

[0066] During block encryption, the data encryption uses four inputs: key K, initialization vector IV generated by a random number generator, incremental encryption data, and additional authentication data A. The encrypted output is ciphertext C. The plaintext input is the plaintext after incremental encryption in step (2).

[0067] The incremental encryption data after the incremental encryption processing is encrypted by the SM4 encryption algorithm of the national encryption algorithm. In order to resist the attack based on statistical analysis, the counter mode in SM4 is used for encryption. The incremental encryption data is not directly encrypted, but the different counter values CTR+i are encrypted and then XORed with the plaintext packet to obtain the ciphertext packet.

[0068] (4) Authentication encryption

[0069] The purpose of this step is to add a verification code to the ciphertext C generated in step (3). In order to resist malicious tampering attacks, the message authentication code (MAC) technology is provided to verify the integrity of the message. The MAC will be used as an authentication tag, and the ciphertext C after packet encryption will be sent to the decryption end through NoC. The decryption end compares it with the tag generated by the authentication decryption algorithm. If they are the same, it is considered that the received ciphertext data is legal; otherwise, it is determined that the ciphertext data is illegal, which indicates that the ciphertext may have been maliciously tampered with.

[0070] The authentication encryption uses two functions: a keyed hash function GHASH and a GCTR of the CTR mode with the counter increasing by 1 each time. The key used by GHASH is the same as the packet encryption key. GHASH takes the encrypted key K, the authentication data A and the ciphertext C as input, and outputs the MAC value X;

[0071] Specifically, the embodiment provides an implementation process of an example, such as Figure 2 :

[0072] (1) Determine the application scenario of the encryption scheme

[0073] A 4x4 on-chip network structure is used, and the target application is FFT and Ocean in the Splash2 test set. Each time, the input load P is 128 bits long, and the key K is 128 bits long. The data header H is sent as plaintext and does not need to be encrypted. The load P needs to be encrypted into ciphertext C by NI and sent, and H and C constitute the data transmitted in NoC. The threat model is modeled as a malicious IP that infects routers with hardware trojans, and maliciously copies or replays the data transmitted in NoC to obtain sensitive information.

[0074] (2) Incremental encryption decryption

[0075] As Figure 3 , the incremental encryption decryption module receives the plaintext P, finds the change amount of each encryption data according to the encryption block size, and inputs the plaintext to the packet encryption module. The ciphertext decryption also uses the incremental method, and after comparing with the previous received ciphertext, the block index to be decrypted by the decryption module is given.

[0076] The steps of the incremental encryption decryption are as follows:

[0077] ① Use a register to save the encryption delivery data P of the last periodi-1 Receive ciphertext E i-1 ;

[0078] ② The encrypted transmission data P from the previous cycle i-1 With the encrypted transmission data P of this cycle i The comparison result is stored in bitDiff using a 128-bit comparator.

[0079] ③ Divide bitDiff according to the size of the encrypted block, and the division result is B[1],...,B[k];

[0080] ④ Loop through all blocks B[1],...,B[k], store the blocks with values ​​greater than zero in M, and simultaneously set the corresponding index δ i Set to 1;

[0081] ⑤ The decryption process will convert the previous cycle's ciphertext E i-1 With the current ciphertext E i After passing through the comparator, repeat steps 3 and 4.

[0082] (3) Block encryption

[0083] For block ciphers, the inputs are the initialization vector IV, the key K, and the modified data block M generated by incremental encryption. i Data block M i The ciphertext block C' is generated by encryption using the SM4 encryption algorithm, and then... (The sentence is incomplete and ends abruptly, likely due to an indicative block index δ.) i The ciphertext blocks are combined to obtain the current ciphertext C. i Ciphertext C i With the i-th data header H i They will be combined into data packets and transmitted in NoC to the destination network interface NIdest, where the ciphertext will be decrypted.

[0084] Block encryption uses IV||{q}d as the standard input random number format to the counter pattern, and its value is equal to IV||seq. j ||q, through each input data P j Input sequence number seq j The value of the counter q and the initialization vector IV are obtained through calculation. Where P... j Each input data point is divided into four smaller data points, which are then fed into an encryption block for encryption. The encryption block number is fixed at q (q∈{1,2,3,4}), while the input sequence number is seq. j The numbering will change according to the input sequence and as the input data changes. (seq) j This refers to P j After being divided into 4 parts, the different orders in which each part is input into the encryption block, such as seq jCan be 1234, 2134, 3214, etc.

[0085] After the SM4 encryption of the key K, the encrypted ciphertext r of the CTR is obtained q = EK(IV||seq j ||q), and the plaintext M input by the incremental encryption module i The ciphertext block C' is obtained. The obtained ciphertext block is stored in the cache, and the next step combines the packet index δ i To build a complete ciphertext C.

[0086] The encryption process using the counter mode is as follows:

[0087]

[0088] The decryption process is opposite to the encryption process, and the ciphertext is encrypted with the counter value XOR to obtain the plaintext, as shown below:

[0089]

[0090] Using the counter mode for encryption, since each counter in the counter mode is different, the obtained ciphertext packet e i There is no repetition problem.

[0091] 4) Authentication encryption

[0092] The steps of authentication encryption are as follows:

[0093] ① Divide the input 128-bit plaintext p into p1, p2, …, pn;

[0094] ② Calculate the authentication key Hveri=Encry(K,0 128 ); Encry is the encryption of 128-bit 0 using the key K;

[0095] ③ Iteratively calculate the additional information Y0=IV||0 31 1 and Y i =incr(Y i-1 ), the incr() function regards the low 32 bits in the variable as valid bits to obtain a non-negative integer, and performs modulo operation with 2 32

[0096] ④ According to the ciphertext C and the additional information Y0, the authentication bit T=MSB t (GHASH(Hveri,A,C) Complete the authentication encryption process.

[0097] The application also provides an embodiment:

[0098] ​A computer readable storage medium: the computer readable storage medium has a computer program stored therein; the computer program, when running, executes the steps of the on-chip network communication encryption method based on the national secret algorithm as described above.

[0099] In the embodiment, the computer readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or apparatus. In the present application, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries the computer readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit the program for use by or in combination with an instruction execution system, device or apparatus. The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc. or any suitable combination thereof.

[0100] The method described in the present application is based on the national secret SM4 algorithm, and GCM message integrity verification is added on the basis of the SM4 algorithm mode. While preventing malicious IP from stealing sensitive data through statistical analysis method, the message integrity verification bit is checked to prevent malicious tampering of encrypted data in the transmission process. In addition, the NoC application scenario is actively considered. In addition to adding the encryption algorithm to the network interface to improve the security of NoC data transmission, the characteristics of NoC data transmission format are also considered. Before data encryption, the incremental encryption concept is used to compare the current input plaintext with the last input plaintext stored in the register. The part of the current input plaintext is changed, and the changed plaintext block is encrypted and combined with the previous input plaintext encryption content to form the ciphertext of the current input plaintext after encryption, which can improve the encryption speed, reduce the encryption time and improve the throughput of NoC.

[0101] The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any changes that can be thought of by those skilled in the art should fall within the protection scope of the present application. The above application number is only for description, not representing the advantages and disadvantages of the implementation scenario.

Claims

1. A method for encrypting communication of a network-on-chip based on a national secret algorithm, characterized in that, The method comprises the following steps: Modeling malicious behavior in target communication, and dividing communication data in the network-on-chip into plaintext transmission data and encrypted transmission data; Incrementally encrypting the encrypted transmission data to obtain incremental encryption data; Grouping and encrypting the incremental encryption data to obtain ciphertext blocks; Combining the ciphertext blocks with the plaintext transmission data to obtain data packets; Transmitting the data packets to a target network interface; The target network interface receives the data packets, performs authentication encryption, and then decrypts and sends them to a target IP in the network-on-chip; Incrementally encrypting the encrypted transmission data to obtain incremental encryption data, comprising: Comparing the encrypted transmission data input in plaintext with the encrypted transmission data stored in the last period in plaintext state in the incremental encryption module to obtain changed data; Encrypting the content of the changed data to obtain the incremental encryption data; The target network interface receives the data packets, performs authentication encryption, comprising: Dividing the encrypted transmission data input in plaintext into at least one part to obtain data packets; Obtain authentication key Hveri = Encry(K, 0 128 ); K is a key; Iterate over all the additional information Y0= IV || 0 of the data packets 31 1 and Y i = The malicious behavior is modeled, comprising: (Y i-1 ); The authentication bit T is calculated from the ciphertext C i and the additional information Y0.

2. The on-chip network communication encryption method based on the national secret algorithm of claim 1, wherein, One or more of data theft, data tampering, and data leakage.

3. The network-on-chip communication encryption method based on the national cryptographic algorithm according to claim 1, characterized in that: The plaintext transmission data comprises a data header generated by the target network interface; The encrypted transmission data comprises core data to be input into the target network interface; The plaintext transmission data contains the transmission path of the core data. The step of incremental encryption comprises:

4. The on-chip network communication encryption method based on the national secret algorithm of claim 1, wherein, Dividing the memory bitDiff according to the encryption block density of the incremental encryption algorithm, and the division result is blocks B[1],..., block B[k]; P = P + P i-1 ; the encrypted delivery data P of the previous cycle plaintext input i-1 the encrypted delivery data P of the current cycle plaintext input i comparison is made by the comparator and the comparison result is saved in the memory bitDiff; Incrementally encrypting the encrypted transmission data to obtain incremental encryption data further comprises the process of incremental decryption, comprising: Loop all blocks B[1],..., block B[k] to save the blocks with values greater than zero in the data block M i , while setting the data block M i to 1; i = 1, 2,...; k = 1, 2,... i corresponding index δ The data block M i The data block M is encrypted by the incremental encryption algorithm to obtain the incremental encryption data E i .

5. The on-chip network communication encryption method based on the national secret algorithm of claim 1, wherein, Comparing the incremental encryption data obtained in the last period with the incremental encryption data obtained in the current period to obtain changed data; Decrypting the content of the changed data to obtain the encrypted transmission data in plaintext state in the current period. Grouping and encrypting the incremental encryption data to obtain ciphertext blocks; 6. The on-chip network communication encryption method based on the national secret algorithm of claim 1, characterized in that, And combining the ciphertext blocks with the plaintext transmission data to obtain data packets, comprising: Taking the initialization vector, the key, and the incremental encryption data as inputs for grouping and encryption; The incremental encryption data is encrypted by an encryption algorithm to generate ciphertext blocks, obtaining the ciphertext blocks; The ciphertext blocks are combined with the plaintext transmission data to obtain the data packets.

7. The network-on-chip communication encryption method based on the national cryptographic algorithm according to claim 6, characterized in that: It comprises: The initialization vector IV, the key K, the data block M in the incremental encryption data i as input for the block encryption. The data block M i The data block M is encrypted by an encryption algorithm to generate a ciphertext block C', and the ciphertext block C' is combined with the data block M i The corresponding index δ i The current ciphertext C is obtained by combining the ciphertext block C' and the data block M i ; the current ciphertext C i with the data header H in the plaintext transport data i combined into the data packet.

8. An electronic device based on a national secret algorithm for on-chip network communication encryption, characterized by, A storage medium for storing a computer program; A processing unit for data exchange with the storage medium, configured to execute the computer program through the processing unit to perform the steps of the network-on-chip communication encryption method based on the national cryptographic algorithm according to any one of claims 1-7. ​