Encryption algorithm dynamic negotiation method, apparatus and device, and readable storage medium
The dynamic negotiation of encryption algorithms in FTTR systems allows slave devices to inform the master of their supported algorithms, enabling secure encryption selection and key updates, addressing the lack of negotiation methods in existing FTTR systems.
Patent Information
- Application Number
- CN202411385110.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Existing FTTR systems lack a defined method for master and slave devices to negotiate multiple encryption algorithms, necessitating support for both AES128 and national encryption algorithms like SM4, without specifying how devices perceive each other's capabilities and select a common encryption algorithm.
A method and device for dynamic negotiation of encryption algorithms, where slave devices send a target serial number message including their supported encryption algorithms, allowing the master device to select and allocate a target encryption algorithm, and update keys accordingly, enabling encryption and decryption processing.
Effectively negotiates multiple encryption algorithms between master and slave devices without altering the existing interaction process, ensuring secure and adaptable encryption in FTTR systems.
Smart Images

Figure CN119094127A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of FTTR (Fiber to the Room) gateway PON (Passive Optical Network) management technology, and specifically to an encryption algorithm dynamic negotiation method, device, equipment and readable storage medium. Background Art
[0002] At present, FTTR uses a master gateway + N slave gateways to achieve optical fiber access to corridors, rooms, etc. Compared with traditional networking methods, it has the characteristics of strong transmission capacity, higher transmission rate, and longer line life. Therefore, it is widely used in large residential, hotel, small and medium-sized enterprises and other scenarios. Among them, in the traditional GPON (Gigabit-Capable PON, Gigabit Passive Optical Network) / 10GPON system, only the AES128 encryption algorithm is supported to encrypt the service transmission channel gemport (GPONEncapsulation Method port, GPON encapsulation method port); and with the rise of FTTR technology and the promotion of national encryption algorithms (such as SM4 block cipher algorithm), CCSA (China Communications Standards Association) requires FTTR equipment to support encryption algorithms other than AES128 encryption algorithm in the FTTR system specification. Therefore, considering chips, standards and industry reuse, FTTR master-slave gateways and other master-slave devices need to support multiple encryption algorithms such as AES128 and national encryption algorithms at the same time.
[0003] In the related technologies, if you want to realize that the master and slave devices in FTTR support multiple encryption algorithms, not only the PON chip needs to support multiple encryption algorithms, but also the FTTR master and slave device software needs to support encryption algorithm negotiation so that both parties can unify the encryption algorithm; however, the related standards do not define how the master and slave devices can perceive each other's capabilities and complete encryption algorithm negotiation, and select a specified encryption algorithm. Therefore, how to realize the negotiation of multiple encryption algorithms between the master and slave devices in the FTTR system is an urgent problem to be solved in the current FTTR system. Summary of the invention
[0004] The present application provides a method, apparatus, device and readable storage medium for dynamic negotiation of encryption algorithms, which can effectively realize the negotiation of multiple encryption algorithms between master and slave devices.
[0005] In a first aspect, an embodiment of the present application provides a method for dynamic negotiation of an encryption algorithm, wherein the method is applied to a slave device, and the method comprises the following steps:
[0006] When the slave device in the serial number state receives the serial number request message broadcast by the master device, a target serial number message is constructed, wherein the target serial number message includes the serial number of the slave device and the encryption algorithm supported by the slave device;
[0007] Sending the target sequence number message to the master device, so that the master device can decide a target encryption algorithm from the encryption algorithms supported by the slave device based on the target sequence number message, and constructing a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device;
[0008] When a target identifier allocation message sent by the main device is received, the target identifier allocation message is parsed to obtain a target encryption algorithm, so as to implement encryption and decryption processing of the service transmission channel through the target encryption algorithm.
[0009] In combination with the first aspect, in one implementation, the constructing the target sequence number message includes:
[0010] Writing the sequence number byte in the sequence number message according to the sequence number of the slave device, and writing the reserved byte in the sequence number message based on the encryption algorithm supported by the slave device itself to generate a target sequence number message;
[0011] The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
[0012] In combination with the first aspect, in one implementation, when the slave device is in a running state, the method further includes:
[0013] If a target key message sent by the master device is received, the target key message is parsed to obtain an updated encryption algorithm, wherein the target key message is generated by the master device based on the encryption algorithm expected to be used by the user;
[0014] A new key is generated according to the updated encryption algorithm, and the new key is sent to the master device to implement key update between the slave device and the master device.
[0015] In combination with the first aspect, in one implementation, the target key message is generated by the master device based on an encryption algorithm that the user expects to use, including:
[0016] The master device determines an updated encryption algorithm based on the encryption algorithm that the user expects to use, and writes the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message;
[0017] Among them, the slave device determines the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message.
[0018] In a second aspect, an embodiment of the present application provides an encryption algorithm dynamic negotiation device, including a slave device, wherein the slave device is used to:
[0019] When the slave device in the serial number state receives the serial number request message broadcast by the master device, a target serial number message is constructed, wherein the target serial number message includes the serial number of the slave device and the encryption algorithm supported by the slave device;
[0020] Sending the target sequence number message to the master device, so that the master device can decide a target encryption algorithm from the encryption algorithms supported by the slave device based on the target sequence number message, and constructing a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device;
[0021] When a target identifier allocation message sent by the main device is received, the target identifier allocation message is parsed to obtain a target encryption algorithm, so as to implement encryption and decryption processing of the service transmission channel through the target encryption algorithm.
[0022] In conjunction with the second aspect, in one implementation, the slave device is specifically configured to:
[0023] Writing the sequence number byte in the sequence number message according to the sequence number of the slave device, and writing the reserved byte in the sequence number message based on the encryption algorithm supported by the slave device itself to generate a target sequence number message;
[0024] The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
[0025] In conjunction with the second aspect, in one implementation, when the slave device is in a running state, the slave device is further used to:
[0026] If a target key message sent by the master device is received, the target key message is parsed to obtain an updated encryption algorithm, wherein the target key message is generated by the master device based on the encryption algorithm expected to be used by the user;
[0027] A new key is generated according to the updated encryption algorithm, and the new key is sent to the master device to implement key update between the slave device and the master device.
[0028] In conjunction with the second aspect, in one implementation, the master device is specifically configured to:
[0029] Determine an updated encryption algorithm based on the encryption algorithm that the user expects to use, and write the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message;
[0030] Among them, the slave device determines the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message.
[0031] In a third aspect, an embodiment of the present application provides a method for dynamic negotiation of an encryption algorithm, wherein the method for dynamic negotiation of an encryption algorithm is applied to a master device, and the method comprises the following steps:
[0032] Send a serial number request message to the slave device by broadcasting;
[0033] When receiving a target sequence number message sent by a slave device in a sequence number state based on a sequence number request message, determining a target encryption algorithm from encryption algorithms supported by the slave device based on the sequence number message, the target sequence number message being generated by the slave device based on its sequence number and the encryption algorithm supported by the slave device;
[0034] A target identifier allocation message is constructed according to the target encryption algorithm and the target identifier allocated to the slave device, so that the slave device can parse the target identifier allocation message to obtain the target encryption algorithm and implement encryption and decryption processing of the service transmission channel based on the target encryption algorithm.
[0035] In conjunction with the third aspect, in one implementation, constructing a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device includes:
[0036] Writing an identifier byte in an identifier allocation message according to a target identifier allocated to the slave device, and writing a reserved byte in the identifier allocation message according to the target encryption algorithm to generate a target identifier allocation message;
[0037] Among them, the slave device determines the target encryption algorithm decided by the master device through the value of the reserved byte in the target identifier allocation message.
[0038] In conjunction with the third aspect, in one implementation, the target sequence number message is generated by the slave device based on its sequence number and an encryption algorithm supported by the slave device, including:
[0039] The slave device writes the sequence number byte in the sequence number message according to its sequence number, and writes the reserved byte in the sequence number message based on the encryption algorithm supported by itself to generate a target sequence number message;
[0040] The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
[0041] In conjunction with the third aspect, in one implementation, the method further includes:
[0042] Determine an updated encryption algorithm based on the encryption algorithm that the user expects to use, and write the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message;
[0043] Sending the target key message to the slave device, so that the slave device in operation can determine the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message, and generate a new key according to the updated encryption algorithm;
[0044] When the new key sent from the device is received, the key is updated based on the new key.
[0045] In a fourth aspect, an embodiment of the present application provides an encryption algorithm dynamic negotiation device, including a main device, wherein the main device is used to:
[0046] Send a serial number request message to the slave device by broadcasting;
[0047] When receiving a target sequence number message sent by a slave device in a sequence number state based on a sequence number request message, determining a target encryption algorithm from encryption algorithms supported by the slave device based on the sequence number message, the target sequence number message being generated by the slave device based on its sequence number and the encryption algorithm supported by the slave device;
[0048] A target identifier allocation message is constructed according to the target encryption algorithm and the target identifier allocated to the slave device, so that the slave device can parse the target identifier allocation message to obtain the target encryption algorithm and implement encryption and decryption processing of the service transmission channel based on the target encryption algorithm.
[0049] In conjunction with the fourth aspect, in one implementation, the master device is specifically configured to:
[0050] Writing an identifier byte in an identifier allocation message according to a target identifier allocated to the slave device, and writing a reserved byte in the identifier allocation message according to the target encryption algorithm to generate a target identifier allocation message;
[0051] Among them, the slave device determines the target encryption algorithm decided by the master device through the value of the reserved byte in the target identifier allocation message.
[0052] In conjunction with the fourth aspect, in one implementation, the slave device is specifically used for:
[0053] Write the sequence number byte in the sequence number message according to its sequence number, and write the reserved byte in the sequence number message based on the encryption algorithm supported by itself to generate a target sequence number message;
[0054] The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
[0055] In conjunction with the fourth aspect, in one implementation, the master device is further configured to:
[0056] Determine an updated encryption algorithm based on the encryption algorithm that the user expects to use, and write the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message;
[0057] Sending the target key message to the slave device, so that the slave device in operation can determine the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message, and generate a new key according to the updated encryption algorithm;
[0058] When the new key sent from the device is received, the key is updated based on the new key.
[0059] In a fifth aspect, an embodiment of the present application provides an encryption algorithm dynamic negotiation device, which includes a processor, a memory, and an encryption algorithm dynamic negotiation program stored in the memory and executable by the processor, wherein when the encryption algorithm dynamic negotiation program is executed by the processor, the steps of the encryption algorithm dynamic negotiation method as described above are implemented.
[0060] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a dynamic negotiation program for an encryption algorithm is stored, wherein when the dynamic negotiation program for an encryption algorithm is executed by a processor, the steps of the dynamic negotiation method for an encryption algorithm as described above are implemented.
[0061] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0062] The slave device in the serial number state informs the master device of the multiple encryption algorithms it supports by constructing a target serial number message including the serial number of the slave device and the encryption algorithm supported by the slave device, so that the master device can decide the target encryption algorithm from the multiple encryption algorithms it supports based on the target serial number message, and construct a target identifier allocation message according to the target encryption algorithm, so as to inform the slave device of the encryption algorithm it has decided through the identifier allocation message, so that the slave device can learn the target encryption algorithm decided by the master device after parsing the identifier allocation message, and use the target encryption algorithm as the result of the negotiation between the two parties to encrypt and decrypt the service transmission channel. Through this application, the negotiation of multiple encryption algorithms between the master and slave devices can be effectively realized without changing the existing interaction process. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1This is a flowchart of the first embodiment of the dynamic negotiation method for encryption algorithms of the present application;
[0064] Figure 2 This is a flow chart of the second embodiment of the dynamic negotiation method for encryption algorithms of the present application;
[0065] Figure 3 A schematic diagram of the encryption algorithm negotiation process involved in the embodiment of the present application;
[0066] Figure 4 A schematic diagram of a key update process involved in an embodiment of the present application;
[0067] Figure 5 This is a schematic diagram of the hardware structure of the encryption algorithm dynamic negotiation device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0068] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0069] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0070] In a first aspect, an embodiment of the present application provides a method for dynamic negotiation of encryption algorithms.
[0071] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the dynamic negotiation method for encryption algorithms of this application. Figure 1 As shown, the encryption algorithm dynamic negotiation method is applied to a slave device, and the method includes the following steps:
[0072] Step S10: When the slave device in the serial number state receives the serial number request message broadcast by the master device, it constructs a target serial number message, wherein the target serial number message includes the serial number of the slave device and the encryption algorithm supported by the slave device.
[0073] Exemplarily, it should be noted that the encryption algorithm dynamic negotiation method provided in this embodiment is not only applicable to the encryption algorithm dynamic negotiation between the FTTR main gateway (Main FTTR Unit, MFU) and the slave gateway (Sub FTTR Unit, SFU) of the GPON / 10GPON system, but also applicable to the GPON / 10GPON system based on OLT (Optical Line Terminal) and ONU (Optical Network Unit) to realize the encryption algorithm dynamic negotiation between OLT and ONU; therefore, the slave device in this embodiment can be either a slave gateway or an ONU, and similarly, the master device can be either a master gateway or an OLT; however, it should be understood that if the master device is a master gateway, the slave device should be a slave gateway, and if the master device is an OLT, the slave device should be an ONU. In addition, since the processes and principles of the dynamic negotiation of encryption algorithms in the above two scenarios are similar, for the sake of simplicity of description, the subsequent embodiments will take the master device as the master gateway MFU and the slave device as the slave gateway SFU as an example to explain the process and principle of the dynamic negotiation of encryption algorithms between master and slave devices.
[0074] It can be understood that the FTTR GPON / 10GPON system protocol stack is mainly composed of the physical layer (PHY) and the data link layer (DLL), and the DLL layer includes two sublayers: the framing sublayer and the service adaptation sublayer; among them, the service adaptation sublayer is responsible for the encapsulation, multiplexing and delimitation of upper-layer user services and management messages, while the framing sublayer is responsible for the processing of PLOAM (Physical Layer OAM, which is a physical layer OAM (Operation, Administration and Maintenance) message), performance monitoring, key management, energy saving management and framing of DLL frames or DLL bursts.
[0075] In this embodiment, for the FTTR master gateway and slave gateway of the GPON / 10GPON system, the encryption algorithm negotiation between the master and slave gateways is realized by extending the PLOAM message between the GPON / 10GPON master and slave gateways, and the gemport channel is encrypted and decrypted based on the negotiated encryption algorithm. Among them, when the PLOAM message of the framing sublayer is extended in this embodiment, the extended message includes the serial number message Serial_Number_SFU corresponding to the uplink message (i.e., the message sent from the gateway SFU to the master gateway MFU) and the identifier assignment message Assign_SFU-ID corresponding to the downlink message (i.e., the message sent from the master gateway MFU to the slave gateway SFU).
[0076] It should be understood that the slave gateway SFU will experience the following 7 states from power-on: O1 initial state, O2 standby state, O3 sequence number state, O4 ranging state, O5 running state, O6 POPUP state and O7 emergency stop state; the activation of the slave gateway SFU includes three stages: downlink synchronization stage, sequence number acquisition stage (i.e. SFU discovery stage) and ranging stage (optional), and the activation of the slave gateway SFU involves four states: O1 initial state, O2 standby state, O3 sequence number state and O4 ranging state. Among them, this embodiment will implement the negotiation of the encryption algorithm in the sequence number acquisition stage (i.e. the slave gateway SFU is in the O3 sequence number state).
[0077] Specifically, the master gateway MFU will periodically broadcast a serial number request message to the slave gateway SFU; and the serial number message Serial_Number_SFU is used by the slave gateway SFU in the serial number state to respond to the serial number request periodically broadcast by the master gateway MFU. The message contains the serial number of the slave gateway SFU, so that after the master gateway MFU receives the Serial_Number_SFU message, it can obtain the serial number of the slave gateway SFU and allocate an unused identifier SFU-ID to the slave gateway SFU. Therefore, when the slave gateway SFU receives the serial number request message broadcast by the master gateway MFU in the serial number acquisition phase, it will respond to the serial number request periodically broadcast by the master gateway MFU by sending the serial number message Serial_Number_SFU, that is, by responding to the serial number authorization to declare its existence in the FTTR system, so as to inform the master gateway MFU that it expects to join the FTTR network. It should be noted that the serial number authorization is an allocation structure whose purpose is to broadcast Alloc-ID and mark the PLOAMu identification set; wherein Alloc-ID (Allocation Identifier) represents the allocation identifier, which is used to identify the service bearer entity that is the recipient of the uplink bandwidth allocation from the gateway SFU; PLOAMu represents the uplink PLOAM message.
[0078] It should be understood that when the slave gateway SFU writes its serial number into the serial number message Serial_Number_SFU to respond to the serial number request broadcast by the master gateway MFU, it is also necessary to write the encryption algorithm supported by itself into the serial number message Serial_Number_SFU to achieve the construction of the target serial number message; and send the target serial number message to the master gateway MFU, so that the master gateway MFU can learn the encryption algorithm supported by the slave gateway SFU through the target serial number message. It should be noted that the encryption algorithms supported by the slave gateway SFU include but are not limited to the AES128 encryption algorithm, national encryption SM1, SM2, SM3, SM4 and homomorphic encryption.
[0079] Furthermore, in one embodiment, the constructing the target sequence number message includes:
[0080] Writing the sequence number byte in the sequence number message according to the sequence number of the slave device, and writing the reserved byte in the sequence number message based on the encryption algorithm supported by the slave device itself to generate a target sequence number message;
[0081] The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
[0082] Exemplarily, in this embodiment, the slave gateway SFU will report the encryption algorithms it supports to the master gateway MFU through the target serial number message. Specifically, after the slave gateway SFU receives the serial number authorization broadcast message sent by the master gateway MFU in the O2-O3 state, it writes its own serial number into the serial number message Serial_Number_SFU to announce its existence to the master gateway MFU by replying to the serial number message Serial_Number_SFU; at the same time, it needs to write the encryption algorithms it supports into the reserved bytes in the serial number message Serial_Number_SFU to generate the target serial number message, that is, this embodiment will extend the use of the reserved bytes in the serial number message Serial_Number_SFU to report the encryption algorithms currently supported by the slave gateway SFU to the master gateway MFU.
[0083] It should be noted that if the FTTR is a GPON system, as shown in Table 1, the last two bits of the 12th byte reserved in the serial number message Serial_Number_SFU can be preferably extended, that is, the two extended bits are used to report the encryption algorithm currently supported by the gateway SFU, and each bit represents an encryption algorithm, so two encryption algorithms E1 and E2 can be extended; for example, "01" indicates support for encryption algorithm E1, "10" indicates support for encryption algorithm E2, and "11" indicates support for encryption algorithms E1, E2 and the default AES128 encryption algorithm at the same time, and "00" indicates support for only the default AES128 encryption algorithm.
[0084] Table 1 Serial_Number_SFU message extension in GPON system
[0085]
[0086] Therefore, as shown in Table 1, the slave gateway SFU can set the value of the last two bits of the 12th byte in the serial number message Serial_Number_SFU according to the encryption algorithm it supports. For example, if the slave gateway SFU only extends one encryption algorithm E1, the last two bits of the 12th byte are "01". If two encryption algorithms E1 and E2 need to be extended, the last two bits of the 12th byte are "11". If the encryption algorithm does not need to be extended, that is, the default AES128 algorithm is used for encryption and decryption between the master gateway MFU and the slave gateway SFU, the last two bits of the 12th byte are "00", and then the target serial number message is generated, so that the master gateway MFU can determine the encryption algorithm type supported by the slave gateway SFU through the values of the two bits of the reserved bytes in the target serial number message.
[0087] If the FTTR is a 10GPON system, as shown in Table 2, it is preferred to extend the 8 bits of any reserved bytes from 17 to 36 and 38 to 40 in the serial number message Serial_Number_SFU, and each bit represents an encryption algorithm, so 8 encryption algorithms E1 to E8 can be extended, and the corresponding bit position 1 indicates that the slave gateway SFU supports the encryption algorithm. Therefore, if the extended bits are all set to 1, it means that the slave gateway SFU can support 8 encryption algorithms while supporting the default AES128 encryption algorithm; for example, "0000001" indicates support for encryption algorithm E1, "00000011" indicates support for encryption algorithms E1 and E2, and so on, "11111111" indicates support for encryption algorithms E1 to E8 and the default AES128 encryption algorithm, and "00000000" indicates support for only the default AES128 encryption algorithm.
[0088] Table 2 Serial_Number_SFU message extension in 10GPON system
[0089]
[0090]
[0091] Therefore, as shown in Table 2, the slave gateway SFU can set the value of the 8 bits of the reserved bytes in the serial number message Serial_Number_SFU according to the encryption algorithm supported by itself; for example, if the slave gateway SFU only extends one encryption algorithm E1, the 40th byte is set to "00000001"; if two encryption algorithms E1 and E2 need to be extended, the 40th byte is set to "00000011", and so on. If E1 to E8 need to be extended, the 40th byte is set to "11111111", and if the encryption algorithm does not need to be extended, that is, the default AES128 algorithm is used for encryption and decryption between the master gateway MFU and the slave gateway SFU, the 40th byte is set to "00000000", and then the target serial number message is generated, so that the master gateway MFU can determine the encryption algorithm type supported by the slave gateway SFU through the value of the 8 bits of the reserved bytes in the target serial number message.
[0092] Step S20: Send the target sequence number message to the master device, so that the master device can decide the target encryption algorithm from the encryption algorithms supported by the slave device based on the target sequence number message, and construct a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device.
[0093] Exemplarily, in this embodiment, after the slave gateway SFU completes the construction of the target sequence number message, it will send the target sequence number message to the master gateway MFU, so that the master gateway MFU can learn the encryption algorithm supported by the slave gateway SFU after parsing the target sequence number message; then the master gateway MFU will randomly select one of the encryption algorithms supported by the slave gateway SFU or select the corresponding encryption algorithm from the encryption algorithms supported by the slave gateway SFU according to pre-specified requirements as the target encryption algorithm of both parties; then the value of the reserved byte in the identifier assignment message Assign_SFU-ID is set according to the decided target encryption algorithm type, and at the same time, the unique target identifier assigned to the slave gateway SFU is written into the identifier assignment message Assign_SFU-ID to generate a target identifier assignment message, and the target identifier assignment message is sent to the slave gateway SFU.
[0094] Step S30: When receiving the target identifier allocation message sent by the master device, the target identifier allocation message is parsed to obtain a target encryption algorithm, so as to implement encryption and decryption processing of the service transmission channel through the target encryption algorithm.
[0095] Exemplarily, in this embodiment, after the slave gateway SFU receives the target identifier allocation message sent by the master gateway MFU, the corresponding reserved bytes in the target identifier allocation message will be parsed to obtain the negotiated encryption algorithm (i.e., the target encryption algorithm) returned by the master gateway MFU, so that the encryption algorithm can be used between the slave gateway SFU and the master gateway MFU to encrypt and decrypt the gemport channel. It can be seen that this embodiment can effectively realize the negotiation of multiple encryption algorithms between the master and slave gateways without changing the existing interaction process.
[0096] Furthermore, in one embodiment, when the slave device is in a running state, the method further includes:
[0097] If a target key message sent by the master device is received, the target key message is parsed to obtain an updated encryption algorithm, wherein the target key message is generated by the master device based on the encryption algorithm expected to be used by the user;
[0098] A new key is generated according to the updated encryption algorithm, and the new key is sent to the master device to implement key update between the slave device and the master device.
[0099] Exemplarily, during the lifetime of the slave gateway SFU connection, that is, when the slave gateway SFU is in operation, if the user modifies the encryption method through configuration, this embodiment will change the encryption algorithm between the master gateway MFU and the slave gateway SUF by expanding the key message periodically sent by the master gateway MFU to trigger the slave gateway SFU to generate a new key and send the new key to the master gateway MFU.
[0100] Specifically, when the user presets the encryption algorithm used by the gemport channel in the FTTR GPON / 10GPON system by configuration on the master gateway MFU (the encryption algorithm is the encryption algorithm that the user expects to use), the master gateway MFU writes the encryption algorithm that the user expects to use as the updated encryption algorithm into the key message (such as the Request_Key in the GPON system or the Key_Control message in the 10GPON system) to generate a target key message; then the target key message is sent to the slave gateway SFU, so that the slave gateway SFU can learn the updated encryption algorithm newly decided by the master gateway MFU after parsing the target key message, and generate a new key according to the updated encryption algorithm, and reply to the master gateway MFU with the new key through a message, thereby realizing the key update between the slave gateway and the master gateway, so that the master and slave gateways can subsequently use the new encryption algorithm and key for encryption and decryption.
[0101] It should be noted that for the 10GPON system, the slave gateway SFU can reply the new key of the master gateway MFU through the Key_Report message; and for the GPON system, the slave gateway SFU can reply the new key of the master gateway MFU through the Encryption_Key message.
[0102] Furthermore, in one embodiment, the target key message is generated by the master device based on an encryption algorithm that the user expects to use, and includes:
[0103] The master device determines an updated encryption algorithm based on the encryption algorithm that the user expects to use, and writes the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message;
[0104] Among them, the slave device determines the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message.
[0105] Exemplarily, in this embodiment, since the encryption algorithm that the user expects to use may be the same as or different from the encryption algorithm currently used by the system, the master gateway MFU needs to match the encryption algorithm that the user expects to use configured by the user with the encryption algorithm currently used by the system; if they are the same, the key update process is not triggered; if they are different, the encryption algorithm that the user expects to use is written into the reserved bytes of the key message as the updated encryption algorithm to generate a target key message. That is, this embodiment will extend the use of the reserved bytes in the key message to inform the slave gateway SFU of the updated encryption algorithm of the master gateway MFU.
[0106] It should be noted that in the GPON system, as shown in Table 3, the lower 2 bits of the 3rd byte of the key message Request_Key can be preferably extended, that is, the extended lower 2 bits are used to inform the slave gateway SFU of the updated encryption algorithm currently selected; for example, "01" indicates that the main gateway MFU selects encryption algorithm E1, "10" indicates that the main gateway MFU selects encryption algorithm E2, and "00" indicates that the main gateway MFU selects the default AES128 encryption algorithm.
[0107] Table 3 Request_Key message extension in GPON system
[0108]
[0109] Therefore, the main gateway MFU can set the value of the lower 2 bits of the third byte in the key message Request_Key according to the decided updated encryption algorithm to generate a target key message, so that the slave gateway SFU can determine the updated encryption algorithm that both parties need to use together through the value of the lower 2 bits of the reserved bytes in the target key message. That is, after receiving the Request_Key message, the slave gateway SFU parses the new encryption method from the message. If the encryption algorithm has changed, the new encryption algorithm is used to generate a new key, and the main gateway MFU is replied through the Encryption Key message.
[0110] In the 10GPON system, as shown in Table 4, the lower 4 bits of the 5th byte of the key message Key_Control may be preferably extended, that is, the extended lower 4 bits are used to inform the slave gateway SFU of the updated encryption algorithm currently selected; wherein, the lower 4 bits may be given different values according to binary to represent the different selected encryption algorithms, but the actual corresponding relationship between the lower 4 bits and the different encryption algorithms may be determined according to actual needs and is not limited here. For example, "0001" indicates that the master gateway MFU selects the encryption algorithm E1, and "00 "10" means that the main gateway MFU selects encryption algorithm E2, "0011" means that the main gateway MFU selects encryption algorithm E3, "0100" means that the main gateway MFU selects encryption algorithm E4, "0101" means that the main gateway MFU selects encryption algorithm E5, "0110" means that the main gateway MFU selects encryption algorithm E6, "0111" means that the main gateway MFU selects encryption algorithm E7, "1000" means that the main gateway MFU selects encryption algorithm E8, and "0000" means that the main gateway MFU selects the default AES128 encryption algorithm.
[0111] It should be noted that the extended lower 4 bits need to be used together with the value of byte 6 in the key message Key_Control, where the value of the 6th byte has the following two situations: (1) generate and send a new key, (2) confirm the existing key; if the master gateway MFU needs to modify the existing encryption algorithm, the 6th byte takes the value of "generate and send a new key", that is, C = 0, to require the slave gateway SFU to generate a new key according to the encryption algorithm of the extended 5th byte, and inform the slave gateway SFU of the new encryption algorithm through the extended byte; if the master gateway MFU does not need to modify the existing encryption algorithm, the 6th byte takes the value of "confirm the existing key", that is, C = 1, so that the slave gateway SFU does not need to generate a new key according to the encryption algorithm of the extended 5th byte, but only informs the slave gateway SFU of the new encryption algorithm through the extended byte. Therefore, after receiving the Key_Control message, the slave gateway SFU can parse the new encryption method from the message. If the encryption algorithm has changed, the new encryption algorithm is used to generate a new key, and the master gateway MFU is replied through the Encryption Key message.
[0112] Table 4 Key Control message extension in 10GPON system
[0113]
[0114] In a second aspect, an embodiment of the present application also provides an encryption algorithm dynamic negotiation device.
[0115] In one embodiment, the encryption algorithm dynamic negotiation apparatus includes a slave device, wherein the slave device is used to:
[0116] When the slave device in the serial number state receives the serial number request message broadcast by the master device, a target serial number message is constructed, wherein the target serial number message includes the serial number of the slave device and the encryption algorithm supported by the slave device;
[0117] Sending the target sequence number message to the master device, so that the master device can decide a target encryption algorithm from the encryption algorithms supported by the slave device based on the target sequence number message, and constructing a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device;
[0118] When a target identifier allocation message sent by the main device is received, the target identifier allocation message is parsed to obtain a target encryption algorithm, so as to implement encryption and decryption processing of the service transmission channel through the target encryption algorithm.
[0119] Furthermore, in one embodiment, the slave device is specifically used for:
[0120] Writing the sequence number byte in the sequence number message according to the sequence number of the slave device, and writing the reserved byte in the sequence number message based on the encryption algorithm supported by the slave device itself to generate a target sequence number message;
[0121] The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
[0122] Furthermore, in one embodiment, when the slave device is in a running state, the slave device is further used to:
[0123] If a target key message sent by the master device is received, the target key message is parsed to obtain an updated encryption algorithm, wherein the target key message is generated by the master device based on the encryption algorithm expected to be used by the user;
[0124] A new key is generated according to the updated encryption algorithm, and the new key is sent to the master device to implement key update between the slave device and the master device.
[0125] Furthermore, in one embodiment, the master device is specifically used for:
[0126] Determine an updated encryption algorithm based on the encryption algorithm that the user expects to use, and write the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message;
[0127] Among them, the slave device determines the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message.
[0128] Among them, the functional implementation of each module in the above-mentioned encryption algorithm dynamic negotiation device corresponds to the various steps in the above-mentioned encryption algorithm dynamic negotiation method embodiment, and its functions and implementation processes are no longer repeated here one by one.
[0129] On the third aspect, the embodiment of the present application also provides another method for dynamic negotiation of encryption algorithms.
[0130] In one embodiment, referring to Figure 2 , Figure 2 This is a flow chart of the second embodiment of the dynamic negotiation method for encryption algorithms of this application. Figure 2 As shown, the encryption algorithm dynamic negotiation method is applied to the master device, and the method includes the following steps:
[0131] Step N10: Send a serial number request message to the slave device by broadcasting.
[0132] For example, it should be noted that the encryption algorithm dynamic negotiation method provided in this embodiment is not only applicable to the dynamic negotiation of encryption algorithms between the FTTR master gateway and the slave gateway of the GPON / 10GPON system, but also applicable to the GPON / 10GPON system based on OLT and ONU, so as to realize the dynamic negotiation of encryption algorithms between OLT and ONU; therefore, the slave device in this embodiment can be either a slave gateway or an ONU, and similarly, the master device can be either a master gateway or an OLT; however, it should be understood that if the master device is a master gateway, the slave device should be a slave gateway, and if the master device is an OLT, the slave device should be an ONU. In addition, since the processes and principles of the dynamic negotiation of encryption algorithms in the above two scenarios are similar, for the sake of simplicity of description, the subsequent embodiments will take the case where the master device is the master gateway MFU and the slave device is the slave gateway SFU as an example to explain the process and principle of the dynamic negotiation of encryption algorithms between the master and slave devices.
[0133] It should be understood that when the slave gateway SFU is in the serial number state, if the user has not configured the encryption algorithm on the master gateway MFU, there is no need to trigger the encryption algorithm negotiation process; if the user presets the encryption algorithm used by the gemport channel in the FTTR GPON / 10GPON system through configuration on the master gateway MFU, the master gateway MFU will periodically send a serial number request message to the slave gateway SFU via a broadcast message, so that the slave gateway SFU in the serial number state receives the message.
[0134] Step N20: When a target sequence number message is received from a slave device in a sequence number state based on a sequence number request message, a target encryption algorithm is determined from the encryption algorithms supported by the slave device based on the sequence number message. The target sequence number message is generated by the slave device based on its sequence number and the encryption algorithm supported by itself.
[0135] Exemplarily, it can be understood that the serial number message Serial_Number_SFU is used by the slave gateway SFU in the serial number state to respond to the serial number request periodically broadcast by the master gateway MFU. The message contains the serial number of the slave gateway SFU, so that after the master gateway MFU receives the Serial_Number_SFU message, it can obtain the serial number of the slave gateway SFU and allocate an unused identifier SFU-ID to the slave gateway SFU. Therefore, when the slave gateway SFU receives the serial number request message broadcast by the master gateway MFU in the serial number acquisition phase, it will respond to the serial number request periodically broadcast by the master gateway MFU by sending the serial number message Serial_Number_SFU, that is, by responding to the serial number authorization to declare its existence in the FTTR system, so as to inform the master gateway MFU that it expects to join the FTTR network.
[0136] It should be noted that when the slave gateway SFU writes its serial number into the serial number message Serial_Number_SFU to respond to the serial number request broadcast by the master gateway MFU, it is also necessary to write the encryption algorithm supported by itself into the serial number message Serial_Number_SFU to realize the construction of the target serial number message, and send the target serial number message to the master gateway MFU; when the master gateway receives the target serial number message, it will parse the target serial number message to learn the encryption algorithm supported by the slave gateway SFU; then the master gateway MFU will randomly select one of the encryption algorithms supported by the slave gateway SFU or select the corresponding encryption algorithm from the encryption algorithms supported by the slave gateway SFU according to pre-specified requirements as the target encryption algorithm of both parties. It should be understood that the encryption algorithms supported by the slave gateway SFU include but are not limited to the AES128 encryption algorithm, national encryption SM1, SM2, SM3, SM4 and homomorphic encryption.
[0137] Furthermore, in one embodiment, the target sequence number message is generated by the slave device based on its sequence number and an encryption algorithm supported by the slave device, including:
[0138] The slave device writes the sequence number byte in the sequence number message according to its sequence number, and writes the reserved byte in the sequence number message based on the encryption algorithm supported by itself to generate a target sequence number message;
[0139] The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
[0140] Exemplarily, in this embodiment, the slave gateway SFU will report the encryption algorithms it supports to the master gateway MFU through the target serial number message. Specifically, after the slave gateway SFU receives the serial number authorization broadcast message sent by the master gateway MFU in the O2-O3 state, it writes its own serial number into the serial number message Serial_Number_SFU to announce its existence to the master gateway MFU by replying to the serial number message Serial_Number_SFU; at the same time, the encryption algorithm it supports is written into the reserved bytes in the serial number message Serial_Number_SFU to generate the target serial number message, that is, this embodiment will extend the use of the reserved bytes in the serial number message Serial_Number_SFU to report the encryption algorithm currently supported by the slave gateway SFU to the master gateway MFU.
[0141] It should be noted that if the FTTR is a GPON system, as shown in the aforementioned Table 1, the last two bits of the 12th byte reserved in the serial number message Serial_Number_SFU can be preferably extended, that is, the two extended bits are used to report the encryption algorithm currently supported by the gateway SFU, and each bit represents an encryption algorithm, so two encryption algorithms E1 and E2 can be extended; for example, "01" indicates support for encryption algorithm E1, "10" indicates support for encryption algorithm E2, and "11" indicates support for encryption algorithms E1, E2 and the default AES128 encryption algorithm at the same time, and "00" indicates support for only the default AES128 encryption algorithm.
[0142] Therefore, the slave gateway SFU can set the value of the last two bits of the 12th byte in the serial number message Serial_Number_SFU according to the encryption algorithm it supports. For example, if the slave gateway SFU only extends one encryption algorithm E1, the last two bits of the 12th byte are "01". If two encryption algorithms E1 and E2 need to be extended, the last two bits of the 12th byte are "11". If the encryption algorithm does not need to be extended, that is, the default AES128 algorithm is used for encryption and decryption between the master gateway MFU and the slave gateway SFU, the last two bits of the 12th byte are "00", and then the target serial number message is generated, so that the master gateway MFU can determine the encryption algorithm type supported by the slave gateway SFU through the values of the two bits of the reserved bytes in the target serial number message.
[0143] If the FTTR is a 10GPON system, as shown in the aforementioned Table 2, it is preferred to extend the 8 bits of any reserved bytes from 17 to 36 and 38 to 40 in the serial number message Serial_Number_SFU, and each bit represents an encryption algorithm, then 8 encryption algorithms E1 to E8 can be extended, and the corresponding bit position 1 indicates that the slave gateway SFU supports the encryption algorithm. Therefore, if the extended bits are all set to 1, it means that the slave gateway SFU can support 8 encryption algorithms while supporting the default AES128 encryption algorithm; for example, "0000001" indicates support for encryption algorithm E1, "00000011" indicates support for encryption algorithms E1 and E2, and so on, "11111111" indicates support for encryption algorithms E1 to E8 and the default AES128 encryption algorithm, and "00000000" indicates support for only the default AES128 encryption algorithm.
[0144] Therefore, the slave gateway SFU can set the value of the 8 bits of the reserved bytes in the serial number message Serial_Number_SFU according to the encryption algorithm it supports; for example, if the slave gateway SFU only extends one encryption algorithm E1, the 40th byte is set to "00000001"; if two encryption algorithms E1 and E2 need to be extended, the 40th byte is set to "00000011", and so on. If E1 to E8 need to be extended, the 40th byte is set to "11111111", and if the encryption algorithm does not need to be extended, that is, the default AES128 algorithm is used for encryption and decryption between the master gateway MFU and the slave gateway SFU, the 40th byte is set to "00000000", and then the target serial number message is generated, so that the master gateway MFU can determine the encryption algorithm type supported by the slave gateway SFU through the value of the 8 bits of the reserved bytes in the target serial number message.
[0145] Step N30: construct a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device, so that the slave device can parse the target identifier allocation message to obtain the target encryption algorithm and implement encryption and decryption processing of the service transmission channel based on the target encryption algorithm.
[0146] Exemplarily, in this embodiment, the master gateway MFU will set the value of the reserved byte in the identifier assignment message Assign_SFU-ID according to the target encryption algorithm type decided by it, and write the unique target identifier assigned to the slave gateway SFU into the identifier assignment message Assign_SFU-ID to generate a target identifier assignment message, and send the target identifier assignment message to the slave gateway SFU. After the slave gateway SFU receives the target identifier assignment message sent by the master gateway MFU, it will parse the corresponding reserved bytes in the target identifier assignment message to obtain the negotiated encryption algorithm (i.e., the target encryption algorithm) returned by the master gateway MFU, and will subsequently use the target encryption algorithm to encrypt and decrypt the gemport channel. It can be seen that this embodiment can effectively realize the negotiation of multiple encryption algorithms between the master and slave gateways without changing the existing interaction process.
[0147] In summary, in the existing PLOAM message interaction process between the master gateway MFU and the slave gateway SFU in FTTR, this embodiment implements the negotiation of encryption algorithms in the FTTR system by extending the existing messages. Not only does it not need to change the existing interaction process, but it also adds support for multiple encryption algorithms and dynamically negotiated encryption algorithms for gemport channels, meeting the need for coexistence of multiple keys, thereby improving product compatibility and the flexibility of encryption method selection. In addition, by negotiating encryption algorithms and starting encryption functions before activating the slave gateway, the security of the device is improved; at the same time, this embodiment implements a chip that takes into account the different encryption requirements of traditional PON gateways and FTTR gateways, which can maximize investment protection and reduce chip costs.
[0148] Further, in one embodiment, constructing a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device includes:
[0149] Writing an identifier byte in an identifier allocation message according to a target identifier allocated to the slave device, and writing a reserved byte in the identifier allocation message according to the target encryption algorithm to generate a target identifier allocation message;
[0150] Among them, the slave device determines the target encryption algorithm decided by the master device through the value of the reserved byte in the target identifier allocation message.
[0151] Exemplarily, it can be understood that the master gateway MFU discovers a newly added slave gateway SFU through the serial number of the slave gateway SFU, and assigns a unique identifier SFU-ID to the slave gateway SFU; wherein, the SFU-ID is an 8-bit or 10-bit identifier assigned to the slave gateway SFU by the master gateway MFU using the identifier assignment message Assign_SFU-ID during the activation of the slave gateway SFU, which is unique in a specific optical distribution network; when the slave gateway SFU enters the initial state of the activation state machine, it will discard the previously assigned SFU-ID and all related data link layer configuration assignments. It can be seen that the identifier assignment message Assign_SFU-ID is a message triggered when the master gateway MFU discovers the serial number of a slave gateway SFU, that is, after receiving the Serial_Number_SFU message sent by the slave gateway SFU, which will cause the master gateway MFU to assign an unused target identifier SFU-ID to the slave gateway SFU and bind it to the serial number of the slave gateway SFU. Therefore, in this embodiment, the encryption algorithm used between the master gateway MFU and the slave gateway SFU will be confirmed through the extended identifier assignment message Assign_SFU-ID, that is, the master gateway MFU will reply to the slave gateway SFU through the target identifier assignment message with the target encryption algorithm that both parties need to use together.
[0152] Specifically, after receiving the target serial number message sent by the slave gateway SFU, the master gateway MFU will assign a unique target identifier to the slave gateway SFU and write the target identifier into the identifier assignment message Assign_SFU-ID; at the same time, the target encryption algorithm it decides on must be written into the reserved bytes in the identifier assignment message Assign_SFU-ID to generate a target identifier assignment message. That is, this embodiment will extend the use of the reserved bytes in the identifier assignment message Assign_SFU-ID to inform the slave gateway SFU of the target encryption algorithm decided by the master gateway MFU for common use by both parties.
[0153] It should be noted that when the extended identifier assignment message Assign_SFU-ID confirms the encryption algorithm used between the master gateway MFU and the slave gateway SFU, if the FTTR is a GPON system, the lower 2 bits of the 12th byte reserved in the extended identifier assignment message Assign_SFU-ID can be preferably used to reply to the slave gateway SFU as shown in Table 5, that is, the extended lower 2 bits are used to inform the slave gateway SFU of the currently selected target encryption algorithm; for example, "01" indicates that the master gateway MFU selects encryption algorithm E1, "10" indicates that the master gateway MFU selects encryption algorithm E2, and "00" indicates that the master gateway MFU selects the default AES128 encryption algorithm. Therefore, the master gateway MFU can set the value of the lower 2 bits of the 12th byte in the identifier assignment message Assign_SFU-ID according to the determined target encryption algorithm to generate a target identifier assignment message, so that the slave gateway SFU can determine the target encryption algorithm that both parties need to use together through the value of the lower 2 bits of the reserved byte in the target identifier assignment message.
[0154] Table 5 Assign_SFU-ID message extension in GPON system
[0155]
[0156] If the FTTR is a 10GPON system, as shown in Table 6, the lower 4 bits of the 16th byte reserved in the extended identifier assignment message Assign_SFU-ID can be preferably used to reply to the slave gateway SFU, that is, the extended lower 4 bits are used to inform the slave gateway SFU of the target encryption algorithm currently selected; wherein, the lower 4 bits can be given different values according to binary to represent the different selected encryption algorithms, but the actual corresponding relationship between the lower 4 bits and the different encryption algorithms can be determined according to actual needs and is not limited here. For example, "0001" means that the master gateway MFU selects encryption. "0010" indicates that the master gateway MFU selects encryption algorithm E2, "0011" indicates that the master gateway MFU selects encryption algorithm E3, "0100" indicates that the master gateway MFU selects encryption algorithm E4, "0101" indicates that the master gateway MFU selects encryption algorithm E5, "0110" indicates that the master gateway MFU selects encryption algorithm E6, "0111" indicates that the master gateway MFU selects encryption algorithm E7, "1000" indicates that the master gateway MFU supports encryption algorithm E8, and "0000" indicates that the master gateway MFU selects the default AES128 encryption algorithm. Therefore, the master gateway MFU can set the value of the lower 4 bits of the 16th byte in the identifier assignment message Assign_SFU-ID according to the determined target encryption algorithm to generate a target identifier assignment message, so that the slave gateway SFU can determine the target encryption algorithm that both parties need to use together through the value of the lower 4 bits of the reserved bytes in the target identifier assignment message.
[0157] Table 6 Assign_SFU-ID message extension in 10GPON system
[0158]
[0159]
[0160] Furthermore, in one embodiment, the method further includes:
[0161] Determine an updated encryption algorithm based on the encryption algorithm that the user expects to use, and write the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message;
[0162] Sending the target key message to the slave device, so that the slave device in operation can determine the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message, and generate a new key according to the updated encryption algorithm;
[0163] When the new key sent from the device is received, the key is updated based on the new key.
[0164] Exemplarily, during the lifetime of the slave gateway SFU connection, that is, when the slave gateway SFU is in operation, if the user modifies the encryption method through configuration, this embodiment will change the encryption algorithm between the master gateway MFU and the slave gateway SUF by expanding the key message periodically sent by the master gateway MFU to trigger the slave gateway SFU to generate a new key and send the new key to the master gateway MFU.
[0165] It should be understood that since the encryption algorithm that the user expects to use may be the same as the encryption algorithm currently used by the system, or it may be different, the master gateway MFU needs to match it with the encryption algorithm currently used by the system when receiving the encryption algorithm that the user expects to use configured by the user; if they are the same, the key update process is not triggered; and if they are different, the encryption algorithm that the user expects to use is written into the reserved bytes of the key message as the updated encryption algorithm to generate a target key message and send it to the slave gateway SFU, that is, this embodiment will extend the use of the reserved bytes in the key message to inform the slave gateway SFU of the updated encryption algorithm of the master gateway MFU. After receiving the target key message, the slave gateway SFU will parse it to learn the updated encryption algorithm newly decided by the master gateway MFU, and generate a new key according to the updated encryption algorithm, and reply to the master gateway MFU with the new key through a message, thereby realizing the key update between the slave gateway and the master gateway, so that the master and slave gateways can subsequently use the new encryption algorithm and key for encryption and decryption.
[0166] It should be noted that in the GPON system, as shown in the aforementioned Table 3, the lower 2 bits of the 3rd byte of the key message Request_Key can be preferably extended, that is, the extended lower 2 bits are used to inform the slave gateway SFU of the updated encryption algorithm currently selected; for example, "01" indicates that the main gateway MFU selects the encryption algorithm E1, "10" indicates that the main gateway MFU selects the encryption algorithm E2, and "00" indicates that the main gateway MFU selects the default AES128 encryption algorithm.
[0167] Therefore, in the usage scenario where the master gateway MFU specifies the encryption method through configuration, if the master gateway MFU modifies the configuration and switches the encryption method, it will send a target key message to the slave gateway SFU to inform it of the modified encryption method, that is, the master gateway MFU can set the value of the lower 2 bits of the 3rd byte in the key message Request_Key according to the decided updated encryption algorithm, that is, set the lower 2 bits of the 3rd byte of the key message Request_Key to the updated encryption algorithm; for example, the master gateway MFU selects encryption algorithm E1 as the updated encryption algorithm, then the value of the lower 2 bits of the 3rd byte is "01", and the value of "10" indicates that encryption algorithm E2 is selected as the updated encryption algorithm, and the value of "00" indicates that the default encryption algorithm AES128 is used, and then the target key message is generated, so that the slave gateway SFU in operation can determine the updated encryption algorithm that both parties need to use together through the value of the lower 2 bits of the reserved byte in the target key message. Therefore, when the slave gateway SFU receives the Request_Key message, it will parse the new encryption method from the message. If the encryption algorithm has changed, it will use the new encryption algorithm to generate a new key and reply to the master gateway MFU via the Encryption Key message.
[0168] In the 10GPON system, the key message Key_Control is used by the master gateway MFU to instruct the slave gateway SFU to generate a new data encryption key of a specified length or to confirm an existing data encryption key; as shown in the aforementioned Table 4, in this embodiment, the lower 4 bits of the 5th byte of the key message Key_Control may be preferably extended, that is, the extended lower 4 bits are used to inform the slave gateway SFU of the updated encryption algorithm currently selected; wherein, the lower 4 bits may be given different values in binary to represent the different selected encryption algorithms, but the actual values of the lower 4 bits and the specific correspondence between different encryption algorithms may be determined according to actual needs, and in this There is no limitation. For example, "0001" means that the main gateway MFU selects encryption algorithm E1, "0010" means that the main gateway MFU selects encryption algorithm E2, "0011" means that the main gateway MFU selects encryption algorithm E3, "0100" means that the main gateway MFU selects encryption algorithm E4, "0101" means that the main gateway MFU selects encryption algorithm E5, "0110" means that the main gateway MFU selects encryption algorithm E6, "0111" means that the main gateway MFU selects encryption algorithm E7, "1000" means that the main gateway MFU selects encryption algorithm E8, and "0000" means that the main gateway MFU selects the default AES128 encryption algorithm.
[0169] It should be noted that the extended lower 4 bits need to be used together with the value of byte 6 in the key message Key_Control, where the value of the 6th byte has the following two situations: (1) generate and send a new key, (2) confirm the existing key; if the master gateway MFU needs to modify the existing encryption algorithm, the value of the 6th byte is "generate and send a new key" to require the slave gateway SFU to generate a new key according to the encryption algorithm of the extended 5th byte, and inform the slave gateway SFU of the new encryption algorithm through the extended byte; if the master gateway MFU does not need to modify the existing encryption algorithm, the value of the 6th byte is "confirm the existing key", so that the slave gateway SFU does not need to generate a new key according to the encryption algorithm of the extended 5th byte, but only informs the slave gateway SFU of the new encryption algorithm through the extended byte.
[0170] Therefore, in the usage scenario where the main gateway MFU specifies the encryption method through configuration, if the main gateway MFU modifies the configuration and switches the encryption method, it will send a target key message to the slave gateway SFU to inform it of the modified encryption method, that is, the main gateway MFU can set the value of the lower 4 bits of the 5th byte in the key message Key_Control according to the decided updated encryption algorithm, that is, set the lower 4 bits of the 5th byte in the key message Key_Control to the updated encryption algorithm, and set the value of the 6th byte to "generate and send a new key", thereby generating a target key message; when the slave gateway SFU receives the target key message, it can parse the new encryption method from the message. If the encryption algorithm has changed, the new encryption algorithm is used to generate a new key, and the main gateway MFU is replied through the Encryption Key message.
[0171] The following example takes the master device as the master gateway MFU and the slave device as the slave gateway SFU. Figure 3 The overall process of encryption algorithm negotiation in FTTR GPON / 10GPON system is explained.
[0172] (1) The encryption algorithm negotiation process is controlled when the slave gateway SFU is in the serial number state (i.e., the O3 state). First, the user presets the encryption algorithm used by the gemport channel in the FTTR GPON / 10GPON system through configuration on the master gateway MFU. It should be noted that if the user does not configure the encryption algorithm, the key negotiation process is not triggered.
[0173] (2) The master gateway MFU periodically sends a sequence number request message to the slave gateway SFU by broadcasting a message, so that the slave gateway SFU in the sequence number state receives the message.
[0174] (3) When the slave gateway SFU receives the serial number request message, it sends a Serial_Number_SFU message to reply to the master gateway MFU; it should be noted that the Serial_Number_SFU message not only needs to carry the serial number of the slave gateway SFU, but also needs to inform the master gateway MFU of the encryption algorithm supported by the slave gateway SFU through message extension; the specific extension method and principle of the Serial_Number_SFU message can be found in the aforementioned embodiment and will not be repeated here.
[0175] (4) After the main gateway MFU receives the Serial_Number_SFU sent by the slave gateway SFU, if the user has preset the encryption algorithm, the preset encryption algorithm will be directly used as the target encryption algorithm. If the user has not preset the encryption algorithm, an encryption algorithm recorded in the Serial_Number_SFU will be randomly specified as the target encryption algorithm. It should be noted that the encryption algorithm preset by the user is derived from the encryption algorithm supported by the slave gateway SFU, that is, the encryption algorithm supported by the slave gateway SFU must cover the encryption algorithm preset by the user.
[0176] (5) After the master gateway MFU confirms the target encryption algorithm currently in use, the Assign_SFU-ID message sent to the slave gateway SFU is extended to specify the target encryption algorithm as the encryption algorithm between the master gateway MFU and the slave gateway SFU, so that the slave gateway SFU can encrypt and decrypt the Gemport channel using the target encryption algorithm specified by the Assign_SFU-ID message; it should be noted that the specific extension method and principle of the Assign_SFU-ID message refer to the aforementioned embodiment and will not be repeated here.
[0177] The following example takes the master device as the master gateway MFU and the slave device as the slave gateway SFU. Figure 4 The overall process of key update in FTTR GPON / 10GPON system is explained.
[0178] (1) The control key update process is performed when the slave gateway SFU is in the running state (i.e., the O5 state); first, when the slave gateway SFU is in the connection lifetime, the user modifies the encryption algorithm on the master gateway MFU to generate the encryption algorithm that the user expects to use.
[0179] (2) The main gateway MFU compares the encryption algorithm that the user expects to use with the encryption algorithm currently used by the system to see if they are the same. If they are the same, no processing is performed; if they are not the same, the main gateway MFU will inform the slave gateway SFU of the encryption algorithm update. Among them, in the GPON system, the main gateway MFU will inform the slave gateway SFU of the encryption algorithm update by extending the Request_Key message, that is, the updated encryption algorithm is included in the message; and in the 10GPON system, the main gateway MFU will inform the slave gateway SFU of the encryption algorithm update by extending the Key_Control message, that is, the updated encryption algorithm is included in the message, and the slave gateway SFU is required to generate and send a new key. It should be noted that the specific extension method and principle of the Request_Key message and the Key_Control message refer to the aforementioned embodiment and will not be repeated here.
[0180] (3) After receiving the Request_Key / Key_Control message, the slave gateway SFU will obtain the updated encryption algorithm from it, generate a new key based on the updated encryption algorithm, and reply to inform the master gateway MFU of the new key. In the GPON system, the slave gateway SFU can reply to the master gateway MFU with the new key through the Encryption_Key message; in the 10GPON system, the slave gateway SFU can reply to the master gateway MFU with the new key through the Key_Report message.
[0181] In a fourth aspect, an embodiment of the present application also provides another encryption algorithm dynamic negotiation device.
[0182] In one embodiment, another encryption algorithm dynamic negotiation device includes a main device, wherein the main device is used to:
[0183] Send a serial number request message to the slave device by broadcasting;
[0184] When receiving a target sequence number message sent by a slave device in a sequence number state based on a sequence number request message, determining a target encryption algorithm from encryption algorithms supported by the slave device based on the sequence number message, the target sequence number message being generated by the slave device based on its sequence number and the encryption algorithm supported by the slave device;
[0185] A target identifier allocation message is constructed according to the target encryption algorithm and the target identifier allocated to the slave device, so that the slave device can parse the target identifier allocation message to obtain the target encryption algorithm and implement encryption and decryption processing of the service transmission channel based on the target encryption algorithm.
[0186] Furthermore, in one embodiment, the master device is specifically used for:
[0187] Writing an identifier byte in an identifier allocation message according to a target identifier allocated to the slave device, and writing a reserved byte in the identifier allocation message according to the target encryption algorithm to generate a target identifier allocation message;
[0188] Among them, the slave device determines the target encryption algorithm decided by the master device through the value of the reserved byte in the target identifier allocation message.
[0189] Furthermore, in one embodiment, the slave device is specifically used for:
[0190] Write the sequence number byte in the sequence number message according to its sequence number, and write the reserved byte in the sequence number message based on the encryption algorithm supported by itself to generate a target sequence number message;
[0191] The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
[0192] Furthermore, in one embodiment, the master device is further configured to:
[0193] Determine an updated encryption algorithm based on the encryption algorithm that the user expects to use, and write the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message;
[0194] Sending the target key message to the slave device, so that the slave device in operation can determine the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message, and generate a new key according to the updated encryption algorithm;
[0195] When the new key sent from the device is received, the key is updated based on the new key.
[0196] Among them, the functional implementation of each module in the above-mentioned encryption algorithm dynamic negotiation device corresponds to the various steps in the above-mentioned encryption algorithm dynamic negotiation method embodiment, and its functions and implementation processes are no longer repeated here one by one.
[0197] In a fifth aspect, an embodiment of the present application provides an encryption algorithm dynamic negotiation device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0198] Reference Figure 5 , Figure 5 The hardware structure diagram of the encryption algorithm dynamic negotiation device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the encryption algorithm dynamic negotiation device may include a processor, a memory, a communication interface, and a communication bus.
[0199] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0200] The communication interface includes input / output (I / O) interface, physical interface and logical interface, etc., which are used to realize the interconnection of devices inside the encryption algorithm dynamic negotiation device, and the interface used to realize the interconnection between the encryption algorithm dynamic negotiation device and other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display (Display), a keyboard (Keyboard), etc.
[0201] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0202] The processor may be a general-purpose processor, and the general-purpose processor may call the encryption algorithm dynamic negotiation program stored in the memory and execute the encryption algorithm dynamic negotiation method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the encryption algorithm dynamic negotiation program is called may refer to the various embodiments of the encryption algorithm dynamic negotiation method of the present application, which will not be repeated here.
[0203] Those skilled in the art will understand that Figure 5 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0204] In a sixth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0205] The readable storage medium of the present application stores an encryption algorithm dynamic negotiation program, wherein when the encryption algorithm dynamic negotiation program is executed by a processor, the steps of the encryption algorithm dynamic negotiation method as described above are implemented.
[0206] Among them, the method implemented when the encryption algorithm dynamic negotiation program is executed can refer to the various embodiments of the encryption algorithm dynamic negotiation method of the present application, and will not be repeated here.
[0207] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0208] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0209] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0210] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for dynamic negotiation of encryption algorithms, characterized in that: The encryption algorithm dynamic negotiation method is applied to a slave device, and the method comprises the following steps: When the slave device in the serial number state receives the serial number request message broadcast by the master device, a target serial number message is constructed, wherein the target serial number message includes the serial number of the slave device and the encryption algorithm supported by the slave device; Sending the target sequence number message to the master device, so that the master device can decide a target encryption algorithm from the encryption algorithms supported by the slave device based on the target sequence number message, and constructing a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device; When a target identifier allocation message sent by the main device is received, the target identifier allocation message is parsed to obtain a target encryption algorithm, so as to implement encryption and decryption processing of the service transmission channel through the target encryption algorithm.
2. The encryption algorithm dynamic negotiation method according to claim 1, characterized in that: The constructing target sequence number message includes: Writing the sequence number byte in the sequence number message according to the sequence number of the slave device, and writing the reserved byte in the sequence number message based on the encryption algorithm supported by the slave device itself to generate a target sequence number message; The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
3. The encryption algorithm dynamic negotiation method according to claim 1, characterized in that: When the slave device is in a running state, the method further includes: If a target key message sent by the master device is received, the target key message is parsed to obtain an updated encryption algorithm, wherein the target key message is generated by the master device based on the encryption algorithm expected to be used by the user; A new key is generated according to the updated encryption algorithm, and the new key is sent to the master device to implement key update between the slave device and the master device.
4. The encryption algorithm dynamic negotiation method according to claim 3, characterized in that: The target key message is generated by the master device based on the encryption algorithm that the user expects to use, and includes: The master device determines an updated encryption algorithm based on the encryption algorithm that the user expects to use, and writes the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message; Among them, the slave device determines the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message.
5. A dynamic negotiation device for encryption algorithm, characterized in that: A slave device is included, wherein the slave device is used to: When the slave device in the serial number state receives the serial number request message broadcast by the master device, a target serial number message is constructed, wherein the target serial number message includes the serial number of the slave device and the encryption algorithm supported by the slave device; Sending the target sequence number message to the master device, so that the master device can decide a target encryption algorithm from the encryption algorithms supported by the slave device based on the target sequence number message, and constructing a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device; When a target identifier allocation message sent by the main device is received, the target identifier allocation message is parsed to obtain a target encryption algorithm, so as to implement encryption and decryption processing of the service transmission channel through the target encryption algorithm.
6. A method for dynamic negotiation of encryption algorithms, characterized in that: The encryption algorithm dynamic negotiation method is applied to a master device, and the method comprises the following steps: Send a serial number request message to the slave device by broadcasting; When receiving a target sequence number message sent by a slave device in a sequence number state based on a sequence number request message, determining a target encryption algorithm from encryption algorithms supported by the slave device based on the sequence number message, the target sequence number message being generated by the slave device based on its sequence number and the encryption algorithm supported by the slave device; A target identifier allocation message is constructed according to the target encryption algorithm and the target identifier allocated to the slave device, so that the slave device can parse the target identifier allocation message to obtain the target encryption algorithm and implement encryption and decryption processing of the service transmission channel based on the target encryption algorithm.
7. The encryption algorithm dynamic negotiation method according to claim 6, characterized in that: The step of constructing a target identifier allocation message according to the target encryption algorithm and the target identifier allocated to the slave device comprises: Writing an identifier byte in an identifier allocation message according to a target identifier allocated to the slave device, and writing a reserved byte in the identifier allocation message according to the target encryption algorithm to generate a target identifier allocation message; Among them, the slave device determines the target encryption algorithm decided by the master device through the value of the reserved byte in the target identifier allocation message.
8. The encryption algorithm dynamic negotiation method according to claim 6, characterized in that: The target sequence number message is generated by the slave device based on its sequence number and the encryption algorithm supported by the slave device, including: The slave device writes the sequence number byte in the sequence number message according to its sequence number, and writes the reserved byte in the sequence number message based on the encryption algorithm supported by itself to generate a target sequence number message; The master device determines the encryption algorithm type supported by the slave device through the value of the reserved byte in the target sequence number message.
9. The encryption algorithm dynamic negotiation method according to claim 6, characterized in that: The method further comprises: Determine an updated encryption algorithm based on the encryption algorithm that the user expects to use, and write the reserved bytes in the key message according to the updated encryption algorithm to generate a target key message; Sending the target key message to the slave device, so that the slave device in operation can determine the updated encryption algorithm decided by the master device through the value of the reserved byte in the target key message, and generate a new key according to the updated encryption algorithm; When the new key sent from the device is received, the key is updated based on the new key.
10. A dynamic negotiation device for encryption algorithms, characterized in that: The invention comprises a main device, wherein the main device is used for: Send a serial number request message to the slave device by broadcasting; When receiving a target sequence number message sent by a slave device in a sequence number state based on a sequence number request message, determining a target encryption algorithm from encryption algorithms supported by the slave device based on the sequence number message, the target sequence number message being generated by the slave device based on its sequence number and the encryption algorithm supported by the slave device; A target identifier allocation message is constructed according to the target encryption algorithm and the target identifier allocated to the slave device, so that the slave device can parse the target identifier allocation message to obtain the target encryption algorithm and implement encryption and decryption processing of the service transmission channel based on the target encryption algorithm.
11. A dynamic negotiation device for encryption algorithms, characterized in that: The encryption algorithm dynamic negotiation device includes a processor, a memory, and an encryption algorithm dynamic negotiation program stored in the memory and executable by the processor, wherein when the encryption algorithm dynamic negotiation program is executed by the processor, the steps of the encryption algorithm dynamic negotiation method as described in any one of claims 1 to 4 and 6 to 9 are implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an encryption algorithm dynamic negotiation program, wherein when the encryption algorithm dynamic negotiation program is executed by a processor, the steps of the encryption algorithm dynamic negotiation method as described in any one of claims 1 to 4 and 6 to 9 are implemented.
Citation Information
Patent Citations
Authentication method and device in passive optical network and passive optical network
CN101902447A
A method and system for negotiating an encryption algorithm in a passive optical network system
CN109039600A
Access mode switching method and device, storage medium and electronic device
CN116546351A
Service encryption method of passive optical network system, electronic equipment and storage medium
CN117579182A
Broadcast packet encryption method, OLT, ONU, and computer storage medium
WO2017092465A1
Cited By
Communication data encryption method and system based on cooperation of application terminal and server
CN120979782A
Methods, apparatuses and device for dynamic negotiation of encryption algorithm, and readable storage medium
WO2026065841A1
Optical network communication method and communication apparatus
WO2026149093A1
