Processing method and device for signature key, equipment, medium and program product
By double-encrypting the signature key and storing it in a trusted execution environment, the problem of vulnerability and loss of the signature key is solved, and the security protection and robust recovery of the signature key is achieved.
Patent Information
- Application Number
- CN202510928294.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-08-15
AI Technical Summary
Signature keys are susceptible to security threats and attacks in the fields of information security and digital communications, especially signature keys in plain text are easily stolen and cannot be recovered when lost.
By obtaining the first random value and encrypting it using the first encryption method, then encrypting the signature key based on the encrypted first random value using the second encryption method, and storing it in a local storage device, while optionally storing it in a trusted execution environment of the terminal, encryption protection of the signature key is realized.
Effectively prevent unauthorized access and modification, ensure the security of the signature key, and restore the ability to use the signature key by recalculating the encryption random value when lost.
Smart Images

Figure CN120498688A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a method for processing a signature key, an apparatus for processing a signature key, an electronic device for processing a signature key, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the advancement of computer and electronic technologies, signing keys (SK) are increasingly used in information security and digital communications, for example, in digital signatures, identity authentication, and software signing. However, signing keys are frequently subject to security threats and attacks in these scenarios, raising the need for more secure protection of signing keys. Summary of the Invention
[0003] This summary is provided to briefly introduce concepts that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] At least one embodiment of the present disclosure provides a method for processing a signature key, which is used for a client. The method includes: obtaining a first random value; encrypting the obtained first random value using a first encryption method to obtain an encrypted first random value; and encrypting the signature key based on the encrypted first random value using a second encryption method to obtain an encrypted signature key.
[0005] At least another embodiment of the present disclosure provides a processing device for a signature key, for use in a client, the device comprising: an acquisition module configured to acquire a first random value; a first operation module configured to encrypt the acquired first random value using a first encryption method to obtain an encrypted first random value; and a second operation module configured to encrypt the signature key based on the encrypted first random value using a second encryption method to obtain an encrypted signature key.
[0006] At least another embodiment of the present disclosure provides an electronic device for processing a signature key, comprising: at least one processing device, and a storage device storing one or more computer program instructions; wherein, when the one or more computer program instructions are executed by the at least one processing device, the method for processing a signature key provided by at least one embodiment of the present disclosure is executed.
[0007] At least another embodiment of the present disclosure provides a non-transitory computer-readable recording medium that non-transitorily stores computer-readable instructions, wherein when the computer-readable instructions are executed by a processor, the method for processing a signature key provided by at least one embodiment of the present disclosure is implemented.
[0008] At least one further embodiment of the present disclosure provides a computer program product, comprising one or more computer instructions, wherein when the one or more computer instructions are executed by a processor, the method for processing a signature key provided by at least one embodiment of the present disclosure is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0010] Figure 1 A diagram schematically illustrates an application scenario of a method and apparatus for processing a signature key provided by at least one embodiment of the present disclosure;
[0011] Figure 2 A flowchart schematically illustrates a method for processing a signature key provided by at least one embodiment of the present disclosure;
[0012] Figure 3 A schematic diagram schematically illustrates an example of a method for processing a signature key provided by at least one embodiment of the present disclosure;
[0013] Figure 4 The following schematically illustrates a structural block diagram of a device for processing a signature key provided by at least one embodiment of the present disclosure;
[0014] Figure 5 Schematically shows a structural block diagram of an electronic device 500 for processing a signature key in at least one embodiment of the present disclosure; and
[0015] Figure 6 A schematic diagram of a non-transitory computer-readable recording medium 600 in at least one embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0016] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0017] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0018] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0019] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0020] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0021] The names of messages or information exchanged between multiple devices, modules or units in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0022] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0023] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the type, scope of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and authorization of the relevant users should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.
[0024] For example, in response to receiving a user's active request, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the relevant user's information, so that the relevant user can independently choose whether to provide information to the electronic device, application, server or storage medium and other software or hardware that executes the operation of the technical solution of the present disclosure based on the prompt information.
[0025] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message may be sent to the relevant user in the form of a pop-up window, in which the prompt message may be presented in text form. Furthermore, the pop-up window may also include a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.
[0026] It is understandable that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0027] Before the detailed description below, some terms involved in the present disclosure are introduced to better understand the technical solutions described in the present disclosure.
[0028] FIDO: Fast Identity Online; FIDO2 is the collective name for a series of protocols recently launched by the FIDO Alliance. Its goal is to eventually replace the traditional username and password login method with a safer and faster authentication method, ushering in an era of password-free login.
[0029] PRF (Pseudo-Random Function) is an extension of the WebAuthn library that allows authenticators to generate unique cryptographically secure keys during authentication. This is intended for use in end-to-end encryption as specified in the W3C specification. WebAuthn (Web Authentication) is a web authentication specification developed jointly by the W3C and the FIDO Alliance, aiming to enable passwordless authentication through public-private key cryptography.
[0030] Authenticator: A device or built-in function of a device that uses cryptographic methods to verify the identity of a user for an online service, usually without requiring a password.
[0031] Hypertext Transfer Protocol (HTTP) request: A standard protocol that specifies how data is transferred between a client and a server over the Internet.
[0032] Signing Key (SK): A cryptographic key, typically a private key, used to digitally sign HTTP requests to ensure their authenticity and integrity. Examples of SKs include HTTP message signing and Demonstrating Proof of Possession (DPoP).
[0033] Key Encryption Key (KEK): A cryptographic key used to encrypt or decrypt other keys, primarily to protect their confidentiality during transmission or storage.
[0034] Trusted Execution Environment (TEE): A secure, isolated area within a processor that protects code and data from unauthorized access or modification, even by the main operating system.
[0035] Salt: A random piece of data that is used as an additional input to a one-way function used to hash data, passwords, or passphrases.
[0036] Root of Trust / Chain of Trust: A fundamental security component that serves as the foundational point of security for a system or device.
[0037] With the development of computer technology and electronic technology, signature keys (SK) have been increasingly widely used in the fields of information security and digital communications, for example, in scenarios such as digital signatures, identity authentication, and software signing. However, in the above-mentioned application scenarios, signature keys are often subject to security threats and attacks. For example, the signature key for HTTP requests is usually in plaintext form, and the signature key is also stored in plaintext in local storage devices (such as localStorage or indexDB). The plaintext signature key can be easily stolen by malware or attackers. In addition, when the local object using the signature key is lost, it is also easy to cause the signature key to be lost, which means that the local object cannot be retrieved and the signature key cannot be recovered. Therefore, the need for security protection of signature keys is becoming increasingly prominent.
[0038] In order to at least partially solve at least one of the above-mentioned technical problems, at least one embodiment of the present disclosure provides a method for processing a signature key, which is used for a client. The method includes: obtaining a first random value; encrypting the obtained first random value using a first encryption method to obtain an encrypted first random value; and encrypting the signature key based on the encrypted first random value using a second encryption method to obtain an encrypted signature key.
[0039] Corresponding to the method for processing a signature key provided in at least one embodiment of the present disclosure, at least one embodiment of the present disclosure also provides a processing device for a signature key, an electronic device for processing a signature key, a computer-readable storage medium, and a computer program product.
[0040] The embodiments of the present disclosure and some examples thereof are described in detail below with reference to the accompanying drawings.
[0041] Figure 1 The following schematically illustrates an application scenario diagram of a method and apparatus for processing a signature key provided by at least one embodiment of the present disclosure.
[0042] like Figure 1 As shown, the application scenario 100 of this embodiment may include a user 101 , a terminal device 102 , a communication network 103 and a server 104 .
[0043] For example, user 101 may be a user or other related party of an application based on a signature key. Applications based on a signature key may include, but are not limited to, web applications (such as browser cookie signatures, JWT (JSON WebTokens) signatures, etc.), mobile terminal applications (Android applications, iOS applications), etc. These applications are used to provide the client in the present disclosure.
[0044] For example, the terminal device 102 can be any electronic device that can provide services to users based on a signature key. This electronic device can provide users with interactive pages for operation and use. This electronic device includes, but is not limited to, mobile terminals, mobile phones, tablet computers, portable computers, desktop computers, smart wearable devices, smart home appliances, or smart vehicle terminals.
[0045] For example, the communication network 103 may be a communication network based on any suitable wired or wireless communication. Wired communication may include, but is not limited to, twisted pair communication, coaxial cable communication, fiber optic communication, etc. Wireless communication may include, but is not limited to, cellular mobile communication, Wi-Fi communication, satellite communication, wireless local area network, wireless wide area network, etc.
[0046] For example, server 104 runs a service-side client corresponding to the client and can be communicatively connected to terminal device 102 via a wired or wireless communication network. Server 104 can be, for example, a local area network server, a wide area network server, a cloud server, or the like. In some cases, server 104 and terminal device 102 can be integrated; in this case, the communication network 103 may not be required. For example, in response to user 101 interacting with a client's interactive page, the client on terminal device 102 can obtain a corresponding signing key and a corresponding public key. The client on terminal device 102 can then send the public key and a request signed by the signing key to the service-side client on server 104, whereupon the service-side client on server 104 performs identity authentication and data integrity verification based on the request signed by the signing key and the public key. Finally, after successful verification, server 104 can provide downstream services. Examples of such downstream services include, but are not limited to, secure web browsing services, API services, file transfer services, secure database access services, identity authentication and authorization services, cloud services, and Internet of Things (IoT) services.
[0047] For example, the method for processing a signature key provided in at least one embodiment of the present disclosure may be implemented in any suitable manner, such as in software.
[0048] For example, the processing method for a signature key provided in at least one embodiment of the present disclosure is applicable to a client. The client can be a client of any application based on a signature key, such as a web client (e.g., a browser), an application with page browsing (e.g., a social application, a shopping application, a video application, etc.). The client can run in a terminal device 102. The terminal device 102 can load and execute an executable program or instruction running the client, thereby enabling the client to apply the processing method for a signature key, and the embodiments of the present disclosure are not limited to this.
[0049] The terminal device 102 may, for example, include a central processing unit (CPU) or a graphics processing unit (GPU), a digital signal processor (DSP), a neural network processing unit (NPU), and other processing units with data processing capabilities and / or instruction execution capabilities, as well as corresponding storage units (such as shared cache, memory, etc.); for example, the CPU may adopt the X86 instruction set, ARM instruction set, RISC-V instruction set, etc., and may further include a trusted execution environment (TEE).
[0050] The terminal device 102 may be installed with an operating system, an application programming interface (API), etc., and run the client by running an executable program or instructions, so that the client can apply the processing method for the signature key.
[0051] For example, the terminal device 102 may further include an output component such as a display device, such as a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a quantum dot light emitting diode (QLED) display, a light emitting diode display (such as a micro-LED display), etc., and the embodiments of the present disclosure are not limited thereto. For example, the display component may display an interactive page so that a user can interact with a client on the terminal device 102 through the interactive interface.
[0052] The following will be combined Figures 2 and 3 A method for processing a signature key provided by at least one embodiment of the present disclosure is described in detail.
[0053] Figure 2 The flowchart of the method for processing a signature key provided by at least one embodiment of the present disclosure is schematically shown. The method for processing a signature key can be applied to a client, such as the aforementioned web client.
[0054] like Figure 2 As shown, the signature key processing method 200 of this embodiment may include the following steps S210 to S230. For example, the execution subject of the signature key processing method may be a terminal device equipped with a client. Specifically, the processing device (such as a processor) of the terminal device may run the client through a computer executable program, code, or instruction, and then implement the processing method 200 through the client.
[0055] In step S210, a first random value may be obtained.
[0056] As an example, the first random value may be any suitable random value type, such as an integer, a floating point number, etc.
[0057] According to an embodiment of the present disclosure, the client can obtain a first random value by calling a pseudo-random function (PRF) provided by the system where the client is located. For example, in the case where the client is a web client, in order to enable the web client to call the PRF, the add-in of the web client is expanded to be able to load the PRF or a WebAuthn library that supports the PRF. It can be seen that compared to existing clients, the client that applies the processing method provided by the present disclosure can support the call to the pseudo-random function, thereby further improving the protection of the signature key in the subsequent processing of the signature key.
[0058] According to an embodiment of the present disclosure, the operation of acquiring the first random value by calling a pseudo-random function may include: calling the pseudo-random function and acquiring the first random value using at least one of a basic random value and user identity information.
[0059] As an example, the basic random value can be any suitable random value type, such as an integer, a floating point number, etc. For example, the basic random value can be, for example, a "salt". The user identity information can be based on any suitable information related to the user identity, such as a passkey obtained based on a logged-in username, mobile phone number, password, biometric information, etc. Based on the actual usage scenario, there may be one or more user identity information corresponding to the user; for example, there may be one or more passkeys corresponding to the user. The user identity information used in the encryption and decryption processes described in this article is the same user identity information, so that the decrypted signature key can be correctly obtained.
[0060] As an example, the client may call a pseudorandom function and use the base random value to obtain a first random value. As another example, the client may call a pseudorandom function and use user identity information to obtain a first random value. As yet another example, the client may call a pseudorandom function and use both the base random value and the user identity information to obtain a first random value.
[0061] As can be seen, the processing method provided by the present disclosure can obtain a first random value based on a pseudo-random function by using at least one of the base random value and user identity information. This first random value is a pseudo-random value. In this way, the obtained first random value can have strong pseudo-randomness and be difficult to crack.
[0062] According to an embodiment of the present disclosure, at least one of the basic random value and the user identity information may be obtained during the process of the user performing identity authentication at the client.
[0063] As an example, a PRF salt can be added to the "Extensions" field of a web client API (e.g., navigator.credentials.get) to invoke the PRF. In this case, at least one of the salt and the user's identity information can be obtained during the user's authentication process through the web client. As previously mentioned, when obtaining user identity information for subsequent use, the scope and scenarios of use of the user identity information should be appropriately communicated to the relevant user in accordance with relevant laws and regulations, and their authorization should be obtained.
[0064] As an example, a user needs to authenticate when creating a passkey using user name, password, etc. in the client; after passing the authentication, the passkey can be obtained.
[0065] As can be seen, according to the processing method provided by the present disclosure, at least one of the random value and the user's identity information can be obtained during the user's identity verification process, without requiring additional steps to obtain at least one of the random value and the user's identity information. This makes the processing method provided by the present disclosure convenient, fast, and resource-saving.
[0066] Continue to refer to Figure 2 In step S220, the client may use a first encryption method to encrypt the obtained first random value to obtain an encrypted first random value.
[0067] As an example, the first encryption method may be an encryption method using any suitable encryption algorithm, such as AES-GCM (Advanced Encryption Standard-Galois / Counter Mode), 3DES (Triple Data Encryption Standard), and the like.
[0068] According to an embodiment of the present disclosure, in order to further improve security, an encryption method may be selected such that the encrypted first random value is a key encryption key KEK, such as the aforementioned AES-GCM.
[0069] Continue to refer to Figure 2 In step S230, the client may use a second encryption method to encrypt the signature key based on the encrypted first random value to obtain an encrypted signature key.
[0070] As an example, the second encryption method may be an encryption method using any suitable encryption algorithm, such as the aforementioned AES-GCM, 3DES, etc.
[0071] As an example, the first encryption method and the second encryption method may be the same encryption method. As another example, the first encryption method and the second encryption method may be different encryption methods.
[0072] According to an embodiment of the present disclosure, processing method 200 may further include storing the encrypted signature key in a local storage device of the client (local storage (localStorage) or index database (indexDB) as described above). As can be seen, the processing method provided by the present disclosure can store the signature key in encrypted form in the local storage device, which provides high security.
[0073] According to an embodiment of the present disclosure, the processing method 200 may further include decrypting the encrypted signature key, and using the decrypted signature key by the first local object corresponding to the client.
[0074] As an example, the first local object can be used in the client to process the signature key. For example, the first local object can be an interface in the web client that provides underlying functions related to the processing of the signature key, such as the web encryption interface (WebCrypto) or the subtle encryption interface (SubtleCrypto), where the sign in SubtleCrypto can use the signature key to sign the signed data (i.e., the original data); the importKey in SubtleCrypto is used to import the existing signature key.
[0075] According to an embodiment of the present disclosure, the processing method 200 may further include obtaining an encrypted signature key and decrypting the encrypted signature key, and the decrypted signature key is used by the second local object corresponding to the client.
[0076] According to an embodiment of the present disclosure, in response to the decrypted signature key being lost while being used by a first local object, an encrypted signature key can be obtained and decrypted, and the decrypted signature key can be used by a second local object corresponding to the client.
[0077] As an example, the second local object can be used in the client to process the signature key. For example, the second local object can be an interface in the web client that provides underlying functions related to the processing of the signature key, such as the web encryption interface (WebCrypto) or the subtle encryption interface (SubtleCrypto), where the sign in SubtleCrypto can use the signature key to sign the signed data (i.e., the original data); the importKey in SubtleCrypto is used to import the existing signature key.
[0078] As an example, the first local object and the second local object may be the same local object.As another example, the first local object and the second local object may be different local objects.
[0079] For example, the decrypted signing key may be lost while in use by the first local object because the decrypted signing key is destroyed, damaged, deleted, or erased; or because the first local object corresponding to the decrypted signing key is destroyed, damaged, deleted, or erased, resulting in the loss of the decrypted signing key, etc. With existing approaches, this means there is no way to recover the signing key. However, a client that applies the processing method 200 provided by at least one embodiment of the present disclosure can obtain the decrypted signing key by recalculating the encrypted first random value (e.g., KEK) and then decrypting the encrypted signing key.
[0080] Specifically, decrypting the encrypted signature key may include: encrypting the first random value using a first encryption method to obtain an encrypted first random value; and decrypting the encrypted signature key based on the encrypted first random value using a decryption method corresponding to a second encryption method to obtain a decrypted signature key. The first encryption method, first random value, etc. involved in the decryption process are the same as those involved in the aforementioned encryption process and are not further described here.
[0081] The decryption method may be a decryption method using any suitable decryption algorithm and the method corresponds to the second encryption method. The decryption algorithm may be any suitable decryption algorithm, such as a decryption algorithm corresponding to the above-mentioned AES-GCM, 3DES, etc.
[0082] The signature key can be effectively protected by recalculating the encrypted first random value and then decrypting the encrypted signature key to obtain the decrypted signature key.
[0083] In scenarios where the protection requirements for the signature key are less stringent, the encrypted first random value may be stored in advance in a local storage device, and then decrypted based on the pre-stored encrypted first random value to obtain the decrypted signature key. In this case, the operation of decrypting the encrypted signature key may include using a decryption method corresponding to the second encryption method to decrypt the encrypted signature key based on the pre-stored encrypted first random value to obtain the decrypted signature key.
[0084] In scenarios where the protection requirements for the signature key are particularly high, at least one of the above-mentioned basic random value, user identity information, first random value, encrypted first random value, and encrypted signature key can be stored in the trusted execution environment of the terminal where the client is located. Since the method of calling the PRF and encrypting the key by the client applying the processing method provided by the present disclosure is a method that can obtain encryption keys supported by the terminal hardware; through this method, at least one of the above-mentioned basic random value, user identity information, first random value, encrypted first random value, and encrypted signature key used by the client can be stored in the trusted execution environment of the terminal where the client is located. Existing clients cannot directly access the trusted execution environment of the terminal because they do not have the above-mentioned method, and thus there is no more secure method to store at least one of the above-mentioned basic random value, user identity information, first random value, encrypted first random value, and encrypted signature key in the trusted execution environment. This allows the processing method provided by the present disclosure to further improve the security of the above-mentioned data.
[0085] As can be seen, the processing method provided by this disclosure can still obtain the decrypted signing key by recalculating the encrypted first random value and then decrypting the encrypted signing key in adverse scenarios such as when the signing key is lost, so that subsequent services can proceed normally. This makes the client that applies the processing method provided by this disclosure highly robust.
[0086] According to an embodiment of the present disclosure, the processing method 200 may also include, in response to a request for sending information to a server, signing the request using a decrypted signature key to obtain a signed request; determining the corresponding public key based on the decrypted signature key; and sending the signed request and the public key to the server.
[0087] As an example, the encrypted signature key is a private key. The public key corresponding to the private key can be determined by asymmetric encryption. The user usually needs to send a request to the server via the client. The request can be used to send registration-related information, web browsing-related information, file transfer-related information, service access-related information, etc. to the server. The client can obtain the signed request in the following way: select a secure hash function (such as SHA-256), calculate the hash value of the data to be signed, and encrypt the hash value using the private key. The client can then send the signed request and public key to the server (such as a web server); as mentioned above, the server can perform operations such as identity authentication and data integrity verification based on the request and public key signed by the private key. If the verification is successful, the server can provide the exemplary downstream service described above.
[0088] It can be seen that the data exchanged between the client and the server using the processing method provided by this disclosure is the data corresponding to the signature key rather than the signature key itself. This effectively avoids the leakage of the signature key and ensures the security of the information exchanged between the client and the server.
[0089] In addition, since the requests for interaction between the client and the server (such as requests related to various user sessions, cookies, etc.) are all signed by the decrypted signature key and the signature key can be encrypted in advance through the user identity information stored in the TEE, the method provided by the present disclosure can bind the cookie to the TEE environment. This method can effectively provide targeted protection for various sessions of interaction between the client and the server, and avoid the theft of user information in the session by malware or attackers (such as black industries).
[0090] For ease of understanding, the following Figure 3 The processing method for the signature key provided in the present disclosure is schematically described in the form of an example.
[0091] Figure 3 A schematic diagram schematically illustrates an example of a method for processing a signature key provided by at least one embodiment of the present disclosure.
[0092] As mentioned above, the signature key for HTTP requests is usually stored in plain text and saved in a local object, and the value of the signature key is set to be non-exportable. In the case of Web applications, the browser cannot access the TEE, so it is difficult to ensure the security of the signature key. The present disclosure can use PRF to generate a key encryption key (KEK), which can encrypt the signature key for HTTP requests, and then the encrypted signature key can be stored in a local storage device. In addition, in order to further improve security, the processing method provided by the present disclosure can also store at least one of the basic random value for obtaining the encrypted signature key, user identity information, the first random value, the encrypted first random value and the encrypted signature key in the TEE of the terminal where the client is located.
[0093] Reference Figure 3In step 1, for example, the add-on corresponding to the PRF can be set in the web client in advance, such as the PRF random value (salt) can be added to the "extension" field of navigator.credentials.get to call the PRF. In this step, the random value salt (i.e., the aforementioned basic random value) can be generated; the user can use the salt in the PRF to authenticate during navigator.credentials.get(). In this step, during the authentication process through the authenticator (Authenticator) function of the terminal device where the client is located, the random value salt and user identity information can be obtained. The obtained random value salt and user identity information are used as the input of the PRF, and the corresponding PRF output can be obtained after processing by the PRF.
[0094] In step 2, the output of step 1 is a PRF output, i.e., the first random value. For example, the PRF output is a deterministic, cryptographically random-looking binary string.
[0095] In step 3, the PRF output can then be used to create a key encryption key. For example, the PRF output can be encrypted using the aforementioned first encryption method (such as an encryption method corresponding to the AES-GCM algorithm) to obtain an encrypted first random value (such as a key encryption key).
[0096] In step 4, the signature key SK is encrypted using the key encryption key before being stored in a local storage device (such as localStorage or indexDB). The encrypted signature key is then stored in the local storage device. Furthermore, to further enhance security, as previously described, the encrypted signature key can be stored in the trusted execution environment of the terminal where the client resides.
[0097] The above combination Figures 2 to 3 The present disclosure provides a method for processing a signature key. The method provided by at least one embodiment of the present disclosure can use an encrypted first random value (e.g., a key encryption key) to encrypt a signature key and, for example, store the encrypted signature key in a local storage device of a client and, further, in a trusted execution environment of a terminal. This allows the method provided by the embodiment of the present disclosure to better protect the signature key from unauthorized access or modification, even by a host operating system.
[0098] In addition, the processing method provided by at least one embodiment of the present disclosure can obtain the decrypted signing key by recalculating the above-mentioned encrypted first random value (such as KEK) and then decrypting the encrypted signing key when the signing key is lost. Therefore, the signing key can be restored as needed using the processing method provided by the embodiment of the present disclosure without worrying about the occurrence of local objects (such as WebCrypto / SubtleCrypto) being deleted.
[0099] Figure 4 The following schematically illustrates a block diagram of a processing device for a signature key according to at least one embodiment of the present disclosure. The above description of the processing method for a signature key also applies to the processing device, unless otherwise explicitly stated.
[0100] like Figure 4 As shown, the processing device 400 for a signing key in this embodiment may include an acquisition module 410, a first operation module 420, and a second operation module 430. For example, these modules or units may be implemented by hardware (e.g., circuit) modules or software modules. For example, these modules or units may be implemented by a central processing unit (CPU), a general-purpose graphics processing unit (GPGPU), a graphics processing unit (GPU), a tensor processing unit (TPU), a field programmable gate array (FPGA), or other forms of processing units with data processing capabilities and / or instruction execution capabilities, as well as corresponding computer instructions.
[0101] According to an embodiment of the present disclosure, the acquisition module 410 may be configured to acquire a first random value.
[0102] As an example, the first random value can be obtained by calling a pseudorandom function. Further, the first random value can be obtained by calling a pseudorandom function and using at least one of a base random value and user identity information, wherein at least one of the base random value and user identity information can be obtained during the user's identity authentication process on the client.
[0103] According to an embodiment of the present disclosure, the first operation module 420 may be configured to encrypt the acquired first random value using a first encryption method to obtain an encrypted first random value. The second operation module 430 may be configured to encrypt the signature key based on the encrypted first random value using a second encryption method to obtain an encrypted signature key.
[0104] The first operating module 420 and the second operating module 430 may be separate modules or integrated together.
[0105] According to an embodiment of the present disclosure, the processing device 400 may further include a decryption module configured to decrypt the encrypted signature key, and the decrypted signature key is used by the first local object corresponding to the client.
[0106] As an example, the decryption module can be configured to obtain an encrypted signature key and decrypt the encrypted signature key, and the second local object corresponding to the client uses the decrypted signature key. The first local object and the second local object can be used to process the signature key in the client, respectively.
[0107] According to an embodiment of the present disclosure, decrypting an encrypted signature key may include: encrypting a first random value using a first encryption method to obtain an encrypted first random value; and decrypting the encrypted signature key based on the encrypted first random value using a decryption method corresponding to a second encryption method to obtain a decrypted signature key, wherein the encrypted first random value is a key encryption key.
[0108] According to an embodiment of the present disclosure, at least one of the basic random value, user identity information, the first random value, the encrypted first random value, and the encrypted signature key may be stored in a trusted execution environment of the terminal where the client is located.
[0109] According to an embodiment of the present disclosure, the processing device 400 may further include a request signature module, a public key processing module and a transmission module, wherein the request signature module may be configured to respond to a request for sending information to a server and sign the request using a decrypted signature key to obtain a signed request; the public key processing module may be configured to determine a corresponding public key based on the decrypted signature key; and the transmission module may be configured to send a signed request and public key to the server.
[0110] It should be noted that for the sake of clarity and brevity, the embodiments of this disclosure do not describe all the components or units of the processing device 400. To implement the necessary functions of the information processing device, those skilled in the art may provide or configure other components not shown as needed, and the embodiments of this disclosure are not limited thereto.
[0111] At least one embodiment of the present disclosure further provides an electronic device for processing a signature key. Figure 5 The electronic device is described in detail.
[0112] Figure 5 The structure block diagram of an electronic device 500 for processing a signature key in at least one embodiment of the present disclosure is schematically shown.
[0113] Reference Figure 5The electronic device 500 may include a processing device 501 and a storage device 508. As needed, the electronic device 500 may further include a read-only memory (ROM) 502, a random access memory (RAM) 503, a bus 504, an (I / O) interface 505, an input device 506, an output device 507, and a communication device 509.
[0114] The electronic devices in the embodiments of the present disclosure may include but are not limited to the aforementioned terminal devices, such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., as well as fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0115] For example, the processing device 501 may be a central processing unit (CPU), a digital signal processor (DSP), a graphics processing unit (GPU), a general-purpose graphics processing unit (GPGPU), or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device to perform desired functions. The electronic device 500 may include one or more processing devices 501.
[0116] For example, the storage device 508 may include one or more computer program instructions, which may be stored in various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may, for example, include read-only memory (ROM), a hard disk, a flash memory, etc. The processing device may run the one or more computer program instructions to implement the functions (implemented by the processing device) in the embodiment of the present disclosure and / or other desired functions, such as a processing method for a signature key, etc. Various applications and various data may also be stored in the computer-readable storage medium, such as the encrypted first random value, the encrypted signature key, etc., which are not limited in the embodiments of the present disclosure.
[0117] In addition, the processing device 501 can also perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage device 508 into the random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0118] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0119] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product that includes one or more computer instructions that can be used to perform the method shown in the flowchart. In such an embodiment, the one or more computer instructions can be downloaded and installed from the network via the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the one or more computer instructions are executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0120] At least one embodiment of the present disclosure further provides a non-transitory computer-readable recording medium, which will be described below in conjunction with Figure 6 This recording medium is described in detail.
[0121] Figure 6 A schematic diagram of a non-transitory computer-readable recording medium 600 in at least one embodiment of the present disclosure is schematically shown.
[0122] like Figure 6As shown, non-transitory computer-readable instructions 610 are stored on the recording medium 600. When the computer-readable instructions 610 are executed by the processor, the method according to the embodiment of the present disclosure described with reference to the above figures can be executed. The recording medium in the embodiment of the present disclosure can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM). It should be noted that memory of the methods described herein is intended to comprise, but not be limited to, these and any other suitable types of memory.
[0123] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0124] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0125] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0126] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a first random value; encrypts the obtained first random value using a first encryption method to obtain an encrypted first random value; and encrypts a signature key based on the encrypted first random value using a second encryption method to obtain an encrypted signature key.
[0127] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The units or modules involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit or module does not necessarily limit the unit or module itself.
[0130] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0131] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] According to one or more embodiments of the present disclosure, Example 1 provides a processing method for a signature key, which is used for a client, including: obtaining a first random value; encrypting the obtained first random value using a first encryption method to obtain an encrypted first random value; and encrypting the signature key based on the encrypted first random value using a second encryption method to obtain an encrypted signature key.
[0133] According to one or more embodiments of the present disclosure, Example 2 provides that obtaining the first random value in Example 1 includes: obtaining the first random value by calling a pseudo-random function.
[0134] According to one or more embodiments of the present disclosure, Example 3 provides the processing method in Example 1, further comprising: storing the encrypted signature key in a local storage device of the client.
[0135] According to one or more embodiments of the present disclosure, Example 4 provides the processing method described in any one of Examples 1 to 3, further comprising: decrypting the encrypted signature key, and using the decrypted signature key by the first local object corresponding to the client.
[0136] According to one or more embodiments of the present disclosure, Example 5 provides the processing method in Example 4, further including: obtaining the encrypted signature key and decrypting the encrypted signature key, and the decrypted signature key is used by the second local object corresponding to the client.
[0137] According to one or more embodiments of the present disclosure, Example 6 provides the decryption of the encrypted signature key in Example 4, including: using the first encryption method to encrypt the first random value to obtain the encrypted first random value; and using a decryption method corresponding to the second encryption method, based on the encrypted first random value, to decrypt the encrypted signature key to obtain a decrypted signature key, wherein the encrypted first random value is a key encryption key.
[0138] According to one or more embodiments of the present disclosure, Example 7 provides that the first local object and the second local object in Example 5 are respectively used in the client to process the signing key.
[0139] According to one or more embodiments of the present disclosure, Example 8 provides the method of obtaining the first random value by calling a pseudo-random function in Example 2, including: calling the pseudo-random function and using at least one of a basic random value and user identity information to obtain the first random value.
[0140] According to one or more embodiments of the present disclosure, Example 9 provides the processing method in Example 8, further comprising: obtaining at least one of the basic random value and the user identity information during the user's identity authentication at the client.
[0141] According to one or more embodiments of the present disclosure, Example 10 provides the processing method in Example 9, further including: storing at least one of the basic random value, the user identity information, the first random value, the encrypted first random value and the encrypted signature key in a trusted execution environment of the terminal where the client is located.
[0142] According to one or more embodiments of the present disclosure, Example 11 provides the processing method described in any one of Examples 4 to 7, further including: in response to a request for sending information to a server, signing the request using the decrypted signature key to obtain a signed request; determining the corresponding public key based on the decrypted signature key; and sending the signed request and the public key to the server.
[0143] According to one or more embodiments of the present disclosure, Example 12 provides a processing device for a signature key, which is used for a client, and the processing device includes: an acquisition module, configured to obtain a first random value; a first operation module, configured to use a first encryption method to encrypt the obtained first random value to obtain an encrypted first random value; and a second operation module, configured to use a second encryption method to encrypt the signature key based on the encrypted first random value to obtain an encrypted signature key.
[0144] According to one or more embodiments of the present disclosure, Example 13 provides an electronic device for processing a signature key, comprising: at least one processing device, and a storage device storing one or more computer program instructions; wherein, when the one or more computer program instructions are executed by the at least one processing device, the method for processing a signature key provided by at least one embodiment of the present disclosure is executed.
[0145] According to one or more embodiments of the present disclosure, Example 14 provides a non-transitory computer-readable recording medium that non-transitorily stores computer-readable instructions, wherein, when the computer-readable instructions are executed by a processor, the processing method for the signature key provided by at least one embodiment of the present disclosure is implemented.
[0146] According to one or more embodiments of the present disclosure, Example 15 provides a computer program product, comprising one or more computer instructions, wherein the one or more computer instructions, when executed by a processor, execute the processing method for a signature key provided by at least one embodiment of the present disclosure.
[0147] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0148] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0149] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for processing a signature key, used on a client, comprising: Get the first random value; Encrypting the obtained first random value using a first encryption method to obtain an encrypted first random value; as well as The signature key is encrypted based on the encrypted first random value using a second encryption method to obtain an encrypted signature key.
2. The processing method according to claim 1, wherein: The obtaining of the first random value comprises: The first random value is obtained by calling a pseudo-random function.
3. The processing method according to claim 1, further comprising: The encrypted signing key is stored in a local storage device of the client.
4. The processing method according to any one of claims 1 to 3, further comprising: The encrypted signature key is decrypted, and the decrypted signature key is used by the first local object corresponding to the client.
5. The processing method according to claim 4, further comprising: The encrypted signature key is obtained and decrypted, and the decrypted signature key is used by the second local object corresponding to the client.
6. The processing method according to claim 4, wherein: The decrypting the encrypted signature key comprises: Encrypting the first random value using the first encryption method to obtain the encrypted first random value; and Decrypting the encrypted signature key based on the encrypted first random value using a decryption method corresponding to the second encryption method to obtain a decrypted signature key, The encrypted first random value is a key encryption key.
7. The processing method according to claim 2, wherein: The obtaining of the first random value by calling a pseudo-random function includes: The pseudo-random function is called, and the first random value is obtained using at least one of a basic random value and user identity information.
8. The processing method according to claim 7, further comprising: At least one of the basic random value and the user identity information is obtained during the process of the user performing identity authentication on the client.
9. The processing method according to claim 8, further comprising: At least one of the basic random value, the user identity information, the first random value, the encrypted first random value, and the encrypted signature key is stored in a trusted execution environment of a terminal where the client is located.
10. The processing method according to any one of claims 5 to 6, further comprising: In response to a request for sending information to a server, signing the request using the decrypted signature key to obtain a signed request; Determining a public key corresponding to the decrypted signature key based on the decrypted signature key; Send the signed request and the public key to the server.
11. A processing device for a signature key, used in a client, comprising: an acquisition module, configured to acquire a first random value; A first operation module is configured to encrypt the obtained first random value using a first encryption method to obtain an encrypted first random value; as well as The second operating module is configured to encrypt the signature key based on the encrypted first random value using a second encryption method to obtain an encrypted signature key.
12. An electronic device for processing a signature key, comprising: at least one processing device, and a storage device storing one or more computer program instructions; The one or more computer program instructions are executed by the at least one processing device to perform the method according to any one of claims 1 to 10.
13. A non-transitory computer-readable recording medium non-transitory storing computer-readable instructions, wherein: When the computer-readable instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising one or more computer instructions, wherein: When the one or more computer instructions are executed by a processor, the method according to any one of claims 1 to 10 is executed.
Citation Information
Patent Citations
Data encryption method, federal modeling method and device and computer equipment
CN114417364A
Data transmission method, device and system and storage medium
CN114726597A
Multiple level access system
US20040254882A1
System and Method for Authenticating Electronic Tags
US20180205714A1