A data encryption and decryption method for enterprise identity authentication
By introducing multi-source state digest and adversarial consistency verification mechanisms into the enterprise identity authentication system, the static inheritance problem of key call behavior is solved, the security of terminal anti-hijacking and data access isolation is improved, and real-time linkage constraints and dynamic rebinding of the key call process are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING YINHUI INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2025-08-05
- Publication Date
- 2026-05-08
AI Technical Summary
In existing technologies, key retrieval behavior in enterprise identity authentication and data encryption/decryption systems lacks a real-time verification mechanism, resulting in static inheritance of authentication status. This makes it difficult to deal with session hijacking and cross-session permission abuse, and poses a risk of data leakage.
By introducing multi-source state digest construction, adversarial consistency verification, and credibility scoring mechanisms, and by binding the real-time generated context state before key invocation, deep decoupling and dynamic rebinding of identity authentication and decryption actions are achieved, thereby improving the terminal's anti-hijacking capabilities and data access isolation accuracy.
It realizes real-time linkage constraints in the key retrieval process, enhances the ability to identify adversarial digest generation and credibility verification, blocks the static inheritance path of authentication status, and improves the system's permission isolation capability under multi-user shared terminals.
Smart Images

Figure CN120934807B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data encryption and decryption technology, and more specifically, to a data encryption and decryption method for enterprise identity authentication. Background Technology
[0002] In a UKey-based enterprise identity authentication and data encryption / decryption system, the typical execution process is as follows: After the user inserts the UKey into the terminal and completes identity verification, the system sends identity information such as the CN number to the server for comparison and confirmation. Once the authentication is successful, the user can use the RSA private key in the UKey to perform the decryption operation. This operation superficially achieves the coupling of identity trust and data security, but there are obvious security gaps in the deeper stages of the operation path, especially exposing systemic defects in terminal security management.
[0003] The core issue is that there is a linear sequential relationship between identity authentication and key retrieval. Once authentication is successful, the key is activated by default and remains available. The system does not establish a real-time verification mechanism or context constraint for key retrieval behavior. This means that the decryption permission granted by any authentication remains on the terminal throughout the entire session, resulting in persistent permission retention. This leads to the static inheritance of authentication status, making it difficult to cope with sudden session hijacking or context transfer attacks.
[0004] In real-world attack scenarios, if the terminal environment encounters issues such as script injection, remote control, user switching, or sandbox escape, attackers can illegally access keys without re-authentication to perform operations such as data decryption, extraction of sensitive information, or abuse of cross-session permissions. Such behavior bypasses the original authentication protection, destroys the control boundary of decryption actions, and renders terminal security virtually non-existent. Especially in enterprise scenarios, where multiple users share login devices or access the backend system through browser plugins, this default structure of keeping keys available will greatly amplify the risk of data leakage after nodes are compromised.
[0005] Therefore, it can be seen that the existing technology lacks dynamic constraints on decryption permissions and real-time identity association control, which causes the key to be exposed to the terminal for a long time after authentication, affecting terminal security and node-level data access isolation strategies. Summary of the Invention
[0006] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a data encryption and decryption method for enterprise identity authentication. By introducing multi-source state digest construction, adversarial consistency verification, and credibility scoring mechanisms before key invocation, the key usage behavior is bound to the real-time generated context state, thereby achieving deep decoupling and dynamic rebinding between identity authentication and decryption actions. This blocks the static inheritance path of authentication state, improves the terminal's anti-hijacking capability and data access isolation accuracy, and solves the risk of data leakage and permission abuse caused by the continuous exposure of keys after authentication in traditional structures.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a data encryption and decryption method for enterprise identity authentication, comprising:
[0008] S1. The user terminal identifies the accessed UKey in the current session and completes device initialization; a session channel is established between the current user terminal and the UKey, and status information is written into the session channel; the status information includes the user terminal identifier, session context, and UKey identifier;
[0009] S2. Through the session channel, the authentication identifier information and authentication key information stored in the UKey are called. After the user enters the identity password, the authentication identifier information is sent to the server. After the server verifies the authentication, it generates an authentication credential based on the terminal identifier, timestamp and the identifier of the current session channel, and returns the authentication credential to the user terminal.
[0010] S3. After the authentication credentials are returned, the user terminal extracts the session context from the current session channel, records the user interaction records, and collects relevant parameters of the terminal environment. It then generates the corresponding context summary, interaction summary, and terminal environment summary as state summaries and writes the state summary into the UKey's state cache area.
[0011] S4. When a user initiates a decryption request, the user terminal regenerates the state digest to be compared based on the current page's session context, user interaction records, and relevant parameters of the terminal environment, and performs a consistency check between the state digest to be compared and the original state digest.
[0012] S5. If the consistency check is successful, the decryption key information in the UKey is used to perform the decryption operation on the target ciphertext data; if the check fails, the decryption operation is rejected and an authentication failure message is returned.
[0013] In a preferred embodiment, in S1, after the user terminal completes the identification and initialization of the accessed UKey, a communication relationship is established based on the user terminal identifier and the UKey identifier, a session channel identifier with consistent structure is generated, and the data structure of the session channel is initialized with the channel identifier.
[0014] After the session channel is initialized, the user terminal identifier, the session context, and the UKey identifier are encoded and organized according to a preset field order to construct status information, and the status information is embedded into the corresponding status field position in the data structure of the session channel.
[0015] After the status information is written, the status field is bound to the corresponding area of the session channel as an association index between the authentication behavior and the key request behavior. This is used to trace the authentication status by referencing the corresponding status information when the decryption request passes through the session channel.
[0016] In a preferred embodiment, in step S2, after the session channel is established, the user terminal accesses the connected UKey through the session channel and calls the authentication identifier information and authentication key information pre-stored in the UKey to perform an authentication data reading operation; the authentication identifier information includes a unique identifier field corresponding to the enterprise, used to identify the user's identity; the authentication key information includes private key data used for unlocking and signing, used to perform authentication operations, and the authentication identifier information and authentication key information are pre-stored in the UKey through the key generation and certificate writing process and are set to be non-exportable;
[0017] After the authentication data is read, the system receives the user's input password and performs unlock verification on the authentication key information. After the verification is successful, the authentication identifier information and the current terminal identifier are jointly encapsulated to form an authentication request message.
[0018] The authentication request message is sent to the server through the session channel. The server matches and verifies the authentication identifier information. After successful verification, authentication credentials are generated based on the terminal identifier, timestamp, and the identifier of the current session channel.
[0019] After the authentication credential is generated, it is returned to the user terminal through the original channel and stored in the terminal's local cache.
[0020] In a preferred embodiment, in S3, the authentication credential... Upon returning, the user terminal extracts three input sequences from the current session channel: the session context sequence, etc. User interaction record sequence and terminal environment sequence The three input sequences are concatenated into an initial state tensor. :
[0021] ;
[0022] The first adversarial phase of building S3:
[0023] Initialize the adversarial substructure: Generate a network using perturbations right Add Gaussian perturbation Generate pseudo-state tensors As an adversarial substructure:
[0024] ;
[0025] Execute the adversarial discrimination loop: Build the state discriminator Compare the initial state tensor With pseudo-state tensor Consistency score :
[0026] ;
[0027] definition If the preset consistency threshold is... Then, Gaussian perturbation resampling and reconstruction are performed to regenerate new data. And iteratively construct new , is represented as:
[0028] ;
[0029] Otherwise, proceed to the second phase of the confrontation in S3:
[0030] In the second adversarial phase of S3, a summary generation function is constructed. ,right Perform multi-head segmentation mapping and extract context summary. Interactive summary Terminal Environment Summary , merged into the final state summary :
[0031] ;
[0032] Credibility Detection: Building a Credibility Validator Calculate the credibility score :
[0033] ;
[0034] definition If the preset confidence score threshold is set, If the state summary fails the binding verification, then the process should be retried. ,until Established; the verified state summary will be generated. Write the state to the UKey's state cache and use the state digest as the current authentication credential. The unique state binding structure;
[0035] in To counteract the disturbance vector; Let the mean be 0 and the covariance matrix be... Multidimensional Gaussian perturbation; Gaussian perturbation Represents the adversarial perturbation vector It follows a pattern with a mean of 0 and a covariance matrix of... The multidimensional Gaussian distribution.
[0036] In a preferred embodiment, in step S4, when the user terminal receives the decryption request, the relevant parameters of the current page's session context, user interaction records, and terminal environment are collected, and the session context summary, user interaction summary, and terminal environment summary to be compared are constructed by the context summary generation function, the interaction summary generation function, and the terminal environment summary generation function, respectively.
[0037] The three summaries to be compared are sequentially input into the summary generation function. In, generated at a specific time point Summary of the state to be compared :
[0038] ;
[0039] in, Indicates a point in time The collected ; Indicates a point in time The collected ; Indicates a point in time The collected ; This indicates the number of locally nested segments that are divided during state summary generation; Indicates the index of a local segment; Indicates the first Attention weight coefficients for each local segment; It is a multilayer perceptron; Indicates the first The three summaries to be compared within a local segment are spliced together to form a unified input;
[0040] Synchronous call from UKey and the state summary to be compared and Input to state discriminator In the middle, through the state discriminator Output preliminary consistency marking results :
[0041] ;
[0042] If the preliminary consistency marking result Then continue With perturbation generation network Generated multiple sets of perturbation state summaries Input together into the credibility verifier To perform stability verification and credibility verification. Output value satisfy:
[0043] ;
[0044] in Indicates the first A network generated by perturbation The generated summary of the perturbation state; This indicates that these perturbation state summaries are generated by a perturbation generation network. Generated; This indicates that this is the [number]. One perturbation sample; Represents a set of perturbation state summaries, from the 1st to the 2nd. One, total Summary of the disturbance states; This represents the total number of perturbed samples;
[0045] in The mean vector representing the summary of all perturbation states; express The mapping weight matrix has dimensions of ,in For the state summary dimension, For intermediate hidden layer dimensions; express The mapping weight matrix has dimensions of ; The score vector represents the credibility output in its transposed form, with dimension 1. ;
[0046] definition To preset the credibility threshold, if If so, the current request is considered to be in a valid authentication state, and subsequent key retrieval steps are allowed; if If the authentication fails, the trusted status is deemed invalid, the key access is rejected, and an authentication failure message is returned.
[0047] If the preliminary consistency marking result If the state consistency check is rejected, the decryption process is directly blocked, and the current request is considered an untrusted request.
[0048] In a preferred embodiment, the system further includes an S6 behavior auditing step: upon completion of the decryption operation, the key usage behavior and associated state digest are written into the user terminal's log and synchronously uploaded to the server's auditing module via the session channel.
[0049] The technical effects and advantages of this invention are as follows:
[0050] 1. Construct a state dependency mechanism for decryption permissions to achieve real-time linkage constraints between identity authentication and key invocation, and solve the risk of key abuse caused by the static inheritance of traditional authentication state;
[0051] 2. A perturbation-driven state digest structure is adopted to encode the context, user behavior and session dynamics, enabling the key invocation process to have environment awareness and behavior traceability capabilities, and realizing context-sensitive control;
[0052] 3. The introduction of an adversarial digest generation and credibility verifier combination structure improves the ability to identify spoofed digests, hijacking behavior and cross-session attacks, which is beneficial for consistency verification.
[0053] 4. Before decryption keys are invoked, they must pass a state digest consistency check and credibility scoring mechanism to form a closed loop of "multi-factor behavior confirmation" and block the channel for abuse of authentication credentials from the mechanism.
[0054] 5. Embed the key invocation behavior into a multimodal state comparison structure, and enhance the model's discriminative power through residual attention channels to improve the system's permission isolation capability under multi-user shared terminals. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the method steps of the present invention. Detailed Implementation
[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] Refer to the instruction manual appendix Figure 1 An embodiment of the present invention provides a data encryption and decryption method for enterprise identity authentication, comprising:
[0058] S1. Communication establishment steps: The user terminal identifies the accessed UKey in the current session and completes device initialization; a session channel is established based on the current user terminal and UKey, and the status information is written into the session channel to form a session binding relationship between identity authentication and key request; the status information includes user terminal identifier, session context and UKey identifier;
[0059] S2. Identity authentication steps: Through the session channel, the authentication identifier information and authentication key information stored in the UKey are called. After the user enters the identity password, the authentication identifier information is sent to the server. After the server verifies the authentication, it generates an authentication credential based on the terminal identifier, timestamp and the identifier of the current session channel, and returns the authentication credential to the user terminal.
[0060] S3. State Construction Steps: After the authentication credentials are returned, the user terminal extracts the session context from the current session channel, records the user interaction records, and collects relevant parameters of the terminal environment. It generates corresponding context digests, interaction digests, and terminal environment digests as state digests, and writes the state digests into the UKey's state cache area as the basis for dynamic binding of the current authentication state.
[0061] S4. State comparison step: When a user initiates a decryption request, the user terminal regenerates the state summary to be compared based on the current page's session context, user interaction records, and relevant parameters of the terminal environment. The state summary to be compared is then compared with the original state summary to determine whether the current request maintains a valid authentication state.
[0062] S5. Key retrieval steps: When the consistency check is successful, the decryption key information in the UKey is used to perform the decryption operation on the target ciphertext data; if the check fails, the decryption operation is rejected and an authentication failure message is returned, thus implementing the constraint of authentication status on key usage.
[0063] S6. Behavior auditing steps: Upon completion of the decryption operation, the key usage behavior and associated state digest are written into the user terminal's log and synchronously uploaded to the server's auditing module through the session channel to establish a key usage tracking chain based on authentication state control.
[0064] In S1, after the user terminal completes the identification and initialization of the accessed UKey, a communication relationship is established based on the user terminal identifier and the UKey identifier, a session channel identifier with the same structure is generated, and the data structure of the session channel is initialized with the channel identifier.
[0065] After the session channel is initialized, the user terminal identifier, the session context, and the UKey identifier are encoded and organized according to a preset field order to construct status information, and the status information is embedded into the corresponding status field position in the data structure of the session channel.
[0066] After the status information is written, the status field is bound to the corresponding area of the session channel as an association index between the authentication behavior and the key request behavior. This is used to trace the authentication status by referencing the corresponding status information when the decryption request passes through the session channel.
[0067] In step S2, after the session channel is established, the user terminal accesses the connected UKey through the session channel and calls the authentication identifier information and authentication key information pre-stored in the UKey to perform authentication data reading operations. The authentication identifier information includes a unique identifier field corresponding to the enterprise, used to identify the user's identity. The authentication key information includes private key data used for unlocking and signing, used to perform authentication operations. The authentication identifier information and authentication key information are pre-stored in the UKey through the key generation and certificate writing process and are set to be non-exportable.
[0068] After the authentication data is read, the system receives the user's input password and performs unlock verification on the authentication key information. After the verification is successful, the authentication identifier information and the current terminal identifier are jointly encapsulated to form an authentication request message.
[0069] The authentication request message is sent to the server through the session channel. The server matches and verifies the authentication identifier information. After successful verification, authentication credentials are generated based on the terminal identifier, timestamp, and the identifier of the current session channel.
[0070] After the authentication credential is generated, it is returned to the user terminal through the original channel and stored in the terminal's local cache.
[0071] It should be noted that in the formula structure involved in this scheme, dimensionless terms can be used as proportional or structural adjustment factors. When combined with quantities with units, they only play a role in numerical scaling and do not introduce new physical dimensions. Therefore, they will not change or confuse the overall unit system. This combination of "dimensionless terms and terms with units" can be understood as a composite structural expression commonly used in mathematical physics modeling. It conforms to the principle of dimensional consistency and has a clear physical interpretation basis.
[0072] Secondly, in the formula structure of this scheme, if multiple variables with different physical units are involved, including but not limited to time, mass or energy variables, their joint appearance is to express the collaborative modeling relationship of multiple physical mechanisms. Each variable can form a unified structure through function mapping, ratio combination or normalization adjustment, with clear units and clear meaning. The overall expression conforms to the principle of dimensional consistency and the conventional formula of engineering modeling.
[0073] In this solution, constants, weights, adjustment factors, threshold parameters, proportional coefficients, etc., are all adjustable control parameters for different application environments. Their values depend on the target equipment configuration, data input characteristics, and performance optimization goals. During the implementation phase, they are set to converge within a reasonable range through model verification, performance constraints, or engineering calibration. Although these parameters do not have a unique preset value, they have clear adjustment logic and calculation paths. They belong to the deterministic setting process in engineering implementation. The purpose of this setting is to ensure that the solution is both universally adaptable and reproducible and operable, without affecting its technical clarity and feasibility.
[0074] In addition, the session context in S3 refers to a series of web page or application state information directly related to the user's operating environment in the current authentication session. Session context includes, but is not limited to: the URL of the currently active page, DOM structure summary, page load timestamp, browser session token, currently active window identifier, page hierarchy path, etc. These parameters are used to collectively constitute the interface scenario that uniquely identifies the current authentication operation, thereby ensuring that state binding is targeted and contextually complete; session context sequence. Refers to the context of the conversation;
[0075] User interaction records refer to quantifiable data of a series of real user actions during the current authentication session. These records are used to depict the user's dynamic operation trajectory and include, but are not limited to: mouse click coordinate sequences, keyboard input character sequences, focus switching order, page scrolling trajectories, view dwell time statistics, and interaction frequency of persistent elements. These behavioral characteristics of user interaction records are mapped over time and modeled using frequency to form a vector representation of the user's current behavior pattern, which is used for behavior recognition and pseudo-operation detection in subsequent authentication states. The user interaction record sequence... Refers to user interaction records;
[0076] The relevant parameters of the terminal environment refer to the system-level and hardware-level runtime environment information of the user's device during the authentication session. These include, but are not limited to: operating system version, browser type and version, CPU architecture information, device unique identifier (such as UUID), system time zone setting, language environment, memory usage, hardware fingerprint (such as screen resolution, GPU model), UKey access port serial number, etc. These parameters are primarily used to construct the terminal trust boundary upon which the current authentication state depends, and to identify whether system migration, virtualization emulation, or hardware replacement has occurred during the session. Terminal environment sequence... Refers to relevant parameters of the terminal environment;
[0077] In S3, in the authentication credential Upon returning, the user terminal extracts three input sequences from the current session channel: the session context sequence, etc. User interaction record sequence and terminal environment sequence The three input sequences are concatenated into an initial state tensor. :
[0078] ;
[0079] The first adversarial phase of building S3:
[0080] 1. Initialize the adversarial substructure: Generate a network using perturbations. right Add Gaussian perturbation Generate pseudo-state tensors As an adversarial substructure:
[0081] ;
[0082] 2. Execute the adversarial discrimination loop: Construct the state discriminator Compare the initial state tensor With pseudo-state tensor Consistency score :
[0083] ;
[0084] definition If the preset consistency threshold is... Then, Gaussian perturbation resampling and reconstruction are performed to regenerate new data. And iteratively construct new ,definition Indicates new , Indicates the first The covariance matrix used in round perturbation sampling, The current adversarial generation process is shown in the first... Round iteration index, represented as:
[0085] ;
[0086] Otherwise, proceed to the second phase of the confrontation in S3:
[0087] 1. In the second adversarial phase of S3, construct a summary generation function. ,right Perform multi-head segmentation mapping and extract context summary. Interactive summary Terminal Environment Summary , merged into the final state summary :
[0088] ;
[0089] 2. Credibility Detection: Constructing a Credibility Verifier Calculate the credibility score :
[0090] ;
[0091] definition If the preset confidence score threshold is set, If the state summary fails the binding verification, then the process should be retried. ,until Established; the verified state summary will be generated. Write the state to the UKey's state cache and use the state digest as the current authentication credential. The unique state binding structure forms an irreversible double binding system, ensuring that any intermediate state disturbance will be dynamically rejected in the next stage.
[0092] in To counteract the disturbance vector; Let the mean be 0 and the covariance matrix be... Multidimensional Gaussian perturbation; Gaussian perturbation Represents the adversarial perturbation vector It follows a pattern with a mean of 0 and a covariance matrix of... Multidimensional Gaussian distribution, Perturbations are randomly sampled from a normal distribution to introduce structural changes and generate pseudo-state tensors. ;symbol Represents the concatenation operation of vectors or tensors;
[0093] Perturbation Generated Network In this scheme, it refers to a generative model used to construct adversarial state tensors, whose input is the original state tensor. and the adversarial perturbation vector The output is the pseudo-state tensor after structural perturbation. Perturbation Generated Network The task is to introduce structural perturbations to induce a shift in the state representation space while maintaining the recognizability of the original state features, thereby supporting the subsequent consistency discrimination and adversarial training process.
[0094] In practical applications, perturbation generation networks This includes building upon variational autoencoder (VAE) or generative adversarial network (GAN) architectures, combined with multilayer perceptron (MLP) or convolutional neural network (CNN) as the generative backbone, to support the fusion generation process of perturbation vectors and original tensors;
[0095] State discriminator Including but not limited to a dual-branch discriminative structure composed of a structurally optimized graph convolutional network (GCN) and an attention-enhanced residual network, wherein the graph convolution is used to model the structural dependencies in the multidimensional state tensor, and the attention residual module is used to capture fine-grained perturbation features and contextual interaction paths;
[0096] Summary generation function It consists of a multilayer perceptron (MLP) and an additive attention mechanism in sequence. The MLP is used to extract the state feature vector of the input, and the additive attention mechanism generates a fixed-length state summary vector by calculating and normalizing the weighted correlation score between the state vector and the context vector.
[0097] Credibility verifier The credibility verification formula includes, but is not limited to:
[0098] ;
[0099] in Used to Project onto a unified feature space and extract its core semantic structural features; Used for authentication Perform a linear mapping to capture its interaction with the semantic distribution of the state summary; It is the bias vector; The hyperbolic tangent function is used to extract nonlinear semantic interactions in the above equation. This represents a trainable attention mapping vector used for the final credibility score; For transpose; The Sigmoid activation function is used to normalize the result to... The interval represents the credibility score.
[0100] In step S4, when the user terminal receives the decryption request, the relevant parameters of the current page's session context, user interaction records, and terminal environment are collected, and the session context summary, user interaction summary, and terminal environment summary to be compared are constructed by the context summary generation function, the interaction summary generation function, and the terminal environment summary generation function, respectively.
[0101] The three summaries to be compared are sequentially input into the summary generation function. In, generated at a specific time point Summary of the state to be compared :
[0102] ;
[0103] in, Indicates a point in time The collected ; Indicates a point in time The collected ; Indicates a point in time The collected ; This indicates the number of locally nested segments that are divided during state summary generation; Indicates the index of a local segment; Indicates the first The attention weight coefficients for each local segment are calculated by an additive attention mechanism and used to weight the importance of different segments. It is a multilayer perceptron, which is used to perform nonlinear mapping on input features and extract local semantic representations; Indicates the first The three summaries to be compared within a local segment are spliced together to form a unified input;
[0104] Synchronous call from UKey and the state summary to be compared and Input to state discriminator In the middle, through the state discriminator Output preliminary consistency marking results :
[0105] ;
[0106] If the preliminary consistency marking result Then continue With perturbation generation network Generated multiple sets of perturbation state summaries Input together into the credibility verifier To perform stability verification and credibility verification. Output value satisfy:
[0107] ;
[0108] in Indicates the first A network generated by perturbation The generated perturbation state summary, each They are all state tensors or vectors with perturbations but consistent with the structure of the real state summary; This indicates that these perturbation state summaries are generated by a perturbation generation network. Generated to simulate possible state behaviors in attack or unauthorized environments; This indicates that this is the [number]. One perturbation sample; Represents a set of perturbation state summaries, from the 1st to the 2nd. One, total Summary of the disturbance states; The total number of perturbation samples is set by the system, for example, by setting... This indicates that 10 perturbation samples are generated;
[0109] in The mean vector representing the summary of all perturbation states; express The mapping weight matrix has dimensions of ,in For the state summary dimension, The intermediate hidden layer dimension can be understood as Used to Mapped to a unified space; express The mapping weight matrix has dimensions of , and This is used to map two summary tensors to the same feature space together for easy fusion; The score vector represents the credibility output in its transposed form, with dimension 1. Its function is to compress the fused state difference features into a scalar score, which is used as a credibility output. This represents the Sigmoid activation function; It is the hyperbolic tangent function;
[0110] definition To preset the credibility threshold, if If so, the current request is considered to be in a valid authentication state, and subsequent key retrieval steps are allowed; if If the authentication fails, the trusted status is deemed invalid, the key access is rejected, and an authentication failure message is returned.
[0111] If the preliminary consistency marking result If the state consistency check is rejected, the decryption process is directly blocked, and the current request is considered an untrusted request.
[0112] It should be noted that this solution is a data encryption and decryption method for enterprise identity authentication. Its core lies in building an authentication binding mechanism and a consistency verification mechanism based on state digest, thereby ensuring the authentication validity and immutability during key usage.
[0113] In the communication establishment step of S1, after the user terminal identifies the currently accessed UKey and completes initialization, it establishes a session channel with the UKey and writes state information containing the terminal identifier, session context and UKey identifier into the channel. This binding behavior provides the basis for subsequent authentication binding. The binding relationship here does not rely solely on the existence of the channel, but establishes a two-way data association between the authentication process, the physical UKey instance, the terminal device and the session context.
[0114] In the S2 authentication process, authentication identifier information and authentication key information stored in the UKey are used. After the user enters the identity password, the authentication identifier is sent to the server, which verifies and returns the authentication credential. The returned authentication credential is generated based on the combination of terminal identifier, timestamp and session channel identifier to ensure its uniqueness and unforgeability in the time dimension and context.
[0115] Next, the S3 state construction step begins. After the authentication credentials are returned, the user terminal stores them and generates three summaries based on three types of information: context information extracted from the current session channel, the user's interaction trajectory during the operation, and terminal environment parameters. The summary generation module then constructs a unified state summary. In this process, an adversarial state modeling structure is introduced: through a dual-loop adversarial mechanism between the generation network and the state discriminator, the final state summary is generated under multiple rounds of perturbation guidance, thereby achieving sensitivity and uniqueness in state expression. This mechanism can help identify state shifts caused by minor changes such as differences in interaction behavior and terminal environment perturbations, thus effectively distinguishing between genuine and spoofed requests in subsequent steps.
[0116] In the S4 state comparison step, the scheme structurally compensates for the one-way verification risk present in S3. When the user initiates a decryption request, the terminal re-collects the current context information, interaction trajectory and environmental parameters to generate a state summary to be compared. At this time, instead of directly comparing the state summaries in S3, the two are input into a discriminant network with a dual-branch structure and combined with a credibility verifier for deep comparison.
[0117] The discriminant network identifies structural differences between summaries through a graph convolutional sub-network, and uses an attention-enhanced residual sub-network to identify fine-grained feature changes. Then, the credibility verifier outputs the final credibility result based on the activation distribution and attention weights. The score of this final credibility result serves as the basis for determining whether to allow the decryption key to be called. This not only achieves state consistency verification, but also overcomes the structural limitations of traditional one-way matching through an adversarial-anti-adversarial strategy, avoiding the risk of pseudo-states bypassing verification through the original summaries.
[0118] In the S5 key retrieval process, this scheme only calls the decryption key bound in the UKey to perform data decryption operation when the trust verification result is passed, and issues an authentication failure prompt in the event of failure, thereby eliminating the possibility of key abuse.
[0119] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A data encryption / decryption method for enterprise identity authentication, comprising: S1. The user terminal identifies the accessed UKey in the current session and completes device initialization; A session channel is established between the current user terminal and the UKey, and status information is written into the session channel; the status information includes the user terminal identifier, session context, and UKey identifier. S2. Through the session channel, the authentication identifier information and authentication key information stored in the UKey are called. After the user enters the identity password, the authentication identifier information is sent to the server. After the server verifies the authentication, it generates an authentication credential based on the terminal identifier, timestamp and the identifier of the current session channel, and returns the authentication credential to the user terminal. Its features are: S3. After the authentication credentials are returned, the user terminal extracts the session context from the current session channel, records the user interaction records, and collects relevant parameters of the terminal environment. It then generates the corresponding context summary, interaction summary, and terminal environment summary as state summaries and writes the state summary into the UKey's state cache area. S4. When a user initiates a decryption request, the user terminal regenerates the state digest to be compared based on the current page's session context, user interaction records, and relevant parameters of the terminal environment, and performs a consistency check between the state digest to be compared and the original state digest. S5. If the consistency check is successful, the decryption key information in the UKey is used to perform the decryption operation on the target ciphertext data; if the check fails, the decryption operation is rejected and an authentication failure message is returned.
2. The data encryption and decryption method for enterprise identity authentication according to claim 1, characterized in that: In S1, after the user terminal completes the identification and initialization of the accessed UKey, a communication relationship is established based on the user terminal identifier and the UKey identifier, a session channel identifier with the same structure is generated, and the data structure of the session channel is initialized with the channel identifier. After the session channel is initialized, the user terminal identifier, the session context, and the UKey identifier are encoded and organized according to a preset field order to construct status information, and the status information is embedded into the corresponding status field position in the data structure of the session channel. After the status information is written, the status field is bound to the corresponding area of the session channel as an association index between the authentication behavior and the key request behavior. This is used to trace the authentication status by referencing the corresponding status information when the decryption request passes through the session channel.
3. The data encryption and decryption method for enterprise identity authentication according to claim 2, characterized in that: In step S2, after the session channel is established, the user terminal accesses the connected UKey through the session channel and calls the authentication identifier information and authentication key information pre-stored in the UKey to perform authentication data reading operation. The authentication identification information includes a unique identifier field corresponding to the enterprise, used to identify the user's identity; The authentication key information includes private key data used for unlocking and signing, and is used to perform authentication operations. The authentication identifier information and authentication key information are pre-stored in the UKey through the key generation and certificate writing process, and are set to be non-exportable. After the authentication data is read, the system receives the user's input password and performs unlock verification on the authentication key information. After the verification is successful, the authentication identifier information and the current terminal identifier are jointly encapsulated to form an authentication request message. The authentication request message is sent to the server through the session channel. The server matches and verifies the authentication identifier information. After successful verification, authentication credentials are generated based on the terminal identifier, timestamp, and the identifier of the current session channel. After the authentication credential is generated, it is returned to the user terminal through the original channel and stored in the terminal's local cache.
4. The data encryption and decryption method for enterprise identity authentication according to claim 3, characterized in that: In S3, in the authentication credential Upon returning, the user terminal extracts three input sequences from the current session channel: the session context sequence, etc. User interaction record sequence and terminal environment sequence The three input sequences are concatenated into an initial state tensor. : ; The first adversarial phase of building S3: Initialize the adversarial substructure: Generate a network using perturbations right Add Gaussian perturbation Generate pseudo-state tensors As an adversarial substructure: ; Execute the adversarial discrimination loop: Build the state discriminator Compare the initial state tensor With pseudo-state tensor Consistency score : ; definition If the preset consistency threshold is... Then, Gaussian perturbation resampling and reconstruction are performed to regenerate new data. And iteratively construct new ,definition Indicates new , Indicates the first The covariance matrix used in round perturbation sampling Indicates the first step of the current adversarial generation process. Round iteration index, represented as: ; Otherwise, proceed to the second phase of the confrontation in S3: In the second adversarial phase of S3, a summary generation function is constructed. ,right Perform multi-head segmentation mapping and extract context summary. Interactive summary Terminal Environment Summary , merged into the final state summary : ; Credibility Detection: Building a Credibility Validator Calculate the credibility score : ; definition If the preset confidence score threshold is set, If the state summary fails the binding verification, then the process should be retried. ,until Established; the verified state summary will be generated. Write the state to the UKey's state cache and use the state digest as the current authentication credential. The unique state binding structure; in To counteract the disturbance vector; Let the mean be 0 and the covariance matrix be... Multidimensional Gaussian perturbation; Gaussian perturbation Represents the adversarial perturbation vector It follows a pattern with a mean of 0 and a covariance matrix of... The multidimensional Gaussian distribution.
5. The data encryption and decryption method for enterprise identity authentication according to claim 4, characterized in that: In step S4, when the user terminal receives the decryption request, the relevant parameters of the current page's session context, user interaction records, and terminal environment are collected, and the session context summary, user interaction summary, and terminal environment summary to be compared are constructed by the context summary generation function, the interaction summary generation function, and the terminal environment summary generation function, respectively. The three summaries to be compared are sequentially input into the summary generation function. In, generated at a specific time point Summary of the state to be compared : ; in, Indicates a point in time The collected ; Indicates a point in time The collected ; Indicates a point in time The collected ; This indicates the number of locally nested segments that are divided during state summary generation; Indicates the index of a local segment; Indicates the first Attention weight coefficients for each local segment; It is a multilayer perceptron; Indicates the first The three summaries to be compared within a local segment are spliced together to form a unified input; Synchronous call from UKey and the state summary to be compared and Input to state discriminator In the middle, through the state discriminator Output preliminary consistency marking results : ; If the preliminary consistency marking result Then continue With perturbation generation network Generated multiple sets of perturbation state summaries Input together into the credibility verifier To perform stability verification and credibility verification. Output value satisfy: ; in Indicates the first A network generated by perturbation The generated summary of the perturbation state; This indicates that these perturbation state summaries are generated by a perturbation generation network. Generated; This indicates that this is the [number]. One perturbation sample; Represents a set of perturbation state summaries, from the 1st to the 2nd. One, total Summary of the disturbance states; This represents the total number of perturbed samples; in The mean vector representing the summary of all perturbation states; express The mapping weight matrix has dimensions of ,in For the state summary dimension, For intermediate hidden layer dimensions; express The mapping weight matrix has dimensions of ; The score vector represents the credibility output in its transposed form, with dimension 1. ; definition To preset the credibility threshold, if If so, the current request is considered to be in a valid authentication state, and subsequent key retrieval steps are allowed; if If the authentication fails, the trusted status is deemed invalid, the key access is rejected, and an authentication failure message is returned. If the preliminary consistency marking result If the state consistency check is rejected, the decryption process is directly blocked, and the current request is considered an untrusted request.
6. The data encryption and decryption method for enterprise identity authentication according to claim 5, characterized in that: It also includes S6: When the decryption operation is completed, the key usage behavior and the associated state digest are written into the log of the user terminal and synchronously uploaded to the audit module of the server through the session channel.
Citation Information
Patent Citations
A method and a device for realizing smart card application expansion
CN109088733A
Session key generation system and method
CN118337384A