Remote flashing method based on SNMP (Simple Network Management Protocol) module

Through the remote flashing method combined with AES encryption and SNMP protocol, data security and integrity issues in SNMP remote updates are solved, and efficient and secure firmware and software updates are achieved, suitable for various network environments.

CN119210758APending Publication Date: 2024-12-27炫途储能科技(上海)有限公司
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410994684.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing SNMP remote update method has the problems of low data security, inability to guarantee data integrity and incomplete update confirmation mechanism, especially when it is easily intercepted or tampered during transmission, and is not applicable to old or low-cost equipment.

Method used

Using a remote flashing method combined with AES encryption and SNMP protocol, the update file is encrypted on the management side and decrypted with the same key on the target device side to ensure the security and integrity of data transmission, and introduce checksum verification Mechanism to confirm the update is successful.

Benefits of technology

It significantly improves the security and integrity of data during transmission, reduces maintenance costs, improves the efficiency and security standards of the update process, and is suitable for network environments of all sizes without the need to replace existing equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119210758A_ABST
    Figure CN119210758A_ABST
Patent Text Reader

Abstract

The invention discloses a remote flashing method based on an SNMP (Simple Network Management Protocol) module, which comprises the following steps: S1, encrypting an update file at a management end by using an advanced encryption standard; S2, sending an encrypted file c to target network equipment through an SNMP protocol; the method comprises the following steps: S1, a decryption process is defined as D (k, c), and an original update file m 'is obtained after decryption, S4, a device performs a flash operation by using the decrypted update file m' to complete the update of firmware or software, and S5, after the update is completed, the device can selectively use an AES encryption method to send a confirmation message to a management system. The data security and integrity are remarkably improved, the update failure rate is reduced, the update efficiency is improved, deployment is easy, the cost effectiveness is high, and the method is suitable for various network environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of SNMP modules, and in particular to a remote flashing method based on SNMP modules. Background Art

[0002] In modern network management, device firmware and software updates are a critical step in maintaining network security and functionality. Traditional update methods usually involve physical media or direct network connections to transfer update files, which are not only costly but also inefficient, especially when a large number of widely distributed devices need to be updated. In addition, traditional update methods also have obvious deficiencies in security, because files can be easily intercepted or tampered with during transmission, resulting in security vulnerabilities.

[0003] Simple Network Management Protocol (SNMP) is a widely used network management protocol, often used to monitor the status of network devices. However, when using SNMP for remote updates, the security of data transmission cannot be guaranteed because SNMP itself does not include an encryption mechanism. Currently, although there are methods to encrypt SNMP messages using secure transmission protocols (such as SSH, SSL / TLS, etc.), these methods often require network devices to support the corresponding protocols and encryption algorithms, which is not realistic for old or low-cost devices.

[0004] The existing remote update technology through the SNMP protocol faces the following core technical problems: 1. Low data security: In the traditional SNMP remote update method, the update file is transmitted in plain text on the network and is easily intercepted and tampered with. 2. Data integrity cannot be guaranteed during the update process: Due to the lack of an effective integrity verification mechanism, the update process is vulnerable to security threats such as man-in-the-middle attacks. 3. The update confirmation mechanism is not sound: Traditional methods lack a security mechanism to confirm the updated status, and it is difficult for the management end to know whether the update has been successfully applied to the target device. Therefore, how to provide a remote update method that is highly secure, low-cost and easy to deploy without replacing existing equipment, and solve the security and integrity problems of data during transmission, has become a problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] One purpose of the present invention is to propose a remote flashing method based on the SNMP module. This patent demonstrates a method for remote flashing of devices using AES encryption and SNMP protocol, which enhances the security and integrity of data during transmission. This method can be easily deployed on existing equipment, which is not only cost-effective, but also significantly improves the safety and reliability of operations. Through this technology, maintenance costs can be effectively reduced and the efficiency and safety standards of the network equipment update process can be improved.

[0006] A remote flashing method based on an SNMP module according to an embodiment of the present invention comprises the following steps:

[0007] S1. Encrypt the update file using the Advanced Encryption Standard on the management side;

[0008] S2, sending the encrypted file c to the target network device via SNMP protocol;

[0009] S3. After the network device receives the encrypted file c, it uses the same pre-configured key k to decrypt it. The decryption process is defined as D(k, c). After decryption, the original update file m′ is obtained.

[0010] S4, the device uses the decrypted update file m′ to perform a flash operation to complete the firmware or software update;

[0011] S5. After the update is completed, the device can optionally use the AES encryption method to send a confirmation message to the management system.

[0012] Optionally, S1 specifically includes:

[0013] S11. During the encryption process, the length of the update file m is first determined and divided into multiple segments that conform to the AES block size, each segment being marked as m. i , where i is the index of the segment;

[0014] S12. For each segment m i , execute the Advanced Encryption Standard encryption algorithm, the encryption process is defined as E k (m i ), where k is the selected AES key, E k represents the AES encryption function with k as the key, and the process generates the corresponding encrypted segment c i ;

[0015] S13, introduce an initialization vector IV for the encryption of the first block, and for each subsequent block m i , the encrypted output of the previous block c i -1 is used as an extra input to the current block:

[0016]

[0017] Where c0 = IV;

[0018] S14, all c i The encrypted files are stitched together to form a complete encrypted file c, which will be sent to the target device via the SNMP protocol.

[0019] Optionally, S2 specifically includes:

[0020] S21, dividing the encrypted file c into multiple data segments of fixed length, adapting to the limitation of the SNMP protocol on the size of the data packet, setting the length of each data segment to L bytes, where the value of L is determined according to the network environment and the SNMP protocol version;

[0021] S22, for each data segment c i Create an SNMP data packet, each data packet contains the standard header information required by the SNMP protocol, and a data field, the field stores the data segment c i ;

[0022] S23, apply the checksum algorithm to each SNMP data packet, use the standard checksum function Checksum, and calculate the checksum CS (c i ):

[0023] CS(c i )=Ch ecksum(c i )

[0024] And CS(c i ) is appended to the corresponding data packet;

[0025] S24, sending these SNMP data packets in sequence through the network, using a connectionless transmission protocol, then including a sequence number in each data packet so that the target device can correctly reassemble the encrypted file c;

[0026] S25. At the target device, perform checksum verification on each received SNMP data packet. If the checksum does not match, take error handling measures, discard the data packet and record the error.

[0027] S26. Extract data segment c from the data packet that passes the verification i , and reassemble them in order to restore the complete encrypted file c.

[0028] Optionally, S25 specifically includes:

[0029] S251, after receiving an encrypted data packet encapsulated by SNMP, the target network device first separates the data part c i and its corresponding checksum CS(c i );

[0030] S252, the target device uses a predefined checksum algorithm to check the separated data part c i Recalculate the checksum CS′(c i ):

[0031] CS′(c i )=Ch ecksum(c i)

[0032] Where Checksum represents the checksum function applied to the data packet;

[0033] S253, the original checksum CS (c i ) and the recalculated checksum CS′(c i ) for comparison, when the two are consistent, that is, CS(c i )=CS′(c i ), the data packet is considered not to have been tampered with during transmission and is used for subsequent encrypted file reassembly;

[0034] S254, when the checksum does not match, CS (c i )≠CS′(c i ), the following error handling process is executed:

[0035] Record the error information including the data packet sequence number, error time and possible error type, and send a retransmission request to the management end to retransmit the data segment c i Requests;

[0036] S255, introduce a dynamic fault tolerance mechanism: set an error threshold T to determine when a comprehensive error recovery procedure should be triggered. When the number of consecutively received error packets is less than T, only request retransmission of these packets; when the number of errors reaches or exceeds T, a more comprehensive error recovery process is initiated, interrupting the current transmission and reinitializing the entire file transfer process;

[0037] S256, this checksum verification process provides an additional layer of security for remote flash operations, providing effective protection against network fluctuations and potential data tampering.

[0038] Optionally, S3 specifically includes:

[0039] S31. After receiving the encrypted file c transmitted by the SNMP protocol, the target network device first reassembles the encrypted file c. Suppose c consists of several data segments c1, c2, ..., c n The network device reassembles these data segments in order to restore the encrypted file c;

[0040] S32, using the AES decryption algorithm D corresponding to the encryption process k Decrypt the encrypted file c. The decryption algorithm is defined as D(k, c i ), where k is the same key used for encryption, and c i is a single data segment of the encrypted file c;

[0041] S33, according to the working mode of the AES encryption algorithm, for each data segment c iDecryption is performed separately, using the Cipher Block Chaining (CBC) mode during encryption:

[0042]

[0043] where m′ i is the original data segment obtained after decryption, c i-1 is the previous encrypted data segment. For the first data segment c1, use the initial vector IV:

[0044]

[0045] Where m′1 is the first part of the update file obtained after the decryption process, D refers to the decryption function, which is the processing process corresponding to the encryption function. In the AES encryption framework, it is used to restore the data before encryption, k represents the key used for the encryption and decryption process. In AES encryption, this key is used to control the encryption algorithm and must be consistent during the encryption and decryption process, c1 is the first block of the encrypted data. During the transmission process, the update file is encrypted and may be transmitted in blocks. c1 is the first of these blocks. IV refers to the initialization vector, which is used for the first data block in the encryption process. In the cipher block chaining (CBC) mode, IV is used to combine with the first data block c1 to increase the randomness and strength of the encryption;

[0046] S34, repeat this decryption process until all encrypted data segments c i After being decrypted, the decrypted data segments m′1 are reassembled in order to form a complete original update file m′;

[0047] S35. Verify the integrity and correctness of the decrypted file m′ by using the same file integrity verification method as the encryption process, calculate the hash value of the file, and compare it with the hash value of the original file before transmission.

[0048] Optionally, S35 specifically includes:

[0049] S351. On the management side, for the update file m to be sent, calculate its hash value Hash(m), using SHA-256:

[0050] Hash(m)=SHA256(m)

[0051] The calculated hash value Hash(m) is encrypted with AES together with the update file m to form the encrypted file c and the encrypted hash value Hash c (m);

[0052] S352: After receiving the encrypted file c, the target network device uses the configured AES key k to decrypt it and recover the updated file m′ and its hash value Hashc (m):

[0053] m′, Hash c (m) = D k (c)

[0054] The target device calculates the hash value Hash′(m′) for the decrypted file m′:

[0055] Hash′(m′)=SHA256(m′)

[0056] Where m′ refers to the message or data obtained after decryption, which in this patent usually refers to the firmware or software data of the updated device, and Hash c (m) This is the hash value of the encrypted message c before decryption. Before sending the encrypted message c, the management system calculates the hash value of the original message m and embeds it into the encryption process. D_k(c) represents the process of decrypting the encrypted data c using the AES decryption algorithm and key k. k is the decryption function, k is the key, and c is the received encrypted data. Hash(m') is the process of calculating the hash value of the decrypted message m' again.

[0057] S353, compare the decrypted hash value Hash′(m′) with the encrypted transmitted hash value Hash c (m) for comparison:

[0058] Verify=(Hash′(m′)==Hash c (m))

[0059] When the verification result Verify is true, it indicates that the file m′ has not been tampered with during the transmission and decryption process;

[0060] When the verification result is false, it indicates that the file may have been damaged or tampered with during transmission or decryption, triggering the error handling process;

[0061] S354. In the event of a verification failure, the target device will send an error notification to the management end and may request to resend the update file. A security threshold is set. If the number of consecutive verification failures exceeds this threshold, the target device will take additional security measures and suspend the update process to prevent potential security threats.

[0062] Optionally, S4 specifically includes:

[0063] S41, after successfully decrypting the update file m', the target network device first verifies the version and compatibility of the file. The device stores the current firmware or software version information V current , and compare it with the target version information V contained in m′ target For comparison:

[0064] VerifyVersion=(V current <V target )

[0065] When the result of VerifyVersion is true, it indicates that m′ is a newer version, and the update process continues;

[0066] S42, during the flashing process, the device enters a safe mode, closes services and interfaces, reduces risks during the update process, and writes m′ into the firmware or software storage area of ​​the device to prevent interruption or damage during the flashing process;

[0067] S43. After the update is completed, the device automatically restarts and performs a system integrity check, including running a diagnostic program and performing a hash check on the new firmware or software to confirm that the update is successful. The device calculates the hash value Hash(new) of the new firmware or software and compares it with the hash value Hash(m′) of m′:

[0068] VerifyUpdate=(Hash(new)==Hash(m′))

[0069] When VerifyUpdate is true, it indicates that the update is successful; when VerifyUpdate is false, it indicates that there may be problems with the update, and the device will take recovery measures and roll back to the last stable version;

[0070] S44. After the update is successful, the device will send a confirmation message to the management system through the SNMP protocol, indicating that the update has been successfully completed. The confirmation message should also be encrypted as described above.

[0071] Optionally, S5 specifically includes:

[0072] S51. After completing the update, the device constructs a confirmation message M containing the update status. ack , the message contains the update version number V new , update completion time T updated , and status indication;

[0073] S52: The device uses the same AES key k as used to encrypt the update file to confirm the message M. ack Encrypt to form an encrypted confirmation message C ack :

[0074] C ack =E(k,M ack )

[0075] S53, the device sends the encrypted confirmation message C ack Encapsulated into a data packet that complies with the SNMP protocol,

[0076] The encrypted data packet is sent to the management system via the SNMP protocol;

[0077] S54. After receiving the encrypted confirmation message, the management system decrypts it using the same key k as the device:

[0078] M′ ack =D(k,C ack )

[0079] S55, the management system processes the decrypted message M′ ack Perform integrity verification by comparing its hash value with the hash value of the message before sending:

[0080] Hash′(M′ ack ) = SHA256(M′ ack )

[0081] Verify=(Hash′(M′ ack )==Hash(M ack ))

[0082] S56. When the verification passes, that is, Verify is true, the management system will record the update success and may trigger subsequent processes; when the verification fails, the management system will take appropriate measures, the system will issue an alarm or restart the update process.

[0083] Update process.

[0084] The beneficial effects of the present invention are as follows: This patent proposes a remote flashing method that combines the Advanced Encryption Standard (AES) and the Simple Network Management Protocol (SNMP), which significantly improves the security of firmware and software updates through SNMP. Utilizing the encryption capabilities of AES and the data link characteristics of the CBC mode, the present invention ensures the security and data integrity of the update data during transmission, and effectively prevents data leakage and replay attacks. In addition, by introducing an encrypted confirmation mechanism, it ensures that the management system can receive clear feedback after the update process is completed, thereby improving the reliability of the update operation. This technology does not require the replacement of existing hardware equipment, is simple and easy to deploy, and is suitable for network environments of various sizes. It not only reduces maintenance costs, but also improves operational efficiency, and is particularly suitable for occasions with high requirements for network security. In this way, this patent provides a safe, efficient and cost-effective technical solution for remote flashing operations of network devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0086] Figure 1 The overall flow chart of the remote flashing method based on the Simple Network Management Protocol (SNMP) module proposed by the present invention is shown; DETAILED DESCRIPTION

[0087] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0088] refer to Figure 1 , a remote flashing method based on SNMP module, comprising the following steps:

[0089] S1. Encrypt the update file using the Advanced Encryption Standard on the management side;

[0090] In this implementation, S1 specifically includes:

[0091] S11. During the encryption process, the length of the update file m is first determined and divided into multiple segments that conform to the AES block size, each segment being marked as m. i , where i is the index of the segment;

[0092] S12. For each segment m i , execute the Advanced Encryption Standard encryption algorithm, the encryption process is defined as E k (m i ), where k is the selected AES key, E k represents the AES encryption function with k as the key, and the process generates the corresponding encrypted segment c i ;

[0093] S13, introduce an initialization vector IV for the encryption of the first block, and for each subsequent block m i , the encrypted output of the previous block c i -1 is used as an extra input to the current block:

[0094]

[0095] Where c0 = IV;

[0096] S14, all c i The encrypted files are stitched together to form a complete encrypted file c, which will be sent to the target device via the SNMP protocol.

[0097] S2, sending the encrypted file c to the target network device via SNMP protocol;

[0098] In this implementation, S2 specifically includes:

[0099] S21, dividing the encrypted file c into multiple data segments of fixed length, adapting to the limitation of the SNMP protocol on the size of the data packet, setting the length of each data segment to L bytes, where the value of L is determined according to the network environment and the SNMP protocol version;

[0100] S22, for each data segment c i Create an SNMP data packet, each data packet contains the standard header information required by the SNMP protocol, and a data field, the field stores the data segment c i ;

[0101] S23, apply the checksum algorithm to each SNMP data packet, use the standard checksum function Checksum, and calculate the checksum CS (c i ):

[0102] CS(c i )=Ch ecksum(c i )

[0103] And CS(c i ) is appended to the corresponding data packet;

[0104] S24, sending these SNMP data packets in sequence through the network, using a connectionless transmission protocol, then including a sequence number in each data packet so that the target device can correctly reassemble the encrypted file c;

[0105] S25. At the target device, perform checksum verification on each received SNMP data packet. If the checksum does not match, take error handling measures and request data retransmission.

[0106] S26. Extract data segment c from the data packet that passes the verification i , and reassemble them in order to restore the complete encrypted file c.

[0107] S25. At the target device, perform checksum verification on each received SNMP data packet. If the checksum does not match, take error handling measures, discard the data packet and record the error.

[0108] In this implementation, S25 specifically includes:

[0109] S251, after receiving an encrypted data packet encapsulated by SNMP, the target network device first separates the data part c i and its corresponding checksum CS(c i );

[0110] S252, the target device uses a predefined checksum algorithm to check the separated data part c i Recalculate the checksum CS′(ci ):

[0111] CS′(c i )=Ch ecksum(c i )

[0112] Where Checksum represents the checksum function applied to the data packet;

[0113] S253, the original checksum CS (c i ) and the recalculated checksum CS′(c i ) for comparison, when CS(c i )=CS′(c i ), the data packet is considered not to have been tampered with during transmission and is used for subsequent encrypted file reassembly;

[0114] S254, when the checksum does not match, CS (c i )≠CS′(c i ), the following error handling process is executed:

[0115] Record the error information including the data packet sequence number, error time and possible error type, and send a retransmission request to the management end to retransmit the data segment c i Requests;

[0116] S255, introduce a dynamic fault tolerance mechanism: set an error threshold T to determine when a comprehensive error recovery procedure should be triggered. When the number of consecutively received error packets is less than T, only request retransmission of these packets; if the number of errors reaches or exceeds T, initiate a more comprehensive error recovery process, such as interrupting the current transmission and reinitializing the entire file transfer process;

[0117] S256, this checksum verification process provides an additional layer of security for remote flash operations, providing effective protection against network fluctuations and potential data tampering.

[0118] S3. After the network device receives the encrypted file c, it uses the same pre-configured key k to decrypt it. The decryption process is defined as D(k, c). After decryption, the original update file m′ is obtained.

[0119] In this implementation, S3 specifically includes:

[0120] S31. After receiving the encrypted file c transmitted by the SNMP protocol, the target network device first reassembles the encrypted file c. Suppose c consists of several data segments c1, c2, ..., c n The network device reassembles these data segments in order to restore the encrypted file c;

[0121] S32, using the AES decryption algorithm D corresponding to the encryption process k Decrypt the encrypted file c. The decryption algorithm is defined as D(k, c i ), where k is the same key used for encryption, and c i is a single data segment of the encrypted file c;

[0122] S33, according to the working mode of the AES encryption algorithm, for each data segment c i Decryption is performed separately, using the Cipher Block Chaining (CBC) mode during encryption:

[0123]

[0124] where m′ i is the original data segment obtained after decryption, c i-1 is the previous encrypted data segment. For the first data segment c1, use the initial vector IV:

[0125]

[0126] Where m′1 is the first part of the update file obtained after the decryption process, D refers to the decryption function, which is the processing process corresponding to the encryption function. In the AES encryption framework, it is used to restore the data before encryption, k represents the key used for the encryption and decryption process. In AES encryption, this key is used to control the encryption algorithm and must be consistent during the encryption and decryption process, c1 is the first block of the encrypted data. During the transmission process, the update file is encrypted and may be transmitted in blocks. c1 is the first of these blocks. IV refers to the initialization vector, which is used for the first data block in the encryption process. In the cipher block chaining (CBC) mode, IV is used to combine with the first data block c1 to increase the randomness and strength of the encryption;

[0127] S34, repeat this decryption process until all encrypted data segments c i After being decrypted, the decrypted data segments m′1 are reassembled in order to form a complete original update file m′;

[0128] S35. Verify the integrity and correctness of the decrypted file m′ by using the same file integrity verification method as the encryption process, calculate the hash value of the file, and compare it with the hash value of the original file before transmission.

[0129] In this implementation, S35 specifically includes:

[0130] S35. Verify the integrity and correctness of the decrypted file m′ by using the same file integrity verification method as the encryption process, calculate the hash value of the file, and compare it with the hash value of the original file before transmission.

[0131] S351. On the management side, for the update file m to be sent, calculate its hash value Hash(m), using SHA-256:

[0132] Hash(m)=SHA256(m)

[0133] The calculated hash value Hash(m) is encrypted with AES together with the update file m to form the encrypted file c and the encrypted hash value Hash c (m);

[0134] S352: After receiving the encrypted file c, the target network device uses the configured AES key k to decrypt it and recover the updated file m′ and its hash value Hash c (m):

[0135] m′, Hash c (m) = D k (c)

[0136] The target device calculates the hash value Hash′(m′) for the decrypted file m′:

[0137] Hash′(m′)=SHA256(m′)

[0138] Where m′ refers to the message or data obtained after decryption, which in this patent usually refers to the firmware or software data of the updated device, and Hash c (m) This is the hash value of the encrypted message c before decryption. Before sending the encrypted message c, the management system calculates the hash value of the original message m and embeds it into the encryption process. D_k(c) represents the process of decrypting the encrypted data c using the AES decryption algorithm and key k. k is the decryption function, k is the key, and c is the received encrypted data. Hash(m') is the process of calculating the hash value of the decrypted message m' again.

[0139] S353, compare the decrypted hash value Hash′(m′) with the encrypted transmitted hash value Hash c (m) for comparison:

[0140] Verify=(Hash′(m′)==Hash c (m))

[0141] When the verification result Verify is true, it indicates that the file m′ has not been tampered with during the transmission and decryption process;

[0142] When the verification result is false, it indicates that the file may have been damaged or tampered with during transmission or decryption, triggering the error handling process;

[0143] S354. In the event of a verification failure, the target device will send an error notification to the management end and may request to resend the update file. A security threshold is set. If the number of consecutive verification failures exceeds this threshold, the target device will take additional security measures and suspend the update process to prevent potential security threats.

[0144] S4, the device uses the decrypted update file m′ to perform a flash operation to complete the firmware or software update;

[0145] In this implementation, S4 specifically includes:

[0146] S41, after successfully decrypting the update file m', the target network device first verifies the version and compatibility of the file. The device stores the current firmware or software version information V current , and compare it with the target version information V contained in m′ target For comparison:

[0147] VerifyVersion=(V current <V target )

[0148] When the result of VerifyVersion is true, it indicates that m′ is a newer version, and the update process continues;

[0149] S42, during the flashing process, the device enters a safe mode, closes services and interfaces, reduces risks during the update process, and writes m′ into the firmware or software storage area of ​​the device to prevent interruption or damage during the flashing process;

[0150] S43. After the update is completed, the device automatically restarts and performs a system integrity check, including running a diagnostic program and performing a hash check on the new firmware or software to confirm that the update is successful. The device calculates the hash value Hash(new) of the new firmware or software and compares it with the hash value Hash(m′) of m′:

[0151] VerifyUpdate=(Hash(new)==Hash(m′))

[0152] When VerifyUpdate is true, it indicates that the update is successful; when VerifyUpdate is false, it indicates that there may be problems with the update, and the device will take recovery measures and roll back to the previous stable version;

[0153] S44. After the update is successful, the device will send a confirmation message to the management system through the SNMP protocol, indicating that the update has been successfully completed. The confirmation message should also be encrypted as described above.

[0154] S5. After the update is completed, the device selectively uses the AES encryption method to send a confirmation message to the management system.

[0155] In this implementation, S5 specifically includes:

[0156] S51. After completing the update, the device constructs a confirmation message M containing the update status. ack , the message contains the update version number V new , update completion time T updated , and status indication;

[0157] S52: The device uses the same AES key k as used to encrypt the update file to confirm the message M. ack Encrypt to form an encrypted confirmation message C ack :

[0158] C ack =E(k,M ack )

[0159] S53, the device sends the encrypted confirmation message C ack Encapsulated into a data packet that complies with the SNMP protocol,

[0160] The encrypted data packet is sent to the management system via the SNMP protocol;

[0161] S54. After receiving the encrypted confirmation message, the management system decrypts it using the same key k as the device:

[0162] M′ ack =D(k,C ack )

[0163] S55, the management system processes the decrypted message M′ ack Perform integrity verification by comparing its hash value with the hash value of the message before sending:

[0164] Hash′(M′ ack ) = SHA256(M′ ack )

[0165] Verify=(Hash′(M′ ack )==Hash(M ack ))

[0166] S56. When the verification passes, that is, Verify is true, the management system will record the update success and may trigger subsequent processes; when the verification fails, the management system will take appropriate measures, issue an alarm or restart the update process.

[0167] Embodiment 1:

[0168] Before the start of the fall semester of 2023, the campus network center of a university in Beijing was faced with the task of urgently updating the firmware of more than 400 wireless access points (APs) distributed in various teaching buildings and student dormitories. The update was designed to fix recently discovered security vulnerabilities and prevent potential network attacks. In the past, such updates usually took several days and security could not be fully guaranteed.

[0169] On August 15, 2023, the network administrator decided to adopt the remote flashing method based on the SNMP module proposed in this patent. The first step of the update is to prepare the update file, which is 50MB in size. The administrator encrypts the file using a 256-bit AES key to ensure the security of the file during transmission. During the encryption process, the initial vector (IV) is randomly generated to ensure the uniqueness and security of the encryption. The size of each data block is set to 512 bytes, which meets the efficiency requirements of network transmission.

[0170] After the preparation, the encrypted files were sent to each AP through the campus SNMP management network at 2:00 a.m. on August 16. The process was successfully completed within 4 hours without any security incidents. After receiving the data, each AP decrypted it with the same key and verified the integrity of the data by calculating the SHA-256 hash value of the decrypted file. The results showed that the hash values ​​of the files received by all APs completely matched the hash values ​​of the original files recorded by the management system.

[0171] After the update process was completed, each AP generated a confirmation message containing the update status, which was also encrypted using AES. These messages were sent back to the management system via the SNMP protocol. By 7:00 am on August 16, the management system had received update confirmation messages from all 400 APs, and all verifications were successful.

[0172] By analyzing the operation logs before and after the update, the network administrator obtained the following data: In the update operation before the adoption of this patented method, an average of 12% of the devices failed to update due to data transmission problems; after adopting this patented method, the update failure rate dropped to 0%. In terms of security, the previous method had an average of at least 3 data security incidents recorded for each update operation, but after adopting this patented method, no security incidents were recorded. In terms of efficiency, this patented method reduced the average completion time of the entire update process from 36 hours to 4 hours.

[0173] In summary, this patented method significantly improves the security and efficiency of remote flashing operations, effectively solves the challenges faced by network administrators in updating device firmware and software, and provides strong technical support for the stable operation and security protection of campus networks.

[0174] Table 1 Network equipment update operation data comparison table

[0175]

[0176] This table clearly shows the significant effect of this patented method in improving data security, reducing update failure rate, increasing confirmation message receipt rate and shortening update time. Through these data, we can clearly see the advantages of using this patented method over traditional methods in remote flash operations of network devices.

Claims

1. A remote flashing method based on SNMP module, characterized in that: The specific steps include: S1. Encrypt the update file using the Advanced Encryption Standard on the management side; S2, sending the encrypted file c to the target network device via SNMP protocol; S3. After the network device receives the encrypted file c, it uses the same pre-configured key k to decrypt it. The decryption process is defined as D(k, c). After decryption, the original update file m′ is obtained. S4, the device uses the decrypted update file m′ to perform a flash operation to complete the firmware or software update; S5. After the update is completed, the device selectively uses the AES encryption method to send a confirmation message to the management system.

2. A remote flashing method based on SNMP module according to claim 1, characterized in that: S11. During the encryption process, the length of the update file m is first determined and divided into multiple segments that conform to the AES block size, each segment being marked as m. i , where i is the index of the segment; S12. For each segment m i , execute the Advanced Encryption Standard encryption algorithm, the encryption process is defined as E k (m i ), where k is the selected AES key, E k represents the AES encryption function with k as the key, and the process generates the corresponding encrypted segment c i ; S13, introduce an initialization vector IV for the encryption of the first block, and for each subsequent block m i , the encrypted output of the previous block c i-1 Use as additional input to the current block: Where c0 = IV; S14, all c i The encrypted files are stitched together to form a complete encrypted file c, which will be sent to the target device via the SNMP protocol.

3. The remote flashing method based on SNMP module according to claim 1, characterized in that: S21, dividing the encrypted file c into multiple data segments of fixed length, adapting to the limitation of the SNMP protocol on the size of the data packet, setting the length of each data segment to L bytes, where the value of L is determined according to the network environment and the SNMP protocol version; S22, for each data segment c i Create an SNMP data packet, each data packet contains the standard header information required by the SNMP protocol, and a data field, the field stores the data segment c i ; S23, apply the checksum algorithm to each SNMP data packet, use the standard checksum function Checksum, and calculate the checksum CS (c i ): CS(c i )=Ch ecksum(c i ) And CS(c i ) is appended to the corresponding data packet; S24, sending these SNMP data packets in sequence through the network, using a connectionless transmission protocol, and including a sequence number in each data packet so that the target device can correctly reassemble the encrypted file c; S25. At the target device, perform checksum verification on each received SNMP data packet. If the checksum does not match, take error handling measures, discard the data packet and record the error. S26. Extract data segment c from the data packet that passes the verification i , and reassemble them in order to restore the complete encrypted file c.

4. A remote flashing method based on SNMP module according to claim 3, characterized in that: S251, after receiving an encrypted data packet encapsulated by SNMP, the target network device first separates the data part c i and its corresponding checksum CS(c i ); S252, the target device uses a predefined checksum algorithm to check the separated data part c i Recalculate the checksum CS′(c i ): CS′(c i )=Ch ecksum(c i ) Where Checksum represents the checksum function applied to the data packet; S253, the original checksum CS (c i ) and the recalculated checksum CS′(c i ) are compared. When the two are consistent, CS(c i ) = CS′(c i ), the data packet is considered not to have been tampered with during transmission and is used for subsequent encrypted file reassembly; S254, when the checksum does not match, CS (c i )≠CS′(c i ), the following error handling process is executed: Record the error information including the data packet sequence number, error time and possible error type, and send a retransmission request to the management end to retransmit the data segment c i Requests; S255, introduce a dynamic fault tolerance mechanism: set an error threshold T to determine when a comprehensive error recovery procedure should be triggered. When the number of consecutively received error packets is less than T, only request retransmission of these packets; when the number of errors reaches or exceeds T, a more comprehensive error recovery process is initiated, interrupting the current transmission and reinitializing the entire file transfer process; S256, this checksum verification process provides an additional layer of security for remote flash operations, providing effective protection against network fluctuations and potential data tampering.

5. The remote flashing method based on SNMP module according to claim 1, characterized in that: S31. After receiving the encrypted file c transmitted by the SNMP protocol, the target network device first reassembles the encrypted file c. Suppose c consists of several data segments c1, c2, ..., c n The network device reassembles these data segments in order to restore the encrypted file c; S32, using the AES decryption algorithm D corresponding to the encryption process k Decrypt the encrypted file c. The decryption algorithm is defined as D(k, c i ), where k is the same key used for encryption, and c i is a single data segment of the encrypted file c; S33, according to the working mode of the AES encryption algorithm, for each data segment c i Decryption is performed separately, using the Cipher Block Chaining (CBC) mode during encryption: Where m i is the original data segment obtained after decryption, c i-1 is the previous encrypted data segment. For the first data segment c1, use the initial vector IV: Among them, m1 is the first part of the update file obtained after the decryption process, D refers to the decryption function, which is the processing process corresponding to the encryption function. In the AES encryption framework, it is used to restore the data before encryption, k represents the key used for the encryption and decryption process. In AES encryption, this key is used to control the encryption algorithm and must be consistent during the encryption and decryption process, c1 is the first block of encrypted data. During the transmission process, the update file is encrypted and may be transmitted in blocks. c1 is the first of these blocks. IV refers to the initialization vector, which is used for the first data block in the encryption process. In the cipher block chaining (CBC) mode, IV is used to combine with the first data block c1 to increase the randomness and strength of the encryption; S34, repeat this decryption process until all encrypted data segments c i After being decrypted, the decrypted data segments m1 are reassembled in order to form a complete original update file m′; S35. Verify the integrity and correctness of the decrypted file m′ by using the same file integrity verification method as the encryption process, calculate the hash value of the file, and compare it with the hash value of the original file before transmission.

6. The remote flashing method based on SNMP module according to claim 1, characterized in that: S351. On the management side, for the update file m to be sent, calculate its hash value Hash(m), using SHA-256: Hash(m)=SHA256(m) The calculated hash value Hash(m) is encrypted with AES together with the update file m to form the encrypted file c and the encrypted hash value Hash c (m); S352: After receiving the encrypted file c, the target network device uses the configured AES key k to decrypt it and recover the updated file m′ and its hash value Hash c (m): m′,Hash c (m)=D k (c) The target device calculates the hash value Hash′(m′) for the decrypted file m′: Hash′(m′)=SHA256(m′) Where m′ refers to the message or data obtained after decryption, which in this patent usually refers to the firmware or software data of the updated device, and Hash c (m) This is the hash value of the encrypted message c before decryption. Before sending the encrypted message c, the management system calculates the hash value of the original message m and embeds it into the encryption process. D_k(c) represents the process of decrypting the encrypted data c using the AES decryption algorithm and key k. k is the decryption function, k is the key, and c is the received encrypted data. Hash(m') is the process of calculating the hash value of the decrypted message m' again. S353, compare the decrypted hash value Hash′(m′) with the encrypted transmitted hash value Hash c (m) for comparison: Verify=(Hash′(m′)==Hash c (m)) When the verification result Verify is true, it indicates that the file m′ has not been tampered with during the transmission and decryption process; When the verification result is false, it indicates that the file may have been damaged or tampered with during transmission or decryption, triggering the error handling process; S354. In the event of a verification failure, the target device will send an error notification to the management end and may request to resend the update file. A security threshold is set. If the number of consecutive verification failures exceeds this threshold, the target device will take additional security measures and suspend the update process to prevent potential security threats.

7. The remote flashing method based on SNMP module according to claim 1, characterized in that: S41, after successfully decrypting the update file m', the target network device first verifies the version and compatibility of the file. The device stores the current firmware or software version information V current , and compare it with the target version information V contained in m′ target For comparison: VerifyVersion=(V Current <V target ) When the result of VerifyVersion is true, it indicates that m′ is a newer version, and the update process continues; S42, during the flashing process, the device enters a safe mode, closes services and interfaces, reduces risks during the update process, and writes m′ into the firmware or software storage area of ​​the device to prevent interruption or damage during the flashing process; S43. After the update is completed, the device automatically restarts and performs a system integrity check, including running a diagnostic program and performing a hash check on the new firmware or software to confirm that the update is successful. The device calculates the hash value Hash(new) of the new firmware or software and compares it with the hash value Hash(m′) of m′: VerifyUpdate=(Hash(new)==Hash(m′)) When VerifyUpdate is true, it indicates that the update is successful; when VerifyUpdate is false, it indicates that there may be problems with the update, and the device will take recovery measures and roll back to the last stable version; S44. After the update is successful, the device will send a confirmation message to the management system through the SNMP protocol, indicating that the update has been successfully completed. The confirmation message should also be encrypted as described above.

8. The remote flashing method based on SNMP module according to claim 1, characterized in that: S51. After completing the update, the device constructs a confirmation message M containing the update status. ack , the message contains the update version number V new , update completion time T updated , and status indication; S52: The device uses the same AES key k as used to encrypt the update file to confirm the message M. ack Encrypt to form an encrypted confirmation message C ack : C ack =E(k,M ack ) S53, the device sends the encrypted confirmation message C ack Encapsulated into a data packet that complies with the SNMP protocol, The encrypted data packet is sent to the management system via the SNMP protocol; S54. After receiving the encrypted confirmation message, the management system decrypts it using the same key k as the device: M′ ack =D(k,C ack ) S55, the management system decrypts the message M' ack Perform integrity verification by comparing its hash value with the hash value of the message before sending: Hash′(M′ ack )=SHA256(M′ ack ) Verify=(Hash′(M′ ack )==Hash(M ack )) S56. When the verification passes, that is, Verify is true, the management system will record the update success and may trigger subsequent processes; when the verification fails, the management system will take appropriate measures, the system will issue an alarm or restart the update process.

Citation Information

Cited By

  • Cryptosporidium identifier embedding method and device from slice scanning to slice generation of instrument and readable storage medium of cryptosporidium identifier embedding method and device

    CN119676376A

  • Cryptosporidium identification embedded method, device and readable storage medium in instrument scanning to slice generation

    CN119676376B