Communication authentication method and device
By using the authentication method of random numbers and microcontrollers in the FC-AE-1553 fiber optic communication protocol, the problem of easy attack by illegal users is solved. The security of the communication protocol is improved through the reorganization of authentication sequence numbers and random numbers, and prevents Illegal access.
Patent Information
- Application Number
- CN202311525416.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-11-15
AI Technical Summary
In the prior art, the FC-AE-1553 fiber optic communication protocol fails to effectively authenticate, resulting in vulnerability to attack and illegal access by illegal users, causing great losses and affecting application security.
By adopting a communication authentication method, by obtaining the random number and at least one second random number of the target communication module, determining the target authentication sequence number and authentication result, recombining the random number, sending the data to be authenticated to the microcontroller unit, and accordingly, Authentication results are authenticated to improve the security of data transmission.
By flexibly determining the reorganization of authentication algorithms and random numbers, the difficulty of cracking data to be authenticated is improved, and the application security of FC-AE-1553 fiber optic communication protocol is significantly improved, and illegal access is prevented.
Smart Images

Figure CN117768149B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a communication authentication method and device. Background Art
[0002] The FC-AE-1553 fiber optic communication protocol is a new high-speed fiber optic avionics system bus standard. With its high bandwidth, high reliability, strong real-time and low-latency bus link, and the characteristics of effectively reducing the weight of the bus system, it can be better applied to the transmission and signal control between various aviation equipment such as flight control systems and navigation systems in aircraft.
[0003] However, before applying the FC-AE-1553 optical fiber communication protocol, the FC-AE-1553 optical fiber communication protocol needs to be authenticated, otherwise illegal users can easily attack and illegally access the FC-AE-1553 optical fiber communication protocol, thereby causing greater losses. Therefore, how to authenticate the FC-AE-1553 optical fiber communication protocol to improve application security is a problem that needs to be solved urgently. Summary of the invention
[0004] The present invention provides a communication authentication method and device, which are used to solve the defect in the prior art that illegal users can easily attack and illegally access the FC-AE-1553 optical fiber communication protocol, causing great losses, and improve the security of the application of the FC-AE-1553 optical fiber communication protocol.
[0005] The present invention provides a communication authentication method, which is applied to a field programmable gate array (FPGA) chip. The method comprises:
[0006] Obtaining a first random number and at least one second random number corresponding to a target communication module;
[0007] Based on the first random number, determine a target authentication sequence number and a first authentication result, wherein the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number;
[0008] Determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit;
[0009] A second authentication result sent by the micro control unit is received, and an authentication result corresponding to the target communication module is determined based on the first authentication result and the second authentication result.
[0010] According to the communication authentication method provided by the present invention, determining the target authentication sequence number based on the first random number includes:
[0011] Performing a remainder on the first random number to determine a target number of remainders;
[0012] Based on the target modulus times, the target authentication sequence number is determined.
[0013] According to the communication authentication method provided by the present invention, determining a first authentication result based on the first random number includes:
[0014] Taking a remainder of the first random number, determining a remainder corresponding to the first random number, and determining the remainder as an authentication seed;
[0015] Determine the target authentication algorithm corresponding to the target authentication sequence number from a preset algorithm library;
[0016] The authentication seed is input into the target authentication algorithm to determine a first authentication result.
[0017] According to the communication authentication method provided by the present invention, the step of sending the data to be authenticated to the micro control unit comprises:
[0018] Sending the target authentication sequence number and the recombined random number to the micro control unit simultaneously;
[0019] or,
[0020] Determine the sending order of the target authentication sequence number and the reorganized random number, and send the target authentication sequence number and the reorganized random number to the micro control unit in sequence based on the sending order.
[0021] According to the communication authentication method provided by the present invention, determining the authentication result corresponding to the target communication module based on the first authentication result and the second authentication result includes:
[0022] When the second authentication result is equal to the first authentication result, the authentication result corresponding to the target communication module is determined to be authentication passed, and an enable valid signal corresponding to the target communication module is generated, and the target communication module is an FC-AE-1553 optical fiber communication protocol.
[0023] According to the communication authentication method provided by the present invention, the step of obtaining a first random number and at least one second random number corresponding to a target communication module includes:
[0024] Determine a first random number seed based on a first power-on duration of a target communication module timer; and determine at least one second random number seed based on at least one second power-on duration of the target communication module timer; the first power-on duration is not equal to each of the second power-on durations;
[0025] Determine the first random number based on a random function and the first random number seed;
[0026] Based on the random function and each of the second random number seeds, each of the second random numbers is determined.
[0027] The present invention also provides a communication authentication method, which is applied to a micro control unit, and the method comprises:
[0028] Receiving data to be authenticated sent by a field programmable gate array FPGA chip, wherein the data to be authenticated is determined based on a recombined random number and a target authentication sequence number;
[0029] Based on the data to be authenticated, determine the target authentication sequence number and the first random number in the recombined random number, the target authentication sequence number being the sequence number of the target authentication algorithm corresponding to the first random number;
[0030] Determine a second authentication result based on the target authentication sequence number and the first random number;
[0031] Send the second authentication result to the FPGA chip.
[0032] According to the communication authentication method provided by the present invention, determining the second authentication result based on the target authentication sequence number and the first random number includes:
[0033] Determine the target authentication algorithm corresponding to the target authentication sequence number from a preset algorithm library;
[0034] Taking a remainder of the first random number, and determining the obtained remainder as a new authentication seed;
[0035] The new authentication seed is input into the target authentication algorithm to determine the second authentication result.
[0036] The present invention also provides a communication authentication device, which is applied to a field programmable gate array (FPGA) chip, and the device comprises:
[0037] An acquisition module, used to acquire a first random number and at least one second random number corresponding to a target communication module;
[0038] A first authentication module, based on the first random number, determines a target authentication sequence number and a first authentication result, wherein the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number;
[0039] A first determination module is used to determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit;
[0040] The first receiving module is used to receive the second authentication result sent by the micro control unit, and determine the authentication result corresponding to the target communication module based on the first authentication result and the second authentication result.
[0041] The present invention also provides a communication authentication device, which is applied to a micro control unit, and the device comprises:
[0042] A second receiving module is used to receive the data to be authenticated sent by the field programmable gate array FPGA chip, wherein the data to be authenticated is determined based on the recombined random number and the target authentication sequence number;
[0043] A second determination module is used to determine the target authentication sequence number and the first random number in the recombined random number based on the data to be authenticated, wherein the target authentication sequence number is the sequence number of the target authentication algorithm corresponding to the first random number;
[0044] A second authentication module, configured to determine a second authentication result based on the target authentication sequence number and the first random number;
[0045] A sending module is used to send the second authentication result to the FPGA chip.
[0046] The communication authentication method and device provided by the present invention, after obtaining a first random number and at least one second random number corresponding to a target communication module, determine a target authentication sequence number of a corresponding target authentication algorithm according to the first random number, and determine a first authentication result according to the target authentication algorithm and the first random number, then, after reorganizing the first random number and at least one second random number, determine the data to be authenticated together with the target authentication sequence number, send the data to be authenticated to a micro control unit, and compare the first authentication result with the second authentication result determined by the micro control unit to determine the authentication result of the target communication module, flexibly determine the target authentication algorithm through the target authentication sequence number, and reorganize the first random number and at least one second random number, thereby improving the difficulty of cracking the data to be authenticated, and thus improving the application security of the target communication module. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 This is one of the flow charts of the communication authentication method provided by the embodiment of the present invention;
[0049] Figure 2This is a second flow chart of the communication authentication method provided by an embodiment of the present invention;
[0050] Figure 3 It is a schematic diagram of the connection between the FPGA chip and the micro control unit provided in an embodiment of the present invention;
[0051] Figure 4 This is a third flow chart of the communication authentication method provided by an embodiment of the present invention;
[0052] Figure 5 This is one of the structural diagrams of the communication authentication device provided by the embodiment of the present invention;
[0053] Figure 6 This is a second structural diagram of a communication authentication device provided by an embodiment of the present invention;
[0054] Figure 7 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] Aiming at the problem in the prior art that illegal users can easily attack and illegally access the FC-AE-1553 optical fiber communication protocol, causing great losses, the embodiment of the present invention provides a communication authentication method, which is applied to a field programmable logic gate array FPGA chip. Figure 1 FIG. 1 is one of the flow charts of the communication authentication method provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0057] Step 110: Obtain a first random number and at least one second random number corresponding to the target communication module.
[0058] It should be noted that in the design environment of FPGA, the above-mentioned target communication module is the IP (Intellectual Property) core of the target communication protocol, which encapsulates the target communication protocol in the form of IP. The IP core is a pre-built and verified hardware functional module, which may include a processor core, a storage controller, a communication interface, a digital signal processor (DSP), an accelerator and a peripheral controller. The IP core can be used in the FPGA design environment to reduce development time and workload, and facilitate designers to integrate the IP core into the FPGA project, thereby making full use of hardware acceleration and optimization. The target communication protocol refers to the FC-AE-1553 optical fiber communication protocol, which is a subset of the FC-AE protocol. In addition to having the characteristics of the FC-AE protocol, the FC-AE-1553 optical fiber communication protocol can also be seamlessly compatible with MIL-STD-1553 bus system equipment, realizing the smooth upgrade of the MIL-STD-1553 bus system, and has the advantages of high reliability, high stability, high bandwidth, strong electromagnetic interference resistance, and simple and fast engineering application. The FC-AE-1553 optical fiber communication protocol is mainly used for communication interconnection, data transmission and command control between various electronic equipment in the fields of aviation and aerospace.
[0059] Furthermore, Figure 2 FIG. 2 is a flow chart of a communication authentication method according to an embodiment of the present invention. Figure 2 As shown, the step of obtaining a first random number and at least one second random number corresponding to a target communication module includes:
[0060] Determine a first random number seed based on a first power-on duration of a target communication module timer; and determine at least one second random number seed based on at least one second power-on duration of the target communication module timer; the first power-on duration is not equal to each of the second power-on durations;
[0061] Determine the first random number based on a random function and the first random number seed;
[0062] Based on the random function and each of the second random number seeds, each of the second random numbers is determined.
[0063] Specifically, when determining the first random number corresponding to the target communication module, first read the first power-on duration stored in the register of the target communication module timer, and determine the first random number seed according to the first power-on duration, and obtain the first random number corresponding to the first random number seed based on the starting point determined by the random function based on the first random number seed. After determining the first random number and determining the first authentication result according to the first random number, read the second power-on duration stored in the register of the target communication module timer again, and after reading the first power-on duration for the first time, due to determining the duration consumed by the first random number and determining the duration consumed by the first authentication result according to the first random number, the second power-on duration is not equal to the first power-on duration, and the second power-on duration is greater than the first power-on duration. After determining the second power-on duration, similarly determine the second random number seed according to the second power-on duration, and obtain the second random number corresponding to the second random number seed based on the starting point determined by the random function based on the second random number seed. In addition, at least one second random number can be determined according to the above operation.
[0064] Furthermore, the C / C++ standard library <cstdlib>Two functions are provided for generating random numbers, namely srand(seed) function and rand() function, wherein srand(seed) function is used to set the seed value corresponding to the random number, and the seed value is the starting point for random number generation. Different seed values will generate different random number sequences. The rand() function is the above-mentioned random function, which generates random numbers according to the seed value set by the srand(seed) function. For example, after reading the first power-on time a, the first random number seed can be determined by the srand(a) function, and the first random number seed set is the starting point for the generation of the first random number, and then the first random number is generated by the rand() function according to the first random number seed.
[0065] It should be noted that the accuracy of the target communication module timer reaches the nanosecond level, that is, the accuracy of the first power-on duration and each second power-on duration both reaches the nanosecond level. The nanosecond-level target communication module timer can maintain long-term stability and accuracy, has high sensitivity, can meet the application requirements of extremely fast response speed, and the nanosecond-level target communication module timer is easy to control.
[0066] Step 120: Based on the first random number, determine a target authentication sequence number and a first authentication result, wherein the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number.
[0067] Specifically, after determining the first random number, the target authentication number is further determined. According to the target authentication number, the target authentication algorithm corresponding to the first random number can be further determined. According to the target authentication algorithm, the first random number can be encrypted to obtain a first authentication result, thereby improving data security.
[0068] Further, such as Figure 2 As shown, the determining of the target authentication sequence number based on the first random number includes:
[0069] Performing a remainder on the first random number to determine a target number of remainders;
[0070] Based on the target modulus times, the target authentication sequence number is determined.
[0071] Further, such as Figure 2 As shown, determining a first authentication result based on the first random number includes:
[0072] Taking a remainder of the first random number, determining a remainder corresponding to the first random number, and determining the remainder as an authentication seed;
[0073] Determine the target authentication algorithm corresponding to the target authentication sequence number from a preset algorithm library;
[0074] The authentication seed is input into the target authentication algorithm to determine a first authentication result.
[0075] Specifically, after determining the first random number, a remainder operation can be performed on the first random number. On the one hand, the target remainder times of the current remainder are determined, and the target remainder times are used as the target authentication sequence number. According to the target authentication sequence number, the preset algorithm library can be traversed according to the target authentication sequence number. The preset algorithm library includes multiple authentication algorithms, and each authentication algorithm is configured with a corresponding number to obtain a target authentication algorithm with the same number as the target authentication sequence number. On the other hand, after the remainder operation, the remainder corresponding to the first random number can be determined, and the remainder is used as an authentication seed, and the authentication seed is input into the target authentication algorithm for authentication calculation to obtain the first authentication result.
[0076] It should be noted that, in multiple remainder operations, the target remainder times corresponding to each remainder operation are cyclic, and the upper limit value of the target remainder times can be determined according to the number of authentication algorithms in the preset algorithm library, and the lower limit value of the target remainder times can be 1. Specifically, after the first random number is remaindered, the remainder times of the current remainder are obtained, and the upper limit value of the remainder times can be an infinite positive integer. After determining the remainder times, the remainder times can be further compared with the upper limit value. If the remainder times are greater than the upper limit value, the lower limit value is determined as the target remainder times, and if the remainder times are less than or equal to the upper limit value, the remainder times are determined as the target remainder times. For example, taking the lower limit value of the target remainder times as 1 and the upper limit value as 5, if the remainder times of the current remainder are 5, since the remainder times are equal to the upper limit value, the target remainder times are determined to be 5, and if the remainder times of the current remainder are 6, since the remainder times are greater than the upper limit value, the target remainder times are determined to be 1.
[0077] Optionally, the authentication algorithms in the preset algorithm library may include CRC (Cyclic Redundancy Check) algorithm, AES (Advanced Encryption Standard) algorithm, RSA (asymmetric encryption) algorithm and MD5 message digest algorithm (MD5 Message-Digest Algorithm), etc., which is not limited in the embodiment of the present invention.
[0078] Step 130: determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit.
[0079] Specifically, after determining the target authentication sequence number, the first random number and at least one second random number, the first random number and the at least one second random number are first recombined to obtain a recombined random number. Then, the data to be authenticated is determined according to the target authentication sequence number and the recombined random number, and the data to be authenticated is sent to a microcontroller unit (MCU), thereby increasing the difficulty for illegal users to crack the data to be authenticated, thereby ensuring the security of data during data transmission.
[0080] Optionally, when the first random number and the at least one second random number are recombined, the recombining method may be concatenation, bitwise operation, or four arithmetic operations, etc., which is not limited in the embodiment of the present invention. It should be noted that the recombining method is a reversible method, that is, after the first random number and the at least one second random number are recombined to obtain the recombined random number, the first random number and the at least one second random number can be restored according to the recombined random number in the case of obtaining the recombining method in advance.
[0081] Optionally, before or when sending the data to be authenticated, indication information corresponding to the reorganization method may also be sent to the microcontroller unit, so that after receiving the data to be authenticated, the microcontroller unit can restore the data to be authenticated according to the reorganization method in the indication information to obtain a first random number and at least one second random number.
[0082] Further, such as Figure 2 As shown, the sending of the data to be authenticated to the micro control unit includes:
[0083] Sending the target authentication sequence number and the recombined random number to the micro control unit simultaneously;
[0084] or,
[0085] Determine the sending order of the target authentication sequence number and the reorganized random number, and send the target authentication sequence number and the reorganized random number to the micro control unit in sequence based on the sending order.
[0086] Specifically, after determining the data to be authenticated, it is necessary to send the data to be authenticated to the micro control unit. When sending the data to be authenticated, on the one hand, the target authentication sequence number and the reorganized random number can be encapsulated into the same data message, and the data message is transmitted through the communication protocol. On the other hand, the target authentication sequence number and the reorganized random number can be respectively encapsulated into two different data messages, and then the sending order of the two data messages is determined, that is, it is determined whether to give priority to sending the data message corresponding to the reorganized random number or the data message corresponding to the target authentication sequence number. By discretely sending the target authentication sequence number and the reorganized random number, data security can be further improved.
[0087] It should be noted that if the target authentication sequence number and the reorganized random number are encapsulated into two different data messages for transmission, then before transmission, the sequence indication information needs to be sent to the micro control unit first, so that the micro control unit can determine whether the received data message corresponds to the target authentication sequence number or the reorganized random number according to the sequence indication information. Alternatively, the identifiers corresponding to the target authentication sequence number and the reorganized random number are agreed upon in advance with the micro control unit. In this case, the target authentication sequence number and the reorganized random number can be directly sent to the micro control unit in sequence according to the transmission order without sending the sequence indication information first, and the micro control unit can identify the data message as representing the target authentication sequence number or the reorganized random number according to the identifier.
[0088] Optionally, the communication protocol may include: CAN (Controller Area Network) bus protocol, IIC (Inter-Integrated Circuit, bidirectional binary synchronous serial) bus protocol or serial communication protocol, etc., which is not limited in the embodiment of the present invention.
[0089] Optional, Figure 3 FIG. 1 is a schematic diagram of the connection between the FPGA chip and the micro control unit provided in an embodiment of the present invention. Figure 3 As shown, the FPGA chip includes: Microblaze soft core, FC-AE-1553IP, IIC IP core, CAN IP core and UART (Universal Asynchronous Receiver / Transmitter) IP core, etc. The embedded software runs in the Microblaze soft core, which reads the first random number seed and at least one second random number seed in the FC-AE-1553IP timer through the AXI (Advanced eXtensible Interface) bus, and after determining the data to be authenticated according to the first random number seed and at least one second random number seed, sends the data to be authenticated to one of the target IP cores among the IIC IP core, the CAN IP core and the Uart IP core through the AXI bus, and then sends it to the micro control unit through the target IP core.
[0090] In addition, the microcontroller unit includes: communication interfaces such as IIC interface, CAN interface and Uart interface, and the microcontroller unit and the FPGA chip are connected through communication interfaces such as IIC interface, CAN interface and Uart interface, that is, the IIC IP core of the FPGA chip is connected to the IIC interface of the microcontroller unit, the CAN IP core of the FPGA chip is connected to the CAN interface of the microcontroller unit, and the Uart IP core of the FPGA chip is connected to the Uart interface of the microcontroller unit. The microcontroller unit is also embedded with single-chip microcomputer software. After receiving the data to be authenticated, the data to be authenticated is processed by the single-chip microcomputer unit to obtain a second authentication result.
[0091] Step 140: Receive a second authentication result sent by the micro control unit, and determine an authentication result corresponding to the target communication module based on the first authentication result and the second authentication result.
[0092] Further, such as Figure 2 As shown, the determining the authentication result corresponding to the target communication module based on the first authentication result and the second authentication result includes:
[0093] When the second authentication result is equal to the first authentication result, the authentication result corresponding to the target communication module is determined to be authentication passed, and an enable valid signal corresponding to the target communication module is generated, and the target communication module is an FC-AE-1553 optical fiber communication protocol.
[0094] Specifically, after receiving the second authentication result determined by the microcontroller unit, the first authentication result is compared with the second authentication result. If the first authentication result is equal to the second authentication result, it indicates that the target communication module has passed the authentication. After that, an enable valid signal is generated, that is, the target communication module can be used for function development.
[0095] In addition, if the first authentication result is not equal to the second authentication result, the first random number and at least one second random number are re-determined, and then the first authentication result and the second authentication result are determined, and authentication is performed again. If the number of failures reaches a preset threshold, it indicates that the authentication has failed.
[0096] The communication authentication method provided by the embodiment of the present invention determines the target authentication sequence number of the corresponding target authentication algorithm according to the first random number after obtaining the first random number and at least one second random number corresponding to the target communication module, and determines the first authentication result according to the target authentication algorithm and the first random number. After that, the first random number and the at least one second random number are recombined, and the data to be authenticated are determined together with the target authentication sequence number, and the data to be authenticated is sent to the micro control unit, and the authentication result of the target communication module is determined according to the first authentication result and the second authentication result determined by the micro control unit. The target authentication algorithm is flexibly determined by the target authentication sequence number, and the recombination of the first random number and the at least one second random number is used to improve the difficulty of cracking the data to be authenticated, thereby improving the application security of the target communication module.
[0097] The present invention also provides a communication authentication method, which is applied to a micro control unit. Figure 4 FIG. 3 is a flow chart of a communication authentication method provided by an embodiment of the present invention. Figure 4 As shown, the method includes:
[0098] Step 410: Receive the data to be authenticated sent by the field programmable gate array FPGA chip, wherein the data to be authenticated is determined based on the recombined random number and the target authentication sequence number.
[0099] Step 420: Based on the data to be authenticated, determine the target authentication sequence number and the first random number in the recombined random number, wherein the target authentication sequence number is the sequence number of the target authentication algorithm corresponding to the first random number.
[0100] Step 430: Determine a second authentication result based on the target authentication sequence number and the first random number.
[0101] Step 440: Send the second authentication result to the FPGA chip.
[0102] Specifically, after the micro control unit receives the data to be authenticated sent by the FPGA chip, it can further identify the target authentication sequence number and the reorganized random number in the data to be authenticated, and then, by restoring the reorganized random number, a first random number and at least one second random number can be obtained. The second authentication result can be further determined by the target authentication sequence number and the restored first random number, and the second authentication result is sent to the FPGA chip.
[0103] Further, determining a second authentication result based on the target authentication sequence number and the first random number includes:
[0104] Determine the target authentication algorithm corresponding to the target authentication sequence number from a preset algorithm library;
[0105] Taking a remainder of the first random number, and determining the obtained remainder as a new authentication seed;
[0106] The new authentication seed is input into the target authentication algorithm to determine the second authentication result.
[0107] Specifically, after restoring the first random number, the numbers of each authentication algorithm can be traversed in the preset algorithm library, and the authentication algorithm with the same number as the target authentication sequence number can be determined as the target authentication algorithm. At the same time, the first random number is modulo obtained to obtain the remainder, and the remainder is determined as a new authentication seed. The new authentication seed is calculated by the target authentication algorithm to obtain a second authentication result.
[0108] The communication authentication method provided by the embodiment of the present invention, after receiving the data to be authenticated, restores the first random number by reorganizing the random number, improves the target authentication algorithm by the target authentication sequence number, and then calculates the new authentication seed obtained by taking the modulus of the first random number by the target authentication algorithm to obtain a second authentication result, improves the difficulty of cracking the first random number by reorganizing the random number, and improves the flexibility of determining the target authentication algorithm by the target authentication sequence number, thereby improving the difficulty of cracking the data to be authenticated, and thus improving the authentication security of the target communication module.
[0109] The embodiment of the present invention also provides a communication authentication device, which is applied to a field programmable gate array FPGA chip. Figure 5 FIG. 1 is a schematic diagram of a communication authentication device according to an embodiment of the present invention. Figure 5 As shown, the communication authentication device 500 includes: an acquisition module 510, a first authentication module 520, a first determination module 530 and a first receiving module 540, wherein:
[0110] The acquisition module 510 is used to acquire a first random number and at least one second random number corresponding to a target communication module.
[0111] The first authentication module 520 determines a target authentication sequence number and a first authentication result based on the first random number, where the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number.
[0112] The first determination module 530 is used to determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit.
[0113] The first receiving module 540 is used to receive the second authentication result sent by the micro control unit, and determine the authentication result corresponding to the target communication module based on the first authentication result and the second authentication result.
[0114] The communication authentication device provided by the embodiment of the present invention determines the target authentication sequence number of the corresponding target authentication algorithm according to the first random number after obtaining the first random number and at least one second random number corresponding to the target communication module, and determines the first authentication result according to the target authentication algorithm and the first random number. After that, the first random number and the at least one second random number are recombined, and the data to be authenticated are determined together with the target authentication sequence number, and the data to be authenticated is sent to the micro control unit, and the authentication result of the target communication module is determined according to the first authentication result and the second authentication result determined by the micro control unit. The target authentication algorithm is flexibly determined by the target authentication sequence number, and the recombination of the first random number and the at least one second random number is used to improve the difficulty of cracking the data to be authenticated, thereby improving the application security of the target communication module.
[0115] Optionally, the acquisition module 510 is specifically configured to:
[0116] Determine a first random number seed based on a first power-on duration of a target communication module timer; and determine at least one second random number seed based on at least one second power-on duration of the target communication module timer; the first power-on duration is not equal to each of the second power-on durations;
[0117] Determine the first random number based on a random function and the first random number seed;
[0118] Based on the random function and each of the second random number seeds, each of the second random numbers is determined.
[0119] Optionally, the first authentication module 520 is specifically configured to:
[0120] Performing a remainder on the first random number to determine a target number of remainders;
[0121] Based on the target modulus times, the target authentication sequence number is determined.
[0122] Optionally, the first authentication module 520 is specifically configured to:
[0123] Taking a remainder of the first random number, determining a remainder corresponding to the first random number, and determining the remainder as an authentication seed;
[0124] Determine the target authentication algorithm corresponding to the target authentication sequence number from a preset algorithm library;
[0125] The authentication seed is input into the target authentication algorithm to determine a first authentication result.
[0126] Optionally, the first determining module 530 is specifically configured to:
[0127] Sending the target authentication sequence number and the recombined random number to the micro control unit simultaneously;
[0128] or,
[0129] Determine the sending order of the target authentication sequence number and the reorganized random number, and send the target authentication sequence number and the reorganized random number to the micro control unit in sequence based on the sending order.
[0130] Optionally, the first receiving module 540 is specifically configured to:
[0131] When the second authentication result is equal to the first authentication result, the authentication result corresponding to the target communication module is determined to be authentication passed, and an enable valid signal corresponding to the target communication module is generated, and the target communication module is an FC-AE-1553 optical fiber communication protocol.
[0132] The embodiment of the present invention further provides a communication authentication device, which is applied to a micro control unit. Figure 6 FIG. 2 is a second structural diagram of a communication authentication device provided in an embodiment of the present invention. Figure 6 As shown, the communication authentication device 600 includes: a second receiving module 610, a second determining module 620, a second authentication module 630 and a sending module 640, wherein:
[0133] The second receiving module 610 is used to receive the data to be authenticated sent by the field programmable gate array FPGA chip, where the data to be authenticated is determined based on the recombined random number and the target authentication sequence number.
[0134] The second determination module 620 is used to determine the target authentication sequence number and the first random number in the recombined random number based on the data to be authenticated, and the target authentication sequence number is the sequence number of the target authentication algorithm corresponding to the first random number.
[0135] The second authentication module 630 is used to determine a second authentication result based on the target authentication sequence number and the first random number.
[0136] The sending module 640 is used to send the second authentication result to the FPGA chip.
[0137] The communication authentication device provided by the embodiment of the present invention, after receiving the data to be authenticated, restores the first random number by reorganizing the random number, improves the target authentication algorithm by the target authentication sequence number, and then calculates the first random number by the target authentication algorithm to obtain the second authentication result, improves the difficulty of cracking the first random number by reorganizing the random number, and improves the flexibility of determining the target authentication algorithm by the target authentication sequence number, thereby improving the difficulty of cracking the data to be authenticated, and thus improving the authentication security of the target communication module.
[0138] Optionally, the second authentication module 630 is specifically configured to:
[0139] Determine the target authentication algorithm corresponding to the target authentication sequence number from a preset algorithm library;
[0140] Taking a remainder of the first random number, and determining the obtained remainder as a new authentication seed;
[0141] The new authentication seed is input into the target authentication algorithm to determine the second authentication result.
[0142] Figure 7 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the communication authentication method, which includes:
[0143] Obtaining a first random number and at least one second random number corresponding to a target communication module;
[0144] Based on the first random number, determine a target authentication sequence number and a first authentication result, wherein the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number;
[0145] Determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit;
[0146] A second authentication result sent by the micro control unit is received, and an authentication result corresponding to the target communication module is determined based on the first authentication result and the second authentication result.
[0147] or,
[0148] Receiving data to be authenticated sent by a field programmable gate array FPGA chip, wherein the data to be authenticated is determined based on a recombined random number and a target authentication sequence number;
[0149] Based on the data to be authenticated, determine the target authentication sequence number and the first random number in the recombined random number, the target authentication sequence number being the sequence number of the target authentication algorithm corresponding to the first random number;
[0150] Determining a second authentication result based on the target authentication sequence number and the first random number;
[0151] Send the second authentication result to the FPGA chip.
[0152] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0153] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the communication authentication method provided by the above methods, the method includes:
[0154] Obtaining a first random number and at least one second random number corresponding to a target communication module;
[0155] Based on the first random number, determine a target authentication sequence number and a first authentication result, wherein the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number;
[0156] Determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit;
[0157] A second authentication result sent by the micro control unit is received, and an authentication result corresponding to the target communication module is determined based on the first authentication result and the second authentication result.
[0158] or,
[0159] Receiving data to be authenticated sent by a field programmable gate array FPGA chip, wherein the data to be authenticated is determined based on a recombined random number and a target authentication sequence number;
[0160] Based on the data to be authenticated, determine the target authentication sequence number and the first random number in the recombined random number, the target authentication sequence number being the sequence number of the target authentication algorithm corresponding to the first random number;
[0161] Determine a second authentication result based on the target authentication sequence number and the first random number;
[0162] Send the second authentication result to the FPGA chip.
[0163] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the communication authentication method provided by the above methods, the method comprising:
[0164] Obtaining a first random number and at least one second random number corresponding to a target communication module;
[0165] Based on the first random number, determine a target authentication sequence number and a first authentication result, wherein the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number;
[0166] Determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit;
[0167] A second authentication result sent by the micro control unit is received, and an authentication result corresponding to the target communication module is determined based on the first authentication result and the second authentication result.
[0168] or,
[0169] Receiving data to be authenticated sent by a field programmable gate array FPGA chip, wherein the data to be authenticated is determined based on a recombined random number and a target authentication sequence number;
[0170] Based on the data to be authenticated, determine the target authentication sequence number and the first random number in the recombined random number, the target authentication sequence number being the sequence number of the target authentication algorithm corresponding to the first random number;
[0171] Determine a second authentication result based on the target authentication sequence number and the first random number;
[0172] Send the second authentication result to the FPGA chip.
[0173] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.< / cstdlib>
Claims
1. A communication authentication method, characterized in that: Applied to a field programmable gate array (FPGA) chip, the method comprises: Obtaining a first random number and at least one second random number corresponding to a target communication module; Based on the first random number, determine a target authentication sequence number and a first authentication result, wherein the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number; Determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit; receiving a second authentication result sent by the micro control unit, and determining an authentication result corresponding to the target communication module based on the first authentication result and the second authentication result; The determining a target authentication sequence number based on the first random number includes: Performing a remainder on the first random number to determine a target number of remainders; Determining the target authentication sequence number based on the target remainder number; Determining a first authentication result based on the first random number includes: Taking a remainder of the first random number, determining a remainder corresponding to the first random number, and determining the remainder as an authentication seed; Determine the target authentication algorithm corresponding to the target authentication sequence number from a preset algorithm library; The authentication seed is input into the target authentication algorithm to determine a first authentication result.
2. The communication authentication method according to claim 1, characterized in that: The step of sending the data to be authenticated to the micro control unit comprises: Sending the target authentication sequence number and the recombined random number to the micro control unit simultaneously; or, Determine the sending order of the target authentication sequence number and the reorganized random number, and send the target authentication sequence number and the reorganized random number to the micro control unit in sequence based on the sending order.
3. The communication authentication method according to claim 1 or 2, characterized in that: The determining, based on the first authentication result and the second authentication result, an authentication result corresponding to the target communication module includes: When the second authentication result is equal to the first authentication result, the authentication result corresponding to the target communication module is determined to be authentication passed, and an enable valid signal corresponding to the target communication module is generated, and the target communication module is an FC-AE-1553 optical fiber communication protocol.
4. The communication authentication method according to claim 1 or 2, characterized in that: The obtaining of a first random number and at least one second random number corresponding to the target communication module includes: Determine a first random number seed based on a first power-on duration of a target communication module timer; and determine at least one second random number seed based on at least one second power-on duration of the target communication module timer; the first power-on duration is not equal to each of the second power-on durations; Determine the first random number based on a random function and the first random number seed; Based on the random function and each of the second random number seeds, each of the second random numbers is determined.
5. A communication authentication method, characterized in that: Applied to a microcontroller unit, the method comprises: Receiving the data to be authenticated sent by the field programmable gate array FPGA chip, wherein the data to be authenticated includes a recombined random number and a target authentication sequence number; Based on the data to be authenticated, determine the target authentication sequence number and the first random number in the recombined random number, the target authentication sequence number being the sequence number of the target authentication algorithm corresponding to the first random number; Determining a second authentication result based on the target authentication sequence number and the first random number; Sending the second authentication result to the FPGA chip; The recombined random number is obtained by recombining a first random number and at least one second random number, and the target authentication sequence number is determined based on the first random number; The determining a second authentication result based on the target authentication sequence number and the first random number includes: Determine the target authentication algorithm corresponding to the target authentication sequence number from a preset algorithm library; Taking a remainder of the first random number, and determining the obtained remainder as a new authentication seed; The new authentication seed is input into the target authentication algorithm to determine the second authentication result.
6. A communication authentication device for implementing the communication authentication method according to any one of claims 1 to 4, characterized in that: Applied to a field programmable gate array (FPGA) chip, the device comprises: An acquisition module, used to acquire a first random number and at least one second random number corresponding to a target communication module; A first authentication module, based on the first random number, determines a target authentication sequence number and a first authentication result, wherein the target authentication sequence number is a sequence number of a target authentication algorithm corresponding to the first random number; A first determination module is used to determine the data to be authenticated based on the target authentication sequence number and the recombined random number obtained by recombining the first random number and the at least one second random number, and send the data to be authenticated to the micro control unit; The first receiving module is used to receive the second authentication result sent by the micro control unit, and determine the authentication result corresponding to the target communication module based on the first authentication result and the second authentication result.
7. A communication authentication device for implementing the communication authentication method according to claim 5, characterized in that: Applied to a microcontroller unit, the device comprises: A second receiving module is used to receive the data to be authenticated sent by the field programmable gate array FPGA chip, wherein the data to be authenticated is determined based on the recombined random number and the target authentication sequence number; A second determination module is used to determine the target authentication sequence number and the first random number in the recombined random number based on the data to be authenticated, wherein the target authentication sequence number is the sequence number of the target authentication algorithm corresponding to the first random number; A second authentication module, configured to determine a second authentication result based on the target authentication sequence number and the first random number; A sending module is used to send the second authentication result to the FPGA chip.
