A tamper-proofing verification method and device based on an encryptor and a medium

CN121690810BActive Publication Date: 2026-10-27INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511956450.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-10-27
Estimated Expiration
2045-12-23

AI Technical Summary

Technical Problem

[0003]然而,现有技术方案多依赖于运行在通用服务器环境中的软件算法来实现核心的加密与哈希计算

Benefits of technology

通过将核心的SM4加密与SM3哈希计算全部交由硬件加密机执行,确保了密钥的全程物理隔离与计算过程的不可干预,有效杜绝了密钥从服务器内存中泄露的风险,也防止了计算过程在通用软件环境中被旁路或篡改,从而为整个验证体系建立了一个高可信的硬件信任根。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121690810B_ABST
    Figure CN121690810B_ABST
Patent Text Reader

Abstract

The application discloses a tamper-proofing verification method and device based on an encryption machine and a medium, relates to the technical field of data security and information, and comprises the following steps: in response to an update event of a to-be-verified object, obtaining original plaintext data of the to-be-verified object; calling a cryptography processing interface of an encryption machine device, sending the original plaintext data to the encryption machine device for encryption processing, so as to generate first encrypted data and return the first encrypted data; associating and storing the first encrypted data with the to-be-verified object; in response to a verification request of the to-be-verified object, calling an encryption application interface, sending the first encrypted data to the encryption machine device for encryption processing, so as to generate second encrypted data and return the second encrypted data; comparing the first encrypted data associated with the to-be-verified object with the second encrypted data, and judging whether the information is tampered with; and when the information of the to-be-verified object is tampered with, performing a corresponding security response operation. The application improves the active defense capability and the security level of an application system when the application system faces internal threats and high-privilege attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of data security and information technology, specifically to a tamper-proof verification method, device, and medium based on an encryption machine. Background Technology

[0002] In the field of information technology, data security is the core of ensuring the trustworthy and reliable operation of information systems. Ensuring the integrity and tamper-proof nature of data during storage and use is particularly crucial. To this end, the industry typically employs cryptographic hash algorithms to verify data, combined with access control and audit logs, to build a multi-layered security protection system to address potential data tampering risks.

[0003] However, existing technical solutions mostly rely on software algorithms running in general-purpose server environments to implement core encryption and hash calculations. This approach exposes critical key processing and hash generation operations to host memory, making them vulnerable to theft or side-channel attacks. Simultaneously, audit logs generated during encryption for post-event traceability are also stored in general-purpose storage, which is also susceptible to access by high-privilege accounts. This weakens the foundation of security verification and makes it difficult to effectively defend against malicious data tampering or privilege escalation attempts from within the system or by attackers with high privileges. Summary of the Invention

[0004] To address the aforementioned problems, this application proposes a tamper-proof verification method based on an encryption machine, comprising: In response to an update event of the object to be verified, the original plaintext data of the object to be verified is obtained; the object to be verified includes application-sensitive associated objects and user role associated objects. The cryptographic processing interface of the encryption machine is invoked to send the original plaintext data to the encryption machine for encryption processing, so as to generate the first encrypted data and return it. Receive the first encrypted data, associate the first encrypted data with the object to be verified, and store it; In response to the verification request of the object to be verified, the current plaintext data is obtained, the encryption application interface is called, the current plaintext data is sent to the encryption device for encryption processing to generate second encrypted data and return it; Receive the second encrypted data, compare the first encrypted data associated with the object to be verified with the second encrypted data, and determine whether the information of the object to be verified has been tampered with; When the information of the object to be verified is tampered with, the preset defense mechanism corresponding to the object to be verified is triggered, and the corresponding security response operation is executed.

[0005] On the other hand, this application also proposes a tamper-proof verification device based on an encryption machine, comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform, for example, a tamper-proof verification method based on an encryption machine as described in the above example.

[0006] On the other hand, this application also proposes a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as: the anti-tampering verification method based on an encryption machine as described in the above example.

[0007] The tamper-proof verification method based on an encryption machine proposed in this application can bring the following benefits: By entrusting the core SM4 encryption and SM3 hash calculations to a hardware encryption machine, the physical isolation of the key and the non-interference of the calculation process are ensured throughout the process. This effectively eliminates the risk of key leakage from server memory and prevents the calculation process from being bypassed or tampered with in a general software environment, thus establishing a highly reliable hardware root of trust for the entire verification system.

[0008] Furthermore, by constructing a dual verification mechanism for data content and operation permissions, the coverage depth and reliability of anti-tampering are significantly enhanced. Not only is the sensitive data itself encrypted and hashed to ensure its static integrity, but dynamic user roles and permission configurations are also hashed and verified in real time to prevent unauthorized operations by illegally modifying the permission context. Overall, this improves the application system's proactive defense capabilities and security level when facing internal threats and high-privilege attacks. Attached Figure Description

[0009] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart illustrating an anti-tampering verification method based on an encryption machine in an embodiment of this application. Figure 2 This is a schematic diagram of the anti-tampering verification process for sensitive associated objects in the embodiments of this application; Figure 3 This is a schematic diagram of the anti-tampering verification process for user role association objects in the embodiments of this application; Figure 4 This is a schematic diagram of an anti-tampering verification device based on an encryption machine, as described in an embodiment of this application. Detailed Implementation

[0010] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0011] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0012] like Figure 1 As shown in the figure, this application provides a tamper-proof verification method based on an encryption machine, including: S101. In response to the update event of the object to be verified, obtain the original plaintext data of the object to be verified; the object to be verified includes application sensitive association objects and user role association objects.

[0013] Specifically, the application server monitors the operation entry points related to the object to be verified in real time to listen for whether the object to be verified triggers an update event. The objects to be verified include application-sensitive associated objects and user role associated objects.

[0014] In this application embodiment, the application sensitive associated object refers to sensitive information associated with the application system, such as user ID number, mobile phone number, bank account, and other field data in the database that contain personal privacy or direct asset information; the user role associated object refers to the role entity in the application system used to define the user permission set, including role identifier, role name, and corresponding permission list and other configuration information.

[0015] If the object to be verified is an application-sensitive associated object, in response to any modification operation to the data content of the application-sensitive associated object, the modified data content to be stored is obtained and used as the original plaintext data of the application-sensitive associated object. In specific implementation, the system receives form submission requests triggered by data submission operations and extracts the modified sensitive data fields and their corresponding new values ​​from the submitted request parameters. For example, when an administrator changes a user's phone number, the system extracts the field name "user_phone" and its corresponding new value. This new value is the modified data content to be stored, which is then encapsulated into a structured data unit and used as the original plaintext data of the application-sensitive associated object.

[0016] If the object to be verified is a user role associated object, in response to the role permission editing operation on the user role associated object, the edited role permission configuration data to be effective is obtained as the original plaintext data of the user role associated object. In specific implementation, a save request for role configuration triggered by an operation on the role permission configuration page is received, and all role attributes set in the current configuration interface are obtained, including but not limited to role ID, role name, and a list of selected permission points. The role attributes are serialized according to a preset key-value pair format (e.g., JSON), and the key names are sorted alphabetically to ensure the generation of a deterministic string. For example, the configuration information for the role "Credit Reviewer" is serialized as {"role_id":5, "role_name":"Credit Reviewer", "permissions":["loan:review", "loan:approve"]}, and after sorting, a deterministic string is obtained. This serialized string is used as the edited role permission configuration data to be effective, serving as the original plaintext data of the user role associated object.

[0017] S102. Call the cryptographic processing interface of the encryption machine device to send the original plaintext data to the encryption machine device for encryption processing, so as to generate the first encrypted data and return it.

[0018] Specifically, after acquiring the original plaintext data, the application server calls the cryptographic processing interface of the encryption device, including the SM4 encryption interface and the SM3 hash interface. The encryption device, as an independent hardware encryption device, provides standardized cryptographic service interfaces to the outside world.

[0019] Furthermore, the SM4 encryption interface of the encryption device is invoked, and the original plaintext data is sent to the encryption device. The encryption device performs encryption operations on the original plaintext data, generates the first ciphertext, and returns it through the SM4 encryption interface. In specific implementation, based on the original plaintext data and the SM4 encryption command, a first request message is generated, and the SM4 encryption interface of the encryption device is invoked to send the first request message to the encryption device through a secure communication link. The encryption device receives the request in its internal secure area, uses its securely stored SM4 key to perform SM4 symmetric encryption operations on the incoming original plaintext data, generates the corresponding first ciphertext, and returns the generated ciphertext result through the SM4 encryption interface.

[0020] The system calls the SM3 hash interface to send the original plaintext data to the encryption device. The encryption device performs a hash calculation on the original plaintext data, generates a first hash value, and returns it through the SM3 hash interface. In practice, a second request message is generated in parallel based on the original plaintext data and the SM3 hash instruction. This second request message is then sent to the encryption device via the SM3 hash interface. The encryption device independently performs the SM3 hash operation on the original plaintext data to generate a first hash value. After the operation is complete, the encryption device returns the first hash value through the SM3 hash interface.

[0021] It should be noted that the SM4 encryption process performed by calling the SM4 encryption interface of the encryption device and the SM3 hash calculation process performed by calling the SM3 hash interface are executed in parallel. Through two independent and parallel request-response interactions, the application server obtains the first ciphertext and the first hash value securely generated by the encryption device. Together, they constitute the first encrypted data referred to in the claims, establishing a dual cryptographic benchmark based on a hardware root of trust for the object to be verified.

[0022] In the embodiments of this application, such as Figure 1 As shown, when an application adds or edits sensitive information, it calls the SM4 encryption interface of the encryption machine to encrypt the data and stores the ciphertext in the database. It then calls the SM3 hash generation interface of the encryption machine to generate a hash value for the original plaintext sensitive data, denoted as oldHash_xxx, and associates this hash value with the encrypted data, recording metadata such as the operation time and operator. For update operations, historical hash records are retained, supporting data version traceability.

[0023] like Figure 2 As shown, when an administrator creates or edits a system role, key information for that role (such as role_id, role_name, permissions_list) is collected. The role information is serialized into JSON and then sorted alphabetically by key name to ensure the deterministic nature of hash generation. The SM3 interface of the encryption machine is called to generate a hash value oldHash_role from the sorted JSON string. oldHash_role, along with the basic role information, is stored in the database, recording the operator and timestamp.

[0024] S103. Receive the first encrypted data, associate the first encrypted data with the object to be verified, and store it.

[0025] Specifically, the first ciphertext, the first hash value, the current timestamp, and the identifier of the operator that triggered this update event are encapsulated into a structured baseline data object, and different associated storage logic is executed according to the category of the object to be verified.

[0026] If the object to be verified is an application-sensitive associated object, obtain the object's unique primary key in the database, call the database access service, and execute an update or insert SQL command. Through the SQL command, the first ciphertext is written to the encrypted data field corresponding to the user record, and the first hash value is simultaneously written to the hash verification field of the same record. Through the database's primary key constraint, the first ciphertext and the first hash value are strongly associated with the specific user data record, serving together as the baseline result for its integrity verification.

[0027] If the object to be verified is a user role associated with, then the unique identifier of that role is obtained, the database access service is invoked, and a new record is inserted into the role information table, or an existing record is updated. This record will contain role_id, other plaintext attributes of the role, the first hash value, and a timestamp. The first hash value is used as the core baseline result and stored directly associated with role_id for subsequent verification of the integrity of the role configuration.

[0028] It's important to note that the database operation execution results are captured during the storage process. If storage is successful, a local log entry for success is recorded; if storage fails, an exception handling process is triggered, such as rolling back the transaction and returning an error to the upper-layer service, ensuring the accuracy and consistency of the baseline data's association with the business object. All stored baseline data is indexed by the primary key of its associated business object, forming the sole basis for data retrieval in subsequent verification stages.

[0029] S104. In response to the verification request of the object to be verified, obtain the current plaintext data, call the encryption application interface, send the current plaintext data to the encryption device for encryption processing, generate the second encrypted data and return it.

[0030] Specifically, when a query or operation request for the object to be verified is received, the integrity verification process is initiated to obtain the current plaintext data corresponding to the object to be verified at the current moment.

[0031] In practice, for application-sensitive associated objects, a query is initiated to the database based on the object identifier carried in the request. The database returns the previously stored ciphertext field. The SM4 decryption interface of the encryption machine is then called again to retrieve the decrypted plaintext information from the encryption machine, which becomes the current plaintext data.

[0032] For user role association objects, based on the current user's identity, the associated role_id is queried, and then the latest configuration information for that role is retrieved from the role information table. After serializing and sorting this configuration information in the same format as the storage time, the resulting string is the current plaintext data.

[0033] After obtaining the current plaintext data, the SM4 encryption interface of the encryption machine is invoked to send the current plaintext data to the encryption machine. The encryption machine internally performs SM4 encryption on it using the same key and returns the newly generated ciphertext as the second ciphertext.

[0034] Simultaneously, the SM3 hash interface of the encryption machine is invoked, and the current plaintext data is sent to the encryption machine. The encryption machine performs an SM3 hash calculation on it and returns the newly generated hash value as the second hash value.

[0035] Therefore, by sequentially calling two independent interfaces, a second ciphertext and a second hash value, generated in real time by the same hardware encryption machine based on the current data, are obtained. These two values ​​together constitute the second encrypted data referred to in the claims. This data will be used to compare with previously stored baseline data to complete integrity verification.

[0036] S105. Receive the second encrypted data, compare the first encrypted data associated with the object to be verified with the second encrypted data, and determine whether the information of the object to be verified has been tampered with.

[0037] Specifically, after receiving the second ciphertext and the second hash value returned by the encryption machine, the comparison and verification logic is executed to determine whether the object to be verified has been tampered with since the baseline was established.

[0038] A query is initiated into the database based on the object identifier associated with the current verification request, and the first ciphertext and the first hash value associated with that object are read.

[0039] The second ciphertext is compared with the first ciphertext, and the second hash value is compared with the first hash value. In practice, a memory comparison function is called to compare the two ciphertext strings byte by byte. The comparison function is then used to compare the two hash value strings, and the result of each comparison is recorded.

[0040] Based on the comparison results, it is determined whether the information of the object to be verified has been tampered with. In specific implementation, the determination is made based on the logical combination of the two comparison results. The rule followed is: the application server determines that the information of the object to be verified is complete and has not been tampered with if and only if the second hash value matches the first hash value and the second ciphertext matches the first ciphertext. Conversely, if the second hash value does not match the first hash value, or the second ciphertext does not match the first ciphertext, the application server determines that the information of the object to be verified has been tampered with.

[0041] It's important to note that the first hash value is the unique fingerprint of the original plaintext data; a match between the hash value and the first ciphertext indicates that the data content has not been altered. The first ciphertext is the result of encrypting the original plaintext using a fixed key by the encryption machine; a match between the first ciphertext and the first ciphertext indicates that the data source and the encryption process remained unchanged. Both must match to constitute a complete trusted verification. Any discrepancy means that the current data state does not conform to the trusted benchmark established by the encryption machine, thus triggering a security response. The application server stores this final determination in memory and prepares to execute subsequent processes.

[0042] In this embodiment, for application-sensitive associated objects, when the application obtains this sensitive information, it reads encrypted data and the corresponding `oldHash_xxx` from the database. If plaintext needs to be displayed, the SM4 decryption interface is called to decrypt the ciphertext. For the decrypted plaintext, the SM3 interface of the encryption machine is called again to generate a new hash value, denoted as `newHash_xxx`. `oldHash_xxx` and `newHash_xxx` are compared. If they match, it is determined that the data has not been tampered with, the data is returned, and a successful verification log is recorded; if they do not match, it is determined that the data has been tampered with, and the following operations are immediately triggered: freezing the relevant account or data access permissions, sending a security alarm, and recording a detailed audit log, including the operator, time, data ID, hash comparison result, etc.

[0043] For user role-related objects, before a user performs an operation on the application, the associated role_id is queried based on the user_id. Based on the retrieved role_id, the corresponding oldHash_role is obtained from the database. The current role information is retrieved in real-time, and a new hash value newHash_role is generated. oldHash_role and newHash_role are compared. If they match, it indicates that the user's role information has not been tampered with, and the operation is allowed. If they do not match, it indicates that the role information may have been illegally modified, and the following actions are immediately taken: the current operation is denied, a security alert is triggered, permissions for all accounts under this role are frozen, and an audit log is recorded, including the user ID, role ID, operation type, and time.

[0044] S106. When the information of the object to be verified is tampered with, the preset defense mechanism corresponding to the object to be verified is triggered, and the corresponding security response operation is executed.

[0045] When it is determined that the information of the object to be verified has been tampered with, the preset defense mechanism corresponding to the object to be verified is triggered.

[0046] The inconsistent cryptographic data type is identified, and based on this data type, the tampering event type of the object to be verified is determined. In specific implementation, based on the specific inconsistency results recorded in the aforementioned judgment process—that is, the second hash value is inconsistent with the first hash value, and / or the second ciphertext is inconsistent with the first ciphertext—the inconsistent cryptographic data type that triggered this tampering judgment is determined. Based on the category of the current object to be verified and the determined inconsistent cryptographic data type, a specific tampering event type identifier is generated through predefined mapping rules.

[0047] Furthermore, based on the tampering event type, the corresponding security response instruction is retrieved from the preset security policy library and executed. In specific implementation, the preset security policy library, which is loaded locally or configured remotely, is accessed. The generated tampering event type identifier and the current object category are used as combined query conditions to retrieve a predefined set of security response instructions that match the generated identifier from the policy library. The preset security policy library is indexed by the event type identifier and the object category.

[0048] Furthermore, the retrieved security response instructions are executed one by one. The actions include: rejecting associated business operations, specifically calling the access control function of the business logic layer to interrupt the current verification request session; generating and sending security alarms, specifically assembling a structured alarm notification data packet containing key information such as the tampering event type, object identifier, and time, and calling the message push service interface to send it to the preset administrator notification terminal; and recording audit logs, specifically collecting the operation data generated in this security response process, including the executed instruction content, execution status, and timestamp. This operation data is associated and encapsulated with the tampering event type identifier and the object identifier to be verified, generating a structured audit log data unit.

[0049] Furthermore, a dedicated log storage service interface is invoked to write this audit log data unit into a designated data table in an independent audit database, thus completing the traceable recording of this security incident.

[0050] This application ensures the physical isolation of the key and the non-interference of the calculation process by entrusting the core SM4 encryption and SM3 hash calculation to a hardware encryption machine. This effectively eliminates the risk of key leakage from server memory and prevents the calculation process from being bypassed or tampered with in a general software environment, thereby establishing a highly reliable hardware root of trust for the entire verification system.

[0051] Furthermore, by constructing a dual verification mechanism for data content and operation permissions, the coverage depth and reliability of anti-tampering are significantly enhanced. Not only is the sensitive data itself encrypted and hashed to ensure its static integrity, but dynamic user roles and permission configurations are also hashed and verified in real time to prevent unauthorized operations by illegally modifying the permission context. Overall, this improves the application system's proactive defense capabilities and security level when facing internal threats and high-privilege attacks.

[0052] like Figure 4 As shown in the embodiments of this application, a tamper-proof verification device based on an encryption machine is also proposed, comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a tamper-proof verification method based on an encryption machine as described in any of the above embodiments.

[0053] This application also provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as: a tamper-proof verification method based on an encryption machine as described in any of the above embodiments.

[0054] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.

[0055] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0056] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0057] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0058] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0059] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0060] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0061] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0062] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0063] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0064] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A tamper-proof verification method based on an encryption machine, characterized in that, include: In response to an update event of the object to be verified, the original plaintext data of the object to be verified is obtained; The objects to be verified include application-sensitive associated objects and user role associated objects; The cryptographic processing interface of the encryption machine is invoked to send the original plaintext data to the encryption machine for encryption processing, so as to generate the first encrypted data and return it. Receive the first encrypted data, associate the first encrypted data with the object to be verified, and store it; In response to the verification request of the object to be verified, the current plaintext data is obtained, the encryption application interface is called, and the current plaintext data is sent to the encryption device for encryption processing to generate second encrypted data and return it. Specifically, the current plaintext data is as follows: for application-sensitive associated objects, a query is initiated to the database based on the object identifier carried in the request. The database returns the previously stored ciphertext field, and the SM4 decryption interface of the encryption device is called again to obtain the decrypted plaintext information from the encryption device; for user role associated objects, the role_id associated with the current user is queried based on the current user's identity identifier, and then the latest configuration information of the role is obtained from the role information table. This configuration information is serialized and sorted according to the same format as the storage time to obtain the string. Receive the second encrypted data, compare the first encrypted data associated with the object to be verified with the second encrypted data, and determine whether the information of the object to be verified has been tampered with; When the information of the object to be verified is tampered with, the preset defense mechanism corresponding to the object to be verified is triggered, and the corresponding security response operation is executed.

2. The tamper-proof verification method based on an encryption machine according to claim 1, characterized in that, The step of responding to an update event of the object to be verified and obtaining the original plaintext data of the object to be verified specifically includes: If the object to be verified is an application-sensitive associated object, in response to the data content modification operation of the application-sensitive associated object, the modified data content to be stored is obtained as the original plaintext data of the application-sensitive associated object; If the object to be verified is a user role associated object, in response to the role permission editing operation of the user role associated object, the edited role permission configuration data to be effective is obtained as the original plaintext data of the user role associated object.

3. The tamper-proof verification method based on an encryption machine according to claim 1, characterized in that, The encrypted application interface includes an SM4 encryption interface and an SM3 hash interface; The step of calling the cryptographic processing interface of the encryption device to send the original plaintext data to the encryption device for encryption processing specifically includes: The SM4 encryption interface of the encryption device is invoked to send the original plaintext data to the encryption device. The encryption device performs encryption operations on the original plaintext data to generate the first ciphertext and returns it through the SM4 encryption interface. The SM3 hash interface is invoked to send the original plaintext data to the encryption device. The encryption device performs a hash calculation on the original plaintext data, generates a first hash value, and returns it through the SM3 hash interface.

4. The tamper-proof verification method based on an encryption machine according to claim 3, characterized in that, The step of calling the encryption application interface to send the current plaintext data to the encryption device for encryption processing specifically includes: The SM4 encryption interface is invoked to send the current plaintext data to the encryption device. The encryption device performs encryption operations on the current plaintext data to generate a second ciphertext, which is then returned through the SM4 encryption interface. The SM3 hash interface is invoked to send the current plaintext data to the encryption device. The encryption device performs a hash calculation on the current plaintext data, generates a second hash value, and returns it through the SM3 hash interface.

5. The tamper-proof verification method based on an encryption machine according to claim 4, characterized in that, The step of comparing the first encrypted data associated with the object to be verified with the second encrypted data to determine whether the information of the object to be verified has been tampered with specifically includes: Compare the second ciphertext with the first ciphertext, and compare the second hash value with the first hash value; Based on the comparison results, it is determined whether the information of the object to be verified has been tampered with; When the second hash value matches the first hash value, and the second ciphertext matches the first ciphertext, the information of the object to be verified is determined to be complete. If the second hash value does not match the first hash value, or if the second ciphertext does not match the first ciphertext, then it is determined that the information of the object to be verified has been tampered with.

6. The tamper-proof verification method based on an encryption machine according to claim 3, characterized in that, The step of receiving the first encrypted data returned by the encryption device, associating the first encrypted data with the object to be verified, and storing it specifically includes: Receive the first ciphertext and the first hash value returned by the encryption device; The first ciphertext and the first hash value are used as a baseline result, associated with the object to be verified, and stored in the database.

7. The tamper-proof verification method based on an encryption machine according to claim 1, characterized in that, When the information of the object to be verified is tampered with, the preset defense mechanism corresponding to the object to be verified is triggered, and the corresponding security response operation is executed, specifically including: When it is determined that the information of the object to be verified has been tampered with, the inconsistent password data type is identified, and based on the password data type, the tampering event type of the object to be verified is determined. Based on the type of tampering event, the corresponding security response instruction is retrieved from the preset security policy library and executed.

8. The tamper-proof verification method based on an encryption machine according to claim 1, characterized in that, After performing the corresponding security response operation, the method further includes: Obtain the operation data generated during the execution of the security response instruction, associate and encapsulate the operation data with the tampering event type, and generate structured audit log data; Call the log storage service interface to write the audit log data into the specified data table of the audit database.

9. A tamper-proof verification device based on an encryption machine, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a tamper-proof verification method based on an encryption machine as described in any one of claims 1 to 8.

10. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are configured to execute the tamper-proof verification method based on an encryption machine as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Multi-level role permission control method and device based on cryptography

    CN112422287A

  • Hardware cryptographic module based on domestic commercial cryptographic algorithm and implementation method thereof

    CN119276463A