Application security mutual recognition method, electronic equipment and system
By dynamically generating subkeys and using a common key derivation algorithm, the complex and cost problems of traditional key management methods are solved, and the effect of simplifying key management, reducing coupling degree and enhancing the flexibility of security mutual recognition is achieved.
Patent Information
- Application Number
- CN202411831541.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-21
AI Technical Summary
Traditional key management methods are complex and costly when the number of third-party applications increases and manufacturers changes, and the tight coupling between security components and third-party applications is not conducive to market changes and technological upgrades.
By dynamically generating subkeys for authentication, the direct operation of the root key is reduced, and a common key derivation algorithm and authentication protocol are adopted to reduce dependence on specific hardware encryption machines.
It simplifies the key management process, reduces the degree of coupling, enhances the flexibility and applicability of security mutual recognition, and adapts to the cooperation needs of different manufacturers.
Smart Images

Figure CN119675950A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of information security, for example, to an application security mutual recognition method, electronic device and system. Background Art
[0002] At present, when the secure element (SE) application and the third-party application perform security mutual recognition, the key source of the mutual recognition between the two applications is usually based on a pre-configured mechanism. Specifically, both parties will use their own hardware encryption machines to generate subkeys according to the same dispersion rules and root keys. These subkeys are then preset to the secure element application and the third-party application respectively. In the actual mutual authentication process, the two parties establish a secure trust relationship based on these preset keys and secure communication protocols to ensure the security and reliability of data exchange.
[0003] However, with the increase in the number of third-party applications and the increasing prevalence of situations involving different manufacturers, traditional key management methods face some challenges. First, every time a third-party application is added or the manufacturer is changed, the root key needs to be resynchronized, which not only increases the complexity of the operation, but also leads to frequent key update needs. Secondly, each manufacturer needs to build an independent hardware encryption machine security environment, which is cost-prohibitive for some smaller manufacturers or those with limited resources. In addition, under this model, the tight coupling between security element manufacturers and third-party application manufacturers is also high, which is not conducive to flexibly responding to market changes and technology upgrades, thereby limiting its wide applicability in actual production and application scenarios.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0006] The embodiments of the present disclosure provide a method, electronic device, and system for application security mutual recognition, which can simplify the key management process, reduce the degree of coupling, and enhance the flexibility and applicability of security mutual recognition.
[0007] According to a first aspect of the present disclosure, a method for mutual recognition of application security is provided, which is applied to a third-party application and includes:
[0008] Obtaining first key data;
[0009] Sending first key data to the secure element application, obtaining a corresponding root key based on response data returned by the secure element application, and performing root key authentication with the secure element;
[0010] In case the root key authentication is successful, the subkey is derived based on the root key;
[0011] Security authentication based on subkey and secure element application.
[0012] In some embodiments, the first key data includes a first key pair and a first random number;
[0013] Sending first key data to the security element application, obtaining a corresponding root key based on response data returned by the security element application, and performing root key authentication with the security element, including:
[0014] Obtain a first key pair and a first random number, the first key pair including a first public key and a first private key;
[0015] Sending a first public key and a first random number to a secure element application;
[0016] Receive a second public key, a second random number, and a first encrypted random value sent by a third-party application sent by the secure element application;
[0017] Determine a first root key based on the second public key and the first private key;
[0018] Encrypt the first random number based on the first root key to obtain a first verification random value;
[0019] comparing the first encrypted random value and the first verified random value;
[0020] When the first encrypted random number value and the first verification random number value are the same, encrypting the second random number based on the first root key to obtain a second encrypted random number value;
[0021] sending a second encrypted random value to the secure element application;
[0022] Receive root key authentication success notification sent by the secure element application.
[0023] In some embodiments, when the root key authentication is successful, deriving the subkey based on the root key includes:
[0024] Based on the preset key derivation rules, the subkey is derived using the first root key;
[0025] Sending key derivation instructions to the secure element application;
[0026] Receive a subkey generation success notification from the secure element application;
[0027] Set the key generation status to Generated.
[0028] According to a second aspect of the present disclosure, a method for mutual recognition of application security is provided, which is applied to a security element application, and includes:
[0029] Receiving first key data sent by a third-party application;
[0030] Obtaining second key data;
[0031] Obtain response data including the root key based on the first key data and the second key data, return the response data to the third-party application, and perform root key verification with the third-party application;
[0032] In case the root key authentication is successful, the subkey is derived based on the root key;
[0033] Secure authentication with third-party applications based on subkeys.
[0034] In some embodiments, the second key data includes a second key pair and a second random number;
[0035] Obtaining response data including a root key based on the first key data and the second key data, returning the response data to the third-party application, and performing root key verification with the third-party application, including:
[0036] Receiving a first public key and a first random number sent by a third-party application;
[0037] Obtaining a second key pair and a second random number, the second key pair including a second public key and a second private key;
[0038] Determine a second root key based on the first public key and the second private key;
[0039] Encrypt the first random number based on the second root key to obtain a first encrypted random value;
[0040] The second public key, the second random number, and the first encrypted random value are sent to the third-party application.
[0041] Receiving a second encrypted random value sent by a third-party application;
[0042] Encrypt the second random number based on the second root key to obtain a second verification random value;
[0043] Comparing the second encrypted random value with the second verified random value;
[0044] When the second encrypted random value and the second verified random value are the same, a root key authentication success notification is sent to the third-party application.
[0045] In some embodiments, when the root key authentication is successful, deriving the subkey based on the root key includes:
[0046] Receive key derivation instructions sent by third-party applications;
[0047] Based on the preset key derivation rules, the second root key is used to derive the subkey;
[0048] Set the key generation state to generated;
[0049] Send a subkey generation success notification to the secure element application.
[0050] According to a third aspect of the present disclosure, an electronic device is provided, which is deployed with a third-party application and a security application element. The electronic device is configured to: execute the application security mutual recognition method provided by the first aspect and the second aspect of the present disclosure by running the third-party application and the security application element.
[0051] According to a fourth aspect of the present disclosure, an electronic device is provided, on which a third-party application is deployed. The electronic device is configured to execute the application security mutual recognition method provided by the first aspect of the present disclosure by running the third-party application.
[0052] According to a fifth aspect of the present disclosure, an electronic device is provided, which is deployed with a security application element, and the electronic device is configured to: execute the application security mutual recognition method provided by the second aspect of the present disclosure by running the security application element.
[0053] According to a sixth aspect of the present disclosure, a security mutual recognition system is provided, characterized in that it includes the electronic devices provided by the fourth and fifth aspects of the present disclosure.
[0054] The application security mutual recognition method, electronic device, and system provided by the embodiments of the present disclosure can achieve the following technical effects:
[0055] The application security mutual recognition method provided by the embodiment of the present disclosure uses dynamically generated subkeys for authentication, reducing the need for direct root key operations. Therefore, when adding or replacing third-party applications, it is no longer necessary to frequently update the root key, thereby simplifying the key management process. Third-party applications and security element applications follow the same key derivation algorithm and can authenticate each other. This standard key management method reduces the dependence on specific hardware encryption machines. Due to the use of universal authentication protocols and standards, newly added applications only need to be developed according to established rules, greatly reducing the workload of customization, thereby reducing the degree of coupling. By adopting the method of dynamically generating subkeys, it is possible to better adapt to the cooperation needs between different manufacturers, enhance the flexibility of security mutual recognition and the adaptability of manufacturers' third-party applications.
[0056] The foregoing general description and the following description are exemplary and explanatory only and are not intended to limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0058] Figure 1 It is a schematic diagram of the architecture of an electronic device to which an application security mutual recognition method provided by an embodiment of the present disclosure is applicable;
[0059] Figure 2 It is a schematic diagram of the architecture of another electronic device to which the application security mutual recognition method provided by an embodiment of the present disclosure is applicable;
[0060] Figure 3 It is a flowchart of an application security mutual recognition method provided by an embodiment of the present disclosure;
[0061] Figure 4 It is a flowchart of another application security mutual recognition method provided by an embodiment of the present disclosure;
[0062] Figure 5 is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure;
[0063] Figure 6 It is a schematic diagram of the structure of another electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0064] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0065] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0066] Unless otherwise stated, the term "plurality" means two or more.
[0067] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0068] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0069] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0070] The application security mutual recognition method provided by the embodiment of the present disclosure is particularly suitable for the security authentication scenario between the security element application and the third-party application. The security element application and the third-party application can be deployed in the same electronic device, or in different electronic devices.
[0071] When secure element applications and third-party applications are deployed in the same electronic device, such as smartphones, tablets, wearable devices, vehicle terminals, laptops, etc. Figure 1 As shown, the electronic device includes a hardware layer, a system layer, and an application layer. The hardware layer includes a processor, a memory, and a security element. The processor is responsible for executing the operating system and most applications. The memory is used to run applications and store data. The security element is an independent security chip or an isolated security area, such as an embedded security element (eSE, Embedded Secure Element), a security element in a SIM (Subscriber Identity Module) card, or a trusted execution environment (TEE, Trusted Execution Environment). The operating system in the system layer can be Android, iOS, or Windows, etc. The operating system can provide basic functions and services of the device. The application layer includes security element applications and third-party applications. Security element applications are applications running on security elements. Security element applications can process sensitive data and perform security operations, such as payment, identity authentication, etc. Third-party applications can be applications provided by corresponding manufacturers.
[0072] When secure element applications and third-party applications are deployed on different electronic devices, for ease of understanding and description, Figure 2As shown, the device where the security element application is located is defined as the first electronic device, and the device where the third-party application is located is defined as the second electronic device. The first electronic device and the second electronic device can form an application security mutual recognition system, and data can be exchanged between the first electronic device and the second electronic device through an appropriate communication protocol.
[0073] The specific types of the first electronic device and the second electronic device can be determined according to the actual application scenario. For example, in the mobile payment scenario, a smartphone is usually used as the user end, and has a built-in security element application that supports the payment function, so the smartphone can be regarded as the first electronic device. In contrast, the POS terminal used by merchants to process transactions runs a third-party payment processing application, so the POS terminal can be regarded as the second electronic device. In the IoT and cloud service scenario, taking a smart home system as an example, where IoT devices such as smart light bulbs or thermostats contain security elements for ensuring secure connections, these IoT devices play the role of the first electronic device. At the same time, the cloud server is responsible for performing functions such as data analysis and remote control. It runs related third-party management software, so the cloud server plays the role of the second electronic device here.
[0074] The first electronic device includes a hardware layer, a system layer, and an application layer. The hardware layer includes a processor, a memory, a security element, and a communication module. The processor is responsible for executing the operating system and most applications. The memory is used to run applications and store data. The security element is an independent security chip or an isolated security area, such as an embedded security element, a security element in a SIM card, or a trusted execution environment. The operating system in the system layer can be Android, iOS, or Windows, etc. The operating system can provide basic functions and services of the device. The application layer includes a security element application, which is an application running on the security element. The security element application can process sensitive data and perform security operations such as payment, identity authentication, etc.
[0075] The second electronic device includes a hardware layer, a system layer, and an application layer. The hardware layer includes a processor, a memory, and a communication module. The processor is responsible for executing the operating system and most applications, and the memory is used to run applications and store data. The operating system in the system layer can be Android, iOS, or Windows, etc. The operating system can provide basic functions and services of the device. The application layer includes third-party applications, which can be applications provided by the corresponding manufacturers.
[0076] In the embodiments of the present disclosure, third-party applications may need to access sensitive information or perform security operations. Depending on the operating platform and technology, third-party applications can be divided into at least the following types: UWB (Ultra-Wideband) programs, desktop applications, Web applications, Android applications. According to the actual application scenario, third-party applications can be at least the following specific types: banking applications, payment applications, identity authentication applications, digital car key applications, smart door lock applications, security system applications or device control applications, etc.
[0077] In combination with the electronic device provided by the embodiments of the present disclosure, the embodiments of the present disclosure provide a method for mutual recognition of application security. The method implements security authentication by running a security element application and a third-party application on the electronic device. Specifically, when the security element application and the third-party application are deployed on the same electronic device, the electronic device can directly run these two applications to implement security authentication between them. When the security element application and the third-party application are deployed on different electronic devices, the first electronic device runs the security element application and the second electronic device runs the third-party application. The two electronic devices exchange data through an appropriate communication protocol, thereby implementing security authentication between the security element application and the third-party application. In combination with Figure 3 As shown, the application security mutual recognition method includes:
[0078] S301, a third-party application obtains first key data.
[0079] S302: The third-party application sends first key data to the secure element application.
[0080] S303: The secure element application receives first key data sent by the third-party application.
[0081] The disclosed embodiment initiates communication between the two parties by transmitting the first key data, lays the foundation for subsequent verification steps, and also starts a part of the process of establishing a secure channel.
[0082] S304, the secure element application obtains second key data.
[0083] S305 , the secure element application obtains response data including a root key based on the first key data and the second key data.
[0084] The disclosed embodiment combines two key data to generate response information, which not only increases the complexity of the data interaction process, but also increases the difficulty for attackers to forge valid response data.
[0085] S306: The secure element application returns response data to the third-party application.
[0086] The disclosed embodiments allow a third-party application to verify information from a secure element application, further strengthening the trust relationship between the two parties.
[0087] S307 , the third-party application obtains the corresponding root key based on the response data returned by the secure element application, and performs root key verification with the secure element.
[0088] S308, the secure element application and the third-party application perform root key authentication on each other.
[0089] S309: When the root key authentication is successful, the third-party application derives the subkey based on the root key.
[0090] S310 , when the root key authentication is successful, the security element application derives a sub-key based on the root key.
[0091] The disclosed embodiment utilizes a root key to generate a more specific subkey for actual data exchange, which not only maintains a high level of security but also simplifies subsequent encryption and decryption operations.
[0092] S311, the third-party application performs security authentication based on the subkey and the security element application.
[0093] S312, the secure element application performs security authentication with the third-party application based on the subkey.
[0094] The application security mutual recognition method provided by the embodiment of the present disclosure uses dynamically generated subkeys for authentication, reducing the need for direct root key operations. Therefore, when adding or replacing third-party applications, it is no longer necessary to frequently update the root key, thereby simplifying the key management process. Third-party applications and security element applications follow the same key derivation algorithm and can authenticate each other. This standard key management method reduces the dependence on specific hardware encryption machines. Due to the use of universal authentication protocols and standards, newly added applications only need to be developed according to established rules, greatly reducing the workload of customization, thereby reducing the degree of coupling. By adopting the method of dynamically generating subkeys, it is possible to better adapt to the cooperation needs between different manufacturers, enhance the flexibility of security authentication and the adaptability of manufacturers' third-party applications.
[0095] In the present embodiment, the first key data includes a first key pair and a first random number. The first key data is sent to the security element application, the corresponding root key is obtained based on the response data returned by the security element application, and the root key verification is performed with the security element, including: obtaining the first key pair and the first random number, the first key pair includes a first public key and a first private key; sending the first public key and the first random number to the security element application; receiving the second public key, the second random number and the first encrypted random value sent by the third-party application sent by the security element application; determining the first root key based on the second public key and the first private key; encrypting the first random number based on the first root key to obtain the first verification random value; comparing the first encrypted random value with the first verification random value; when the first encrypted random value and the first verification random value are the same, encrypting the second random number based on the first root key to obtain the second encrypted random value; sending the second encrypted random value to the security element application; receiving the root key authentication success notification sent by the security element application.
[0096] In the present embodiment, when the root key authentication is successful, the sub-key is derived based on the root key, including: based on a preset key derivation rule, using the first root key to derive the sub-key; sending a key derivation instruction to the security element application; receiving a sub-key generation success notification sent by the security element application; and setting the key generation status to generated.
[0097] In the present embodiment, the second key data includes a second key pair and a second random number. Based on the first key data and the second key data, response data including the root key is obtained, the response data is returned to the third-party application, and root key verification is performed with the third-party application, including: receiving the first public key and the first random number sent by the third-party application; obtaining the second key pair and the second random number, the second key pair including the second public key and the second private key; determining the second root key based on the first public key and the second private key; encrypting the first random number based on the second root key to obtain the first encrypted random value; sending the second public key, the second random number and the first encrypted random value to the third-party application. Receive the second encrypted random value sent by the third-party application; encrypt the second random number based on the second root key to obtain the second verification random value; compare the second encrypted random value and the second verification random value; if the second encrypted random value and the second verification random value are the same, send a root key authentication success notification to the third-party application.
[0098] In the present embodiment, when the root key authentication is successful, the sub-key is derived based on the root key, including: receiving a key derivation instruction sent by a third-party application; deriving the sub-key using a second root key based on preset key derivation rules; setting the key generation status to generated; and sending a sub-key generation success notification to the security element application.
[0099] In the disclosed embodiment, the first encrypted random value, the first verified random value, the second encrypted random value, and the second encrypted random value are all encrypted ciphertexts.
[0100] The first encrypted random value is the result of the security element application encrypting the first random number based on the second root key. The first verified random value is the result of the third-party application encrypting the first random number again based on the first root key. The first encrypted random value is compared with the first verified random value to verify whether the two parties correctly share the same root key.
[0101] The second encrypted random value is the result of the third-party application encrypting the second random number based on the first root key. The second verification random value is the result of the security element application encrypting the second random number based on the second root key. The second encrypted random value is compared with the second verification random value to verify whether the two parties correctly share the same root key.
[0102] Combination Figure 4 As shown, the embodiment of the present disclosure provides another application security mutual recognition method, and the application security mutual recognition method includes:
[0103] S401: A third-party application obtains a first key pair and a first random number.
[0104] In the disclosed embodiment, the first key pair may be a temporary ECC (Elliptic Curve Cryptography) key pair, or a key pair pre-stored by a third party. The first key pair includes a first public key and a first private key. The first public key may be represented as PK.APP.ECKA, and the first private key may be represented as SK.APP.ECKA. The first random number may be a random number of a specified number (e.g., 16) bytes, and the first random number may be represented as RND.APP.PLAIN.
[0105] S402: The third-party application sends a first public key and a first random number to the secure element application.
[0106] S403: The secure element application receives a first public key and a first random number sent by a third-party application.
[0107] S404: The secure element application obtains a second key pair and a second random number.
[0108] In the disclosed embodiment, the first key pair may be a temporary ECC (Elliptic Curve Cryptography) key pair, or a key pair pre-stored in a security element. The second key pair includes a second public key and a second private key, the second public key may be represented as PK.SE.ECKA, and the second private key may be represented as SK.SE.ECKA. The second random number may be a random number of a specified number (e.g., 16) bytes, and the second random number may be represented as RND.SE.PLAIN.
[0109] S405 , the secure element application determines a second root key based on the first public key and the second private key.
[0110] In the disclosed embodiment, based on the first public key (PK.APP.ECKA) and the second private key (SK.SE.ECKA), elliptic curve cryptography is used to negotiate a second shared key, and a portion is extracted from the second shared key as the second root key. For example, a specified number (16) bytes are taken from the second shared key as the second root key.
[0111] S406 , the security element application encrypts the first random number based on the second root key to obtain a first encrypted random number value.
[0112] In the disclosed embodiment, the first random number (RND.APP.PLAIN) is encrypted based on the second root key, so that the first random number is converted into a ciphertext format, thereby obtaining a first encrypted random number value. Here, a preset encryption algorithm can be used to encrypt the first random number based on the second root key, and the encryption algorithm can include a symmetric encryption algorithm or a stream cipher algorithm, etc.
[0113] S407 , the secure element application sends the second public key, the second random number, and the first encrypted random value to the third-party application.
[0114] S408: The third-party application receives a second public key, a second random number, and a first encrypted random value sent by the third-party application from the secure element application.
[0115] S409: The third-party application determines a first root key based on the second public key and the first private key.
[0116] In the disclosed embodiment, based on the second public key (PK.SE.ECKA) and the first private key (SK.APP.ECKA), elliptic curve cryptography is used to negotiate a first shared key, and a portion is extracted from the first shared key as the first root key. For example, a specified number (16) bytes are taken from the first shared key as the first root key.
[0117] S410: The third-party application encrypts the first random number based on the first root key to obtain a first verification random number value.
[0118] In the disclosed embodiment, the first random number (RND.APP.PLAIN) is encrypted based on the first root key, so that the first random number is converted into a ciphertext format, thereby obtaining a first verification random value. Here, a preset encryption algorithm can be used to encrypt the first random number based on the first root key, and the encryption algorithm can include a symmetric encryption algorithm or a stream cipher algorithm, etc.
[0119] S411: The third-party application compares the first encrypted random value and the first verified random value.
[0120] In the disclosed embodiment, the first encrypted random value is the result of the security element application encrypting the first random number based on the second root key. The first verified random value is the result of the third-party application encrypting the first random number again based on the first root key. The first encrypted random value is compared with the first verified random value to verify whether the third-party application and the security element application correctly share the same root key.
[0121] It can be understood that when the first encryption random value and the first verification random value are the same, it indicates that the first root key and the second root key are the same, and it is determined that the third-party application and the security element application correctly share the same root key; when the first encryption random value and the first verification random value are different, it indicates that the first root key and the second root key are different, and it is determined that the third-party application and the security element application do not correctly share the same root key. If the third-party application and the security element application correctly share the same root key, the subsequent steps can be continued; if the third-party application and the security element application do not correctly share the same root key, the subsequent steps are stopped.
[0122] S412: When the first encrypted random number value and the first verified random number value are the same, the third-party application encrypts the second random number based on the first root key to obtain a second encrypted random number value.
[0123] In the disclosed embodiment, the second random number (RND.SE.PLAIN) is encrypted based on the first root key, so that the second random number is converted into a ciphertext format, thereby obtaining a second encrypted random number value. Here, a preset encryption algorithm can be used to encrypt the second random number based on the first root key, and the encryption algorithm can include a symmetric encryption algorithm or a stream cipher algorithm, etc.
[0124] S413: The third-party application sends a second encrypted random value to the secure element application.
[0125] S414: The secure element application receives a second encrypted random value sent by the third-party application.
[0126] S415, the security element application encrypts the second random number based on the second root key to obtain a second verification random number value.
[0127] In the disclosed embodiment, the second random number (RND.SE.PLAIN) is encrypted based on the second root key, so that the second random number becomes a ciphertext format, thereby obtaining a second verification random value. Here, a preset encryption algorithm can be used to encrypt the second random number based on the second root key, and the encryption algorithm can include a symmetric encryption algorithm or a stream cipher algorithm, etc.
[0128] S416 , the security element application compares the second encrypted random value with the second verified random value.
[0129] In the disclosed embodiment, the second encrypted random value is the result of the third-party application encrypting the second random number based on the first root key. The second verification random value is the result of the security element application encrypting the second random number based on the second root key. The second encrypted random value is compared with the second verification random value to verify whether the security element application and the third-party application correctly share the same root key.
[0130] It can be understood that when the second encrypted random value and the second verified random value are the same, it indicates that the first root key and the second root key are the same, and it is determined that the third-party application and the secure element application correctly share the same root key; when the second encrypted random value and the second verified random value are different, it indicates that the first root key and the second root key are different, and it is determined that the third-party application and the secure element application do not correctly share the same root key. If the third-party application and the secure element application correctly share the same root key, the subsequent steps can be continued; if the third-party application and the secure element application do not correctly share the same root key, the subsequent steps are stopped.
[0131] S417 , when the second encryption random value and the second verification random value are the same, the secure element application sends a root key authentication success notification to the third-party application.
[0132] S418, the third-party application receives the root key authentication success notification sent by the secure element application.
[0133] S419: The third-party application uses the first root key to derive the subkey based on the preset key derivation rule.
[0134] In the disclosed embodiments, the key derivation rules include but are not limited to custom derivation rules, key derivation functions (KDF), HMAC-based extract-and-expand key derivation functions (HKDF), AES key diversification algorithm (AES Key Wrapping Algorithm), 3DES key diversification algorithm (Triple DES Key Diversification Algorithm), etc. The number of subkeys derived using the first root key can be multiple, such as SubKey_1 to SubKey_n, where n is the total number of subkeys derived using the first root key, and these subkeys will be used for different security operations, such as encryption, decryption, and message authentication code generation.
[0135] S420: The third-party application sends a key derivation instruction to the secure element application.
[0136] S421, the secure element application receives a key derivation instruction sent by a third-party application.
[0137] S422, the security element application uses the second root key to derive the subkey based on a preset key derivation rule.
[0138] In the disclosed embodiment, the key derivation rules used by the security element application are the same as the key derivation rules used by the third-party application. The key derivation rules include but are not limited to custom derivation rules, key derivation functions (KDF, Key Derivation Function), HMAC-based extraction and expansion key derivation functions (HKDF, HMAC-based Extract-and-Expand Key Derivation Function), AES key dispersion algorithm (AES Key Wrapping Algorithm), 3DES key dispersion algorithm (Triple DES Key Diversification Algorithm), etc. The number of subkeys derived using the second root key can be multiple, such as SubKey_1 to SubKey_n, where n is the total number of subkeys derived using the second root key.
[0139] S423, the secure element application sets the key generation state to generated.
[0140] S424, the secure element application sends a subkey generation success notification to the secure element application.
[0141] S425, the third-party application receives a sub-key generation success notification sent by the secure element application.
[0142] S426, the third-party application sets the key generation status to generated.
[0143] S427, the third-party application performs security authentication based on the subkey and the security element application.
[0144] S428, the secure element application performs security authentication with the third-party application based on the subkey.
[0145] In the disclosed embodiment, a third-party application can use one of the subkeys (e.g., SubKey_1) to generate a message authentication code. This message authentication code can be the result of using the HMAC algorithm (Hash-based Message Authentication Code) combined with the subkey to calculate a known data (e.g., a predefined message or timestamp). Afterwards, the third-party application sends the message authentication code together with the original data to the security element application. The security element application receives the data from the third-party application and the corresponding message authentication code. Using the same subkey (e.g., SubKey_1) and the same data, the security element application recalculates the message authentication code. If the calculated message authentication code matches the message authentication code provided by the third-party application, then the third-party application is considered to be credible. The third-party application encrypts a message using one of the subkeys (e.g., SubKey_2) and then sends it to the security element application. The security element application receives the message encrypted by the third-party application, and attempts to decrypt the message using the correct subkey (e.g., SubKey_2). If the decryption is successful, it proves that both parties share the correct subkey. Through the above steps, the third-party application and the security element application can authenticate each other's identity to ensure the security of communication.
[0146] In the disclosed embodiment, after the third-party application and the secure element application complete security authentication, a secure session under a standard secure channel protocol can be established between the third-party application and the secure element application, and data exchange and business interaction between the third-party application and the secure element application are performed based on this secure session.
[0147] In the disclosed embodiment, before obtaining the first key pair and the first random number, the third-party application and the security element application must first check their respective key generation status. If the key generation status of both parties is displayed as "generated", this indicates that the third-party application and the security element application have successfully generated the corresponding subkeys before. Therefore, in this case, the third-party application can directly use these pre-generated subkeys to perform the security authentication process with the security element.
[0148] Of course, even if the third-party application and the secure element application already have pre-generated subkeys, for security reasons or specific needs, you can choose to re-execute steps from S401 to S428 to regenerate a new subkey and perform subsequent security authentication based on the newly generated subkey. This can further enhance the security of the communication process and ensure that even if the original key may be leaked, it will not affect the security of the overall system.
[0149] The hardware structure of the electronic device provided by the embodiment of the present disclosure is as follows: Figure 5 As shown, the electronic device includes a processor 101 and a memory 102. Optionally, the electronic device may further include a communication module 103 and a bus 104. The processor 101, the memory 102, and the communication module 103 may communicate with each other through the bus 104. The communication module 103 may be used for information transmission. The processor 101 may call the logic instructions in the memory 102 to execute the application security mutual recognition method of the above embodiment.
[0150] In addition, the logic instructions in the memory 102 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0151] The memory 102 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 101 executes functional applications and data processing by running the program instructions / modules stored in the memory 102, that is, implementing the application security mutual recognition method in the above embodiment.
[0152] The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 102 may include a high-speed random access memory and may also include a non-volatile memory.
[0153] Understandably, Figure 5 Electronic devices in a device can deploy secure element applications and third-party applications at the same time. Figure 5 The electronic device in the embodiment may also deploy only one of the security element application and the third-party application, that is, the electronic device may be the first electronic device or the second electronic device mentioned above.
[0154] In the embodiment of the present disclosure, Figure 6As shown, when the electronic device is deployed with a security element application, the electronic device includes a processor 101, a communication module 103, and a memory 102, and the electronic device also includes a security element 105 on the basis of the bus 104. The security element 105 can communicate with the processor 101 through the bus 104. The security element 105 can also be directly connected to the processor 101 and communicate through a dedicated security interface (such as SPI, I2C, USB, etc.).
[0155] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.
[0156] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0157] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0158] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0159] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for mutual recognition of application security, applied to third-party applications, characterized in that: include: Obtaining first key data; Sending first key data to the secure element application, obtaining a corresponding root key based on response data returned by the secure element application, and performing root key authentication with the secure element; In case the root key authentication is successful, the subkey is derived based on the root key; Security authentication based on subkey and secure element application.
2. The application security mutual recognition method according to claim 1, characterized in that: The first key data includes a first key pair and a first random number; Sending first key data to the security element application, obtaining a corresponding root key based on response data returned by the security element application, and performing root key authentication with the security element, including: Obtain a first key pair and a first random number, the first key pair including a first public key and a first private key; Sending a first public key and a first random number to a secure element application; Receive a second public key, a second random number, and a first encrypted random value sent by a third-party application sent by the secure element application; Determine a first root key based on the second public key and the first private key; Encrypt the first random number based on the first root key to obtain a first verification random value; comparing the first encrypted random value and the first verified random value; When the first encrypted random number value and the first verification random number value are the same, encrypting the second random number based on the first root key to obtain a second encrypted random number value; sending a second encrypted random value to the secure element application; Receive root key authentication success notification sent by the secure element application.
3. The application security mutual recognition method according to claim 2, characterized in that: When the root key authentication succeeds, the subkey is derived based on the root key, including: Based on the preset key derivation rules, the subkey is derived using the first root key; Sending key derivation instructions to the secure element application; Receive a subkey generation success notification from the secure element application; Set the key generation status to Generated.
4. A method for mutual recognition of application security, applied to a security element application, characterized in that: include: Receiving first key data sent by a third-party application; Obtaining second key data; Obtain response data including the root key based on the first key data and the second key data, return the response data to the third-party application, and perform root key verification with the third-party application; In case the root key authentication is successful, the subkey is derived based on the root key; Secure authentication with third-party applications based on subkeys.
5. The application security mutual recognition method according to claim 4, characterized in that: The second key data includes a second key pair and a second random number; Obtaining response data including a root key based on the first key data and the second key data, returning the response data to the third-party application, and performing root key verification with the third-party application, including: Receiving a first public key and a first random number sent by a third-party application; Obtaining a second key pair and a second random number, the second key pair including a second public key and a second private key; Determine a second root key based on the first public key and the second private key; Encrypt the first random number based on the second root key to obtain a first encrypted random value; The second public key, the second random number, and the first encrypted random value are sent to the third-party application. Receiving a second encrypted random value sent by a third-party application; Encrypt the second random number based on the second root key to obtain a second verification random value; Comparing the second encrypted random value with the second verified random value; When the second encrypted random value and the second verified random value are the same, a root key authentication success notification is sent to the third-party application.
6. The application security mutual recognition method according to claim 5, characterized in that: When the root key authentication succeeds, the subkey is derived based on the root key, including: Receive key derivation instructions sent by third-party applications; Based on the preset key derivation rules, the second root key is used to derive the subkey; Set the key generation state to generated; Send a subkey generation success notification to the secure element application.
7. An electronic device, deployed with a third-party application and a security application element, characterized in that: The electronic device is configured to execute the application security mutual recognition method as claimed in any one of claims 1 to 6 by running a third-party application and a security application element.
8. An electronic device, deployed with a third-party application, characterized in that: The electronic device is configured to execute the application security mutual recognition method as described in any one of claims 1 to 3 by running a third-party application.
9. An electronic device, equipped with a security application element, characterized in that: The electronic device is configured to execute the application security mutual recognition method as claimed in any one of claims 4 to 6 by running a security application element.
10. A security mutual recognition system, characterized in that: The electronic device comprising the electronic device described in claim 8 and claim 9.