Key installation method, system, device, equipment and computer program
By installing a verification public key on a security chip generated by a server, the method addresses the risk of private key leakage during chip installation, ensuring secure encryption and decryption processes.
Patent Information
- Application Number
- JP2023537408
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-02-09
- Filing Date
- 2022-01-25
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-01-25
AI Technical Summary
The transmission of confidential information is vulnerable to security risks due to the potential leakage of private keys during the installation process of security chips, which compromises the encryption and decryption processes.
A method and system for installing a verification public key generated by a server onto a security chip, allowing the chip to encrypt information using the verification public key without transmitting the private key, thereby reducing the risk of key leakage.
This approach enhances the security of information transmission by eliminating the need to transmit private keys, thus reducing the risk of key leakage and increasing the overall security of the encryption process.
Smart Images

Figure 0007577219000001 
Figure 0007577219000002 
Figure 0007577219000003
Abstract
Description
[Technical field]
[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims priority to a Chinese patent application filed on February 9, 2021, bearing application number 202110181982.9 and entitled "Key installation method, system, device, apparatus and storage medium", the entire contents of which are incorporated herein by reference.
[0002] The present application relates to the field of data security, and in particular to a key installation method, system, device, equipment and storage medium. [Background technology]
[0003] With the development of network technology, the frequency of information transmission is becoming increasingly high. In many scenarios, the information transmitted is confidential, and in order to ensure the security of the information, the information needs to be encrypted before the information transmission. Summary of the Invention
[0004] The embodiments of the present application provide a key installation method, system, device, equipment and storage medium, and the technical solutions are as follows:
[0005] According to one aspect, there is provided a key installation method implemented by an electronic device, the method comprising: Sending first installation information to a server, the first installation information being used to indicate an installation authority of an electronic device to the security chip; obtaining second installation information, the second installation information including a verification public key generated by the server, the second installation information being installation information sent by the server to the electronic device when the server determines that the electronic device has an installation right for the security chip based on the first installation information; and a step of installing the verification public key in the security chip, wherein the verification public key is used to encrypt information and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0006] According to one aspect, there is provided a server executed key installation method, the method comprising: obtaining first installation information sent from the electronic device, the first installation information being used to indicate an installation authority of the electronic device to the security chip; and a step of sending second installation information to the electronic device in response to the electronic device having installation authority for the security chip, the second installation information including a verification public key generated by the server so that the electronic device installs the verification public key in the security chip, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information.
[0007] According to one aspect, there is provided a key installation method executed by a security chip, the method comprising: obtaining a verification public key installed in the security chip by an electronic device, the verification public key being generated by a server, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information; and encrypting the transmission using the verification public key.
[0008] According to one aspect, there is provided a key installation device, the device comprising: A first transmitting module configured to transmit first installation information to a server, the first installation information being used to indicate an installation authority of an electronic device to a security chip; a first obtaining module configured to obtain second installation information, the second installation information including a verification public key generated by the server, and the second installation information being installation information sent by the server to the electronic device when the server determines that the electronic device has an installation right for the security chip based on the first installation information; and an installation module configured to install the verification public key into the security chip, wherein the verification public key is used to encrypt information and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0009] According to one aspect, there is provided a key installation device, the device comprising: A second acquisition module configured to acquire first installation information sent from the electronic device, the first installation information being used to indicate an installation authority of the electronic device to the security chip; and a second transmitting module configured to transmit second installation information to the electronic device in response to the electronic device having installation authority for the security chip, the second installation information including a verification public key generated by the server so that the electronic device installs the verification public key in the security chip, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information.
[0010] According to one aspect, there is provided a key installation device, the device comprising: A third acquisition module configured to acquire a verification public key installed in the security chip by an electronic device, the verification public key being generated by a server, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information; and a transmission encryption module configured to encrypt a transmission using the verification public key.
[0011] According to one aspect, there is provided a key installation system comprising a security chip, an electronic device and a server, The electronic device is configured to send first installation information to the server, the first installation information being used to indicate an installation authority for the security chip of the electronic device; the server is configured to receive the first installation information, and when determining that the electronic device has an installation authority for the security chip based on the first installation information, send second installation information to the electronic device, the second installation information including a verification public key generated by the server; The electronic device is further configured to receive the second installation information and install the verification public key in the security chip, where the verification public key is used to encrypt information, and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0012] According to one aspect, there is provided a computing device comprising one or more processors and one or more memories, the one or more memories storing at least one computer program, the one or more processors loading and executing the computer program to implement the key installation method.
[0013] According to one aspect, there is provided a computer readable storage medium having stored thereon at least one computer program that is loaded and executed by a processor to cause the processor to implement the key installation method.
[0014] According to one aspect, there is provided a computer program product or computer program comprising program code, the program code being stored on a computer readable storage medium, and a processor of a computing device reading the program code from the computer readable storage medium and executing the program code to perform the key installation method set forth above. [Brief description of the drawings]
[0015] [Figure 1] FIG. 2 is a schematic diagram of an implementation environment of a key installation method according to an embodiment of the present application. [Diagram 2] 2 is a flow chart of a key installation method according to an embodiment of the present application; [Diagram 3] 2 is a flow chart of a key installation method according to an embodiment of the present application; [Figure 4] 2 is a flow chart of a key installation method according to an embodiment of the present application; [Diagram 5] 4 is an interaction flow chart of a key installation method according to an embodiment of the present application; [Figure 6] FIG. 2 is an exemplary structural diagram of a key installation system according to an embodiment of the present application. [Figure 7] FIG. 2 is an exemplary structural diagram of a key installation device according to an embodiment of the present application; [Figure 8] FIG. 2 is an exemplary structural diagram of a key installation device according to an embodiment of the present application; [Figure 9] FIG. 2 is an exemplary structural diagram of a key installation device according to an embodiment of the present application; [Figure 10] 1 is an exemplary structural diagram of an electronic device according to an embodiment of the present application; [Figure 11] FIG. 2 is an exemplary structural diagram of a server according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0016] In order to more clearly describe the technical solutions of the embodiments of the present application, the above briefly introduces the drawings used in the description of the embodiments. The drawings described above are only some embodiments of the present application, and it is obvious to those skilled in the art that they can also obtain other drawings according to these drawings without creative work.
[0017] In order to make the objectives, technical solutions and advantages of the present application clearer, the following describes the embodiments of the present application in more detail with reference to the drawings.
[0018] In this application, terms such as "first", "second", etc. are used to distinguish between the same or similar items that have substantially the same action and function, and as will be understood, there is no logical or temporal dependency between "first", "second", and "nth", and there are no limitations with respect to number and execution order.
[0019] As used herein, the term "at least one" refers to one or more, and "plurality" means two or more than two.
[0020] In the related technology, a user uses a security chip to encrypt information, and the security chip encrypts information using a chip private key during the information encryption process, and the information receiving side can decrypt the encrypted information using the chip public key, thereby completing the information transmission. When a security chip is produced, the server always generates a chip private key and a chip public key, and then issues the chip private key to an electronic device, and the electronic device installs the chip private key into the security chip.
[0021] However, the above chip installation process involves the transmission of the chip private key, which may lead to the risk of the chip private key being leaked, and may reduce information security.
[0022] In order to describe the technical solutions according to the embodiments of the present application, the following introduces some terms related to the embodiments of the present application.
[0023] Cloud technology is a collective term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the application of cloud computing business mode, which can combine resource pools and be used as needed, flexibly and conveniently. Cloud computing technology is an important support. The background services of technical network systems, such as video sites, photo sites and more portal sites, require a large amount of computing and storage resources.
[0024] Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a distributed database and data blocks generated by association using encryption methods, each data block contains information of network transactions, and is used to verify the validity (anti-counterfeiting) of the information and generate the next block. Blockchain may include a blockchain bottom layer platform, a platform product service layer, and an application service layer.
[0025] Symmetric encryption algorithm: an algorithm where encryption and decryption both use the same rule (key), i.e. A chooses one rule to encrypt information, and B uses the same rule (the reverse rule) to decrypt information.
[0026] Asymmetric encryption algorithm: different rules can be used for encryption and decryption, as long as there is some correspondence between the two rules. That is, B generates two keys (one public key and one private key) based on the algorithm, where the private key is kept secret and the public key is made public for others to use when communicating with B, A gets the public key from B and uses it to encrypt, B gets the information encrypted by A and uses the private key to decrypt, thus completing the communication.
[0027] Relatively prime: If two or more integers have a greatest common factor of 1, they are called relatively prime. For example, 7 and 10 are relatively prime because their greatest common factor is 1. 8 and 10 are not relatively prime because their greatest common factor is 2.
[0028] Euler's function: For a positive integer n, Euler's function gives the number of positive integers less than or equal to n that are relatively prime to n, and is represented as φ(n). For example, in the range from 1 to 10, the numbers that are relatively prime to 10 are 1, 3, 7, and 9, so φ(10) = 4.
[0029] Euler's theorem: Also known as the Fermat-Euler theorem, it states that if two positive integers a and n are relatively prime, then the Euler function φ(n) of n satisfies the following equation (1):
[0030] a φ(n) =1(mod n) (1) Here, mod is the remainder. In other words, the remainder when a is raised to the power of φ(n) and divided by n is 1, or the remainder when a is raised to the power of φ(n) and subtracted from 1 is divisible by n. For example, 7 and 5 are mutually prime, and 7 φ(5) -1=7 4 -1=2401-1=2400, which is divisible by 5.
[0031] RSA Algorithm: A type of asymmetric encryption algorithm, based on Euler's function and Euler's theorem above.
[0032] Security chip: A security chip is a trusted platform module, a device that can generate keys and encrypt / decrypt independently, and has an independent processor and memory unit inside, which can store keys and feature data and provide encryption and security authentication services. The security chip is used for encryption, and the key is stored in the hardware, so that stolen data cannot be decrypted, thereby protecting privacy and data security.
[0033] FIG. 1 is a schematic diagram of an implementation environment of a key installation method according to an embodiment of the present application. Referring to FIG. 1, the implementation environment may include a security chip 110, an electronic device 120 and a server 140.
[0034] The electronic device 120 is connected to the security chip 110 using a wireless network or a wired network, and optionally the electronic device 120 may be, but is not limited to, a smartphone, a tablet computer, a notebook computer, a desktop computer, etc. Optionally, the electronic device 120 is a device used by the manufacturer of the security chip 110, and the electronic device 120 uses a card reader of the security chip to read and write the security chip 110.
[0035] The electronic device 120 is connected to the server 140 using a wireless or wired network. An application program that supports key installation is installed and executed on the electronic device 120.
[0036] Optionally, server 140 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides fundamental cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Networks (CDNs), big data and artificial intelligence platforms.
[0037] Optionally, electronic device 120 generally refers to one of multiple electronic devices, and the embodiments of the present application are described with electronic device 120 as an example.
[0038] Those skilled in the art can understand that the number of the above electronic devices may be more or less. For example, the above electronic device may be only one, or the above electronic devices may be tens or hundreds, or more, in which case the implementation environment may further include other electronic devices. The embodiments of the present application are not limited to the number and types of electronic devices.
[0039] After introducing the implementation environment of the embodiments of the present application, the following describes the application scenarios of the technical solutions according to the embodiments of the present application.
[0040] The technical solution according to the embodiment of the present application can be applied to a scenario where a merchant customizes a security chip, for example, a merchant wants to customize a stored value card, and the stored value card is equipped with a security chip, and the security chip is used to encrypt information contained in the stored value card, thereby preventing the information in the stored value card from being tampered with and avoiding the situation where the stored value card is stolen and additional information is written to the stored value card. The merchant can put requirements on the security chip manufacturer, and the security chip manufacturer can customize the security chip according to the merchant's requirements. The security chip manufacturer can adopt the technical solution according to the embodiment of the present application to perform key installation on the security chip, and place the security chip after key installation on the merchant's stored value card. In the process of key installation, the server used by the merchant to read the stored value card is the server 140 in the above implementation environment, and the device on which the security chip manufacturer performs key installation on the security chip is the above electronic device 120. After a user purchases a stored value card of the merchant, the user can use the value card containing the security chip to spend at the merchant, and during the spending process, any change in the amount on the stored value card is encrypted by the security chip and stored on the stored value card, thus preventing theft of the stored value card and tampering with the information held by the user.
[0041] The technical solution according to the embodiment of the present application can be applied to a data encryption scenario, for example, a manufacturer of a communication application wants to customize a security chip, and the security chip is used to encrypt messages transferred in the communication application, so as to prevent messages transferred in the communication application from being stolen. The manufacturer of the communication application can provide requirements to a manufacturer of a security chip, and the manufacturer of the security chip can customize the security chip according to the requirements of the manufacturer of the communication application. The manufacturer of the security chip can adopt the technical solution according to the embodiment of the present application to perform key installation on the security chip, and place the security chip after key installation on the device installed with the communication application. In the process of key installation, the server used to read the communication application is the server 140 in the above implementation environment, and the device on which the manufacturer of the security chip performs key installation on the security chip is the above electronic device 120. A user can use the device installed with the security chip to use the communication application, so as to prevent messages from being stolen.
[0042] For example, the embodiments of the present application can be applied to a block chain system, in which the block chain system includes multiple nodes, and the mode of data transmission between the nodes is encrypted transmission, and each node in the block chain system can use the security chip according to the embodiments of the present application to encrypt and decrypt data, thereby ensuring the security of the data. Optionally, each node in the block chain system is an electronic device in the above implementation environment.
[0043] It should be noted that the above application scenario introduction takes as an example a merchant customizing a stored value card and customizing a security chip in a communication application, and in other possible embodiments, the key installation method according to the embodiments of the present application can also be applied to other security chip manufacturing scenarios, and the embodiments of the present application are not limited thereto.
[0044] In order to more clearly describe the technical solutions according to the embodiments of the present application, the following description takes the security chip, the electronic device and the server in the above implementation environment as execution entities, respectively.
[0045] FIG. 2 is a flowchart of a key installation method according to an embodiment of the present application. Referring to FIG. 2, take the execution entity as an example that is a security chip, and the method includes the following steps:
[0046] In step 201, the security chip obtains a verification public key installed in the security chip by the electronic device, the verification public key is generated by a server, the verification public key is used to encrypt information, and the verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0047] Here, the verification public key and the verification private key are an asymmetrically encrypted key pair generated by the server.
[0048] In one possible embodiment, when the server determines that the electronic device has the installation authority for the security chip, the server sends second installation information to the electronic device, and the electronic device sends the verification public key in the second installation information to the security chip, where the server is the server that uses the security chip, for example, the server of a merchant, and the electronic device is the device that the manufacturer of the security chip uses.
[0049] In step 202, the security chip encrypts the transmission information with the verification public key.
[0050] In one possible embodiment, the security chip encrypts transmission information using a chip private key of the security chip to obtain first encrypted transmission information, and the security chip encrypts the first encrypted transmission information using a verification public key to obtain second encrypted transmission information, and transmits the second encrypted transmission information to the server.
[0051] In step 202, in the process of encrypting information transmission, the security chip encrypts the information that needs to be transmitted using a verification public key to obtain encrypted information. When the server receives the encrypted information, it can decrypt the encrypted information using a verification private key corresponding to the verification public key, thereby realizing the secret transmission of the transmission information.
[0052] Optionally, the second installation information, in addition to the verification public key, further includes a first authentication code obtained by the server encrypting the verification information with a chip public key of the security chip and a verification private key corresponding to the verification public key. After receiving the second installation information, the electronic device can further send the first authentication code to the security chip, and correspondingly, after step 201, the security chip can verify the installed verification public key according to the first authentication code by directly executing the following steps 203-205 in addition to executing the above step 202.
[0053] In step 203, the security chip decrypts the first authentication code using the chip private key and the verification public key to obtain the first information.
[0054] In one possible embodiment, the security chip uses the verification public key to decrypt the first authentication code to obtain a second verification code, and the security chip uses the chip private key to decrypt the second verification code to obtain the first information.
[0055] Since the encryption and decryption processes are two corresponding processes, in order to more clearly explain the above embodiment, the following will first describe the process in which the server encrypts verification information using the chip public key and the verification private key to obtain a first authentication code.
[0056] In one possible embodiment, the server encrypts the verification information with the chip public key to obtain a first verification code, and encrypts the first verification code with the verification private key to obtain a first authentication code.
[0057] For example, if the chip public key is (n 1 ,d 1 ), then the verification information z 1 For 1 ,d 1 ) to obtain the encryption formula z 1 d1 =c 1 (mod n 1 ) where c 1 is the verification information z 1 This is the first verification code after encrypting the formula z 1 d1 = c 1 (mod n 1 ) and perform form transformation on c 1 = z 1 d1 %n 1 We obtain the verification information z 1 is 3, and n 1 =12, d 1 = 7, then c 1 =3 7 %12=3, that is, the first verification code c 1 is 3. The verification private key is (n 2 ,e 1 ), the first verification code c 1 For 2 ,e 1 ) to generate the first verification code c 1 The encryption formula is c 1 e1 =k 1(mod n 2 ), where k 1 is the first authentication code. 1 e1 = k 1 (mod n 2 ) and perform form transformation on k 1 = c 1 e1 %n 2 Get n 2 = 55, e 1 = 17, k 1 =3 17 % 55=53, which means the first authentication code is 53.
[0058] Next, a method in which the security chip acquires the first information based on the first authentication code will be described.
[0059] For example, if the verification public key is (n 2 ,d 2 ), the first authentication code k 1 For, the security chip has a verification public key (n 2 ,d 2 ) to obtain the decoding formula k 1 d2 =c 2 (mod n 2 ) to get the first authentication code k 1 Decrypt the formula c 2 d2 =k(mod n 2 ) and perform form transformation on c 2 = k 1 d2 %n 2 The first authentication code k 1 =53, n 2 =55, d 2 = 33, and c 1 =53 33 % 55=3, that is, the second verification code c 2 is 3. Compared to the previous example, the verification public key (n 2 ,d 2 ) is the chip public key (n 1 ,d 1When corresponding to 2 , the obtained second verification code c 1 is the same as the first verification code c 1 generated by the server. If the chip private key is (n 2 , e 2 e2 = z 2 (mod n 1 ), the security chip decrypts the first verification code c 2 using the decryption formula c 2 to obtain the first piece of information z 1 , e 2 ). Of course, when the chip private key (n 1 , e 1 ) corresponds to the verification private key (n 2 , d 1 ), the first piece of information z
[0060] obtained by decryption is also the same as the verification information z
[0061] generated by the server. The method by which the security chip generates the chip private key and the chip public key will be described below.
[0062] In one possible embodiment, the security chip uses an asymmetric encryption algorithm to generate the chip public key and the chip private key.
[0063] For example, the security chip randomly generates two prime numbers a and b, and obtains the product n of a and b. The product n is converted into binary, and the number of bits of the binary number indicates the number of bits of the asymmetric encryption algorithm. Determine the Euler's totient function m = φ(n) of the product n. Randomly generate an integer e such that 1 < e < m and e is relatively prime to m. Obtain an integer d such that e * d - 1 = y * m. Finally, the generated chip public key is (n, e) and the chip private key is (n, d). It should be noted that in the process of the security chip generating e and d, there may be multiple values of e, and then multiple key pairs can be formed based on the multiple e and the multiple d generated from the multiple e.For example, a=5 and b=11 are generated by the security chip, and their product n=5*11=55 is obtained. The security chip converts the product 55 into a binary number 110111, and in some embodiments, the number of bits of the binary number is the number of bits of the encryption algorithm, in the above example, the number of bits of the encryption algorithm is 6 bits. The security chip substitutes the product into Euler's function, and based on the formula, m=φ(55)=φ(5)φ(11)=(5-1)(11-1)=40. The security chip randomly generates an integer e, for example, 17, where 17 is relatively prime to 55 and 1<17<55. According to the equation e*d-1=y*m, the security chip substitutes e=17 and m=40 to obtain a quadratic equation where 17*d-1=y*40, and the security chip obtains a set of integer solutions to the quadratic equation whose solutions are d=33 and y=14. Then, the chip public key generated by the security chip is (55,17), and the chip private key is (55,33).
[0064] It should be noted that the above describes an example in which the security chip generates a key pair based on Euler's function, and in other possible embodiments, the security chip generates the key pair in other manners, and the embodiments of the present application are not limited thereto.
[0065] In step 204, the security chip encrypts the first information using the verification public key and the chip private key to obtain a second authentication code.
[0066] In one possible embodiment, the security chip encrypts the first information with the verification public key to obtain a third verification code, and the security chip encrypts the third verification code with the chip private key to obtain a second authentication code.
[0067] For example, if the verification public key is (n 2 ,d 2 ), the first information z 2 For, the security chip has a verification public key (n 2,d 2 ) to obtain the encryption formula z 2 d2 =c 3 (mod n 2 ) where c 3 is the first information z 2 This is the third verification code after encrypting the formula z 2 d2 =c 3 (mod n 2 ) and perform form transformation on c 3 = z 2 d2 %n 2 The first information z 2 is 4, and n 2 = 15, d 2 = 11, then c 3 =4 11 %15=4, that is, the third verification code c 3 is 4. The chip private key is (n 1 ,e 2 ), the third verification code c 3 For, the security chip is a chip private key (n 1 ,e 2 ) to generate the third verification code c 3 Encrypt it, and the encryption formula is c 3 e2 =k 2 (mod n 1 ), where k 2 is the second authentication code. 3 e2 =k 2 (mod n 1 ) and perform form transformation on k 2 = c 3 e2 %n 1 Get n 1 = 55, e 2 = 33, k 2 =4 33 % 55=9, which means the second authentication code is 9.
[0068] In step 205, the security chip sends the second authentication code to the server, so that the server verifies the security chip based on the first information and the verification information in the second authentication code.
[0069] In one possible embodiment, the security chip sends a second authentication code to the electronic device, and the electronic device sends the second authentication code to the server. After receiving the second authentication code, the server decrypts the second authentication code and obtains the first information in the second authentication code. The server compares the first information with the verification information. If the first information is the same as the verification information, the server determines that the key installation of the security chip is complete, and the security chip can be used after being shipped from the factory. If the first information is different from the verification information, the server determines that there is an abnormality in the key installation of the security chip, and the security chip cannot be used normally.
[0070] Through the above steps 203-205, the security chip can perform further verification with the server after key installation, so as to ensure that each key matches with each other, accurately realize the encryption and decryption of information, and ensure the accuracy of information transmission.
[0071] All the above optional technical solutions can be arbitrarily combined to form alternative embodiments of the present application, which will not be specifically described herein.
[0072] The technical solution according to the embodiment of the present application can install the verification public key generated by the server into the security chip, so that the security chip can use the verification public key to encrypt information. In this way, the key installation process does not involve any private key transmission, so that the risk of private key leakage can be reduced and the security of information can be improved.
[0073] FIG. 3 is a flowchart of a key installation method according to an embodiment of the present application. Referring to FIG. 3, take an electronic device as an example, and the method includes the following steps:
[0074] In step 301, the electronic device sends first installation information to the server, where the first installation information is used to indicate the installation authority of the electronic device to the security chip.
[0075] Here, the first installation information includes a chip identifier of the security chip and a device identifier of the electronic device, and the server can determine whether the electronic device has an installation right for the security chip based on the chip identifier and the device identifier.
[0076] In one possible embodiment, the electronic device encrypts the first installation information using an electronic device private key to obtain first encrypted information, the electronic device private key being a private key corresponding to the electronic device. The electronic device transmits the first encrypted information to the server, the first encrypted information being the encrypted first installation information.
[0077] For example, the electronic device maps the first installation information to a first information digest corresponding to the first installation information, where the first information digest is used to verify the first installation information. The electronic device uses the electronic device private key to encrypt the first information digest and the first installation information to obtain first encrypted information. The electronic device transmits the first encrypted information to a server, and the server verifies the installation authority of the electronic device for the security chip based on the first encrypted information. In the process in which the server verifies the installation authority of the electronic device for the security chip based on the first encrypted information, the server can verify whether the first installation information has been tampered with based on the first information digest, that is, use the first relationship data to map the first installation information to a second information digest; and compare the first information digest with the second information digest, if the first information digest is the same as the second information digest, the server can determine that the first installation information has not been tampered with; correspondingly, if the first information digest is different from the second information digest, the server can determine that the first installation information has been tampered with. Here, the first relationship data is the relationship data adopted by the electronic device when mapping the first installation information to the first information summary, and the first relationship data is an encryption function. In this manner, the server can process the first installation information using the same encryption function as the electronic device to obtain a second information summary, and can determine whether the first installation information has been tampered with by comparing the first information summary with the second information summary.
[0078] For example, the electronic device employs first relationship data to map the first installation information to a first information digest, the first relationship data being an asymmetric encryption function, and the first relationship data can map information of different lengths to a fixed-length hash, and the fixed-length hash is the information digest. In some embodiments, the first relationship data is Message-Digest Algorithm 5 (MD5) and Secure Hash Algorithm 2 (SHA-2), or other asymmetric encryption algorithms, and the embodiments of the present application are not limited thereto. The electronic device uses the electronic device private key to respectively encrypt the first information digest and the first installation information, and obtain an electronic device signature corresponding to the first information digest and encrypted information corresponding to the first installation information. The electronic device concatenates the electronic device signature to the encrypted information corresponding to the first installation information, and obtains first encrypted information. The electronic device sends the first encrypted information to the server.
[0079] In step 302, the electronic device obtains second installation information, where the second installation information includes a verification public key generated by the server, and the second installation information is the installation information sent by the server to the electronic device when it is determined that the electronic device has installation authority for the security chip based on the first installation information.
[0080] In one possible embodiment, if the server determines that the electronic device has the installation authority for the security chip, the electronic device obtains the second encrypted information sent from the server, where the second encrypted information is obtained by the server encrypting the second installation information with the server private key of the server, and the electronic device decrypts the second encrypted information with the server public key to obtain the second installation information, where the server public key corresponds to the server private key.
[0081] For example, after the server determines based on the first installation information that the electronic device has an installation right for the security chip, the server uses a private key to encrypt the generated second installation information to obtain the second encrypted information, where the server generates the second installation information based on the verification public key, and the second encrypted information is the encrypted second installation information. The server sends the second encrypted information to the electronic device. After receiving the second encrypted information, the electronic device can decrypt the second encrypted information using the server public key to obtain the second installation information. It should be noted that the server can not only include the server public key in the second installation information, but also send the server public key to the electronic device in advance, and the embodiments of the present application are not limited thereto. In some embodiments, when the first installation information includes a chip identifier of the security chip and a device identifier of the electronic device, the server determines whether the chip identifier has a binding relationship with the device identifier. If the chip identifier has a binding relationship with the device identifier, the server determines that the electronic device has an installation right for the security chip, where the installation right refers to the electronic device being able to add information to the security chip.
[0082] For example, if the server's private key is (n 3 ,e 3 ), the second installation information z 3 For 3 ,e 3 ) to obtain the encryption formula z 3 e3 =c 4 (mod n 3 ) to enter the second installation information 3 can be encrypted, where c 4 The second installation information 3 This is the second encrypted information after encrypting the formula z 3 e3 =c 4 (mod n 3 ) and perform form transformation on c4 = z 3 e3 %n 3 You can get the second installation information. 3 is 2, and n 3 =21, e 3 = 16, then c 1 =2 16 %21=16, that is, the second encrypted information c 4 is 16, and the server 4 The electronic device transmits the second encrypted information c 4 and uses the server public key to encrypt the second encrypted information c 4 Decrypt the second installation information z 3 get.
[0083] In step 303, the electronic device installs a verification public key in the security chip, the public key is used to encrypt information, and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0084] After the electronic device is installed in the security chip, the security chip can store the verification public key, and in the process of transmitting subsequent encrypted information, the security chip can encrypt the information that needs to be transmitted using the verification public key, and the server can decrypt the encrypted information using the verification private key corresponding to the verification public key.
[0085] All the above optional technical solutions can be arbitrarily combined to form alternative embodiments of the present application, which will not be specifically described herein.
[0086] The technical solution according to the embodiment of the present application can install the verification public key generated by the server into the security chip, so that the security chip can use the verification public key to encrypt information. In this way, the key installation process does not involve any private key transmission, so that the risk of private key leakage can be reduced and the security of information can be improved.
[0087] FIG. 4 is a flowchart of a key installation method according to an embodiment of the present application. Referring to FIG. 4, take the execution subject as an example that is a server, and the method includes the following steps:
[0088] In step 401, the server receives first installation information sent from the electronic device, and the first installation information is used to indicate the installation authority of the electronic device to the security chip.
[0089] In one possible embodiment, the server obtains the first encrypted information sent from the electronic device, where the first encrypted information is obtained by the electronic device encrypting the first installation information using the electronic device private key of the electronic device, and the server decrypts the first encrypted information using the electronic device public key to obtain the first installation information, where the electronic device public key corresponds to the electronic device private key.
[0090] In step 402, in response to the electronic device having installation authority for the security chip, the server sends second installation information to the electronic device, where the second installation information includes a verification public key generated by the server, so that the electronic device installs the verification public key in the security chip, the verification public key is used to encrypt information, and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0091] In one possible embodiment, the server encrypts the second installation information with a server private key of the server to obtain second encrypted information, and the server transmits the second encrypted information to the electronic device.
[0092] For example, the server maps the second installation information to a fourth information digest corresponding to the second installation information, and the server encrypts the fourth information digest and the second installation information with a server private key to obtain second encrypted information.
[0093] For example, the server adopts the second relationship data to map the second installation information to the fourth information digest, the second relationship data being an asymmetric encryption function, and the second relationship data can map information of different lengths to a hash of fixed length. In some embodiments, the first relationship data is Message-Digest Algorithm 5 (MD5) and Secure Hash Algorithm 2 (SHA-2), or other algorithms, and the embodiments of the present application are not limited thereto. The server uses a server private key to encrypt the fourth information digest and the second installation information respectively, and obtains a server signature corresponding to the fourth information digest and encrypted information corresponding to the second installation information. The server concatenates the server signature with the encrypted information corresponding to the second installation information to obtain the second encrypted information. The server sends the second encrypted information to the electronic device. After receiving the second encrypted information, the electronic device can use the server public key to decrypt the second encrypted information to obtain the fourth information digest and the second installation information. Optionally, before the electronic device obtains the second installation information and installs the verification public key in the security chip, the electronic device can verify whether the second installation information has been tampered with based on the fourth information summary, that is, use the second relationship data to map the second installation information to a fifth information summary and compare the fifth information summary with the fourth information summary; if the fifth information summary is the same as the fourth information summary, the electronic device can determine that the second installation information has not been tampered with, the second installation information is installation information sent from the server, and install the verification public key in the second installation information in the security chip, so as to cause the security chip to encrypt information using the verification public key.
[0094] Optionally, the first installation information includes the chip public key of the security chip, and after step 402, the server can further perform the following steps:
[0095] In step 403, the server encrypts the generated verification information with the chip public key and the verification private key to obtain a first authentication code.
[0096] In one possible embodiment, the server encrypts the verification information with the chip public key to obtain a first verification code, and the server encrypts the first verification code with the verification private key to obtain a first authentication code.
[0097] For example, if the chip public key is (n 1 ,d 1 ), then the verification information z 1 For 1 ,d 1 ) to obtain the encryption formula z 1 d1 =c 1 (mod n 1 ), where c 1 is the verification information z 1 This is the first verification code after encrypting the formula z 1 d1 = c 1 (mod n 1 ) and perform form transformation on c 1 = z 1 d1 %n 1 We can obtain the verification information z 1 is 3, and n 1 =12, d 1 = 7, then c 1 =3 7 %12=3, that is, the first verification code c 1 is 3. The verification private key is (n 2 ,e 1 ), the first verification code c 1 For 2 ,e 1 ) to generate the first verification code c 1 can be encrypted, and the encryption formula is c 1 e1 =k 1 (mod n 2 ), where k1 is the first authentication code. 1 e1 = k 1 (mod n 2 ) and perform form transformation on k 1 = c 1 e1 %n 2 You can get n 2 = 55, e 1 = 17, k 1 =3 17 %55=53, which means the first authentication code is 53.
[0098] In step 404, the server sends the first authentication code to the security chip, so that the security chip uses the chip private key and the verification public key of the security chip to decrypt the first authentication code to obtain the first information.
[0099] In step 405, the server obtains a second authentication code, which is an authentication code obtained by the security chip encrypting the first information using the verification public key and the chip private key.
[0100] In one possible embodiment, the server receives third encrypted information, the third encrypted information being encrypted information obtained by the electronic device encrypting the second authentication code using the electronic device's electronic device private key, and the server decrypts the third encrypted information using the electronic device public key to obtain the second authentication code, the electronic device public key corresponding to the electronic device private key.
[0101] In step 406, the server decrypts the second authentication code using the chip public key to obtain a third verification code.
[0102] For example, if the chip public key is (n 1 ,d 1 ), the second authentication code k 2 For 1 ,d 1 ) to obtain the decoding formula k 2d1 =c 3 (mod n 1 ) to get the second authentication code k 2 can be decoded, and the formula k 2 d1 =c 3 (mod n 1 ) and perform form transformation on c 3 = k 2 d1 %n 1 The second authentication code k can be obtained. 2 = 9, n 2 =13, d 2 = 11, then c 1 =9 11 % 13=3, that is, the third verification code c 3 is 3.
[0103] In step 407, the server decrypts the third verification code using the verification private key to obtain the first information.
[0104] For example, if the verification private key is (n 2, e 1 ), the third verification code c 3 For 2 ,e 1 ) to obtain the decryption formula z 2 e1 =c 3 (mod n 2 ) to get the third verification code c 3 can be decoded to obtain the expression z 2 e1 =c 3 (mod n 2 ) and perform form transformation on c 3 = z 2 e1 %n 2 The third verification code c 3 =3, n 2 =11, d 2 = 9, then c 1 =3 9 %11=4, that is, the first information z 2 It can be obtained that is 4.
[0105] In step 408, in response to the first information in the second authentication code being the same as the verification information, the server sends verification success information of the security chip to the electronic device.
[0106] Here, the verification success information indicates that the server has determined that the key installation in the security chip is complete, and the security chip is ready for use after being shipped from the factory.
[0107] In addition to step 408, in response to the first information in the second authentication code being different from the verification information, the server sends verification failure information of the security chip to the electronic device, so that the electronic device re-performs key installation on the security chip.
[0108] All the above optional technical solutions can be arbitrarily combined to form alternative embodiments of the present application, which will not be specifically described herein.
[0109] The technical solution according to the embodiment of the present application can install the verification public key generated by the server into the security chip, so that the security chip can use the verification public key to encrypt information. In this way, the key installation process does not involve any private key transmission, so that the risk of private key leakage can be reduced and the security of information can be improved.
[0110] In order to more clearly describe the technical solution according to the embodiment of the present application, the above steps are combined to describe the interaction process between the security chip, the electronic device and the server below. Figure 5 is an interaction flowchart of the key installation method according to the embodiment of the present application. Referring to Figure 5, the method includes the following steps:
[0111] In step 501, the security chip randomly generates a chip key pair, where the chip key pair includes a chip public key and a chip private key.
[0112] Here, the number of chip key pairs generated by the security chip can be multiple.
[0113] In one possible embodiment, the security chip generates a chip public key and a chip private key using an asymmetric encryption algorithm.
[0114] For example, the security chip randomly generates two prime numbers a and b, and obtains the product n of a and b. Convert the product n to binary, and the number of bits of the binary number indicates the number of bits of the asymmetric encryption algorithm. Determine the Euler's function m = φ(n) of the product n. Randomly generate an integer e such that 1 < e < m and e is relatively prime to m. Obtain an integer d such that e * d - 1 = y * m. Finally, the generated chip public key is (n, e), and the chip private key is (n, d). It should be noted that in the process of the security chip generating e and d, there may be multiple values of e, and then multiple key pairs can be formed based on the multiple e and the multiple d generated from the multiple e.
[0115] For example, a=5, b=11 are generated by the security chip, and their product n=5*11=55 is obtained. The security chip converts the product 55 into a binary number 110111, and in some embodiments, the number of bits of the binary number is the number of bits of the encryption algorithm, in the above example, that is, the encryption algorithm is 6 bits. The security chip substitutes the product into Euler's function, and based on the formula, m=φ(55)=φ(5)φ(11)=(5-1)(11-1)=40. The security chip randomly generates an integer e, for example, 17, where 17 is relatively prime to 55 and 1<17<55. According to the equation e*d-1=y*m, the security chip substitutes e=17 and m=40 to obtain a quadratic equation where 17*d-1=y*40, and the security chip obtains a set of integer solutions to the quadratic equation whose solutions are d=33 and y=14. Then, the chip public key generated by the security chip is (55,17), and the chip private key is (55,33).
[0116] It should be noted that the above describes an example in which the security chip generates a key pair based on Euler's function, and in other possible embodiments, the security chip may also generate a key pair in other manners, and the embodiments of the present application are not limited thereto.
[0117] In step 502, the electronic device obtains the chip public key of the security chip.
[0118] Here, the chip public key may be one that the electronic device actively obtains from the security chip, or one that the security chip actively transmits to the electronic device, and the embodiments of the present application are not limited thereto.
[0119] In step 503, the electronic device maps the first installation information to a first information summary corresponding to the first installation information.
[0120] Here, the first installation information includes a chip identifier of the security chip and a device identifier of the electronic device.
[0121] In one possible embodiment, the electronic device employs first relationship data to map the first installation information to a first information digest, the first relationship data being an asymmetric encryption function, and the first relationship data can map information of different lengths to a fixed length hash. In some embodiments, the first relationship data is Message-Digest Algorithm 5 (MD5) and Secure Hash Algorithm 2 (SHA-2), or other algorithms, and embodiments of the present application are not limited thereto.
[0122] For example, if the first installation information is 6, the electronic device can process 6 using the MD5 algorithm to obtain the first information summary 5a880faf6fb5e608.
[0123] In step 504, the electronic device encrypts the first information digest and the first installation information using the electronic device private key to obtain first encrypted information.
[0124] Optionally, the first encrypted information can also be called a registration request for the security chip, which is used to request the server to register with the security chip.
[0125] In one possible embodiment, the electronic device encrypts the first information digest and the first installation information, respectively, using the electronic device private key to obtain an electronic device signature corresponding to the first information digest and encrypted information corresponding to the first installation information. In some embodiments, the electronic device signature is also referred to as a manufacturer signature. The electronic device concatenates the electronic device signature to the encrypted information corresponding to the first installation information to obtain first encrypted information. The electronic device transmits the first encrypted information to the server.
[0126] For example, if the electronic device private key is (n 4 ,e 4 ), the first installation information z 4 For 4, e 4 ) to obtain the encryption formula z 4 e4 =c 5 (mod n 4 ) for the second installation information 3 where c 5 See the first installation information 4 is the corresponding encrypted information after encryption. 4 e4 =c 5 (mod n 4 ) and perform form transformation on c 5 = z 4 e4 %n 4 Get the first installation information 4 is 4, and n 4 = 25, e 4 = 21, c 1 =4 21 %25=4, that is, the first installation information z 4 The encryption information corresponding to is 4. The electronic device uses the electronic device private key (n 4 ,e 4 ) to encrypt the 1 e4 =c 6 (mod n 4 ) First information summary 1 where c 6 is an electronic signature. 1 e4 =c 6 (mod n 4 ) and perform form transformation on c 6 = l 1 e4 %n 4 Get the first installation information 1 is 6, and n 4 = 25, e 4 = 21, then c 1 =6 21%25=6, which means that the electronic signature c 6 The number is 6. The electronic equipment is the first installation information z 4 The electronic device then concatenates the encrypted information corresponding to the first encrypted information (4,6) with the electronic device signature to obtain first encrypted information (4,6), and transmits the first encrypted information (4,6) to the server.
[0127] In step 505, the electronic device transmits the first encrypted information to the server.
[0128] In step 506, the server receives the first encrypted information, and decrypts the first encrypted information using the electronic device public key to obtain first installation information, where the electronic device public key corresponds to the electronic device private key.
[0129] In one possible embodiment, the server receives the first encrypted information, and uses the electronic device public key to decrypt the first encrypted information to obtain a second information digest and a third installation information. The server maps the third installation information to a third information digest corresponding to the third installation information. In response to the third information digest being the same as the second information digest, the server determines that the third installation information is the first installation information sent from the electronic device. Here, the process of the server comparing the second information digest with the third information digest is a process of verifying the authenticity of the third installation information.
[0130] Optionally, the server stores the chip public key included in the first installation information to facilitate decryption during subsequent information transfer processes.
[0131] In step 507, the server generates a verification key pair and verification information for verifying the security chip, where the verification key pair includes a verification public key and a verification private key.
[0132] In one possible embodiment, the server can generate a verification key pair using an asymmetric encryption algorithm. The server randomly generates verification information. For example, the server randomly generates a string and uses it as verification information. In some embodiments, the verification information is also referred to as a session key.
[0133] The following describes how the server generates a verification key pair.
[0134] For example, the server randomly generates two prime numbers c and d, and obtains the product o of c and d. The server determines the Euler's totient function m = φ(o) of the product o. Randomly generate an integer f such that 1 < f < m and f is relatively prime to m. Obtain an integer d such that f * d - 1 = y * m. Finally, the generated verification public key is (o, f), and the verification private key is (o, d). It should be noted that in the process of the server generating f and d, there may be multiple values of f. In that case, multiple key pairs can be formed based on multiple f's and multiple d's generated from multiple f's.
[0135] For example, c = 5 and d = 11 are generated by the server, and their product o = 5 * 11 = 55 is obtained. The server converts the product 55 into the binary number 110111. In some embodiments, the number of bits of the binary number is the number of bits of the encryption algorithm. In the above example, that is, the number of bits of the encryption algorithm is 6 bits. The server substitutes the product into the Euler's totient function, and based on the formula, m = φ(55) = φ(5)φ(11) = (5 - 1)(11 - 1) = 40. The server randomly generates an integer f, for example, generates 17, and 17 is relatively prime to 55 and 1 < 17 < 55. The server substitutes f = 17 and m = 40 into the formula f * d - 1 = y * m to obtain a quadratic equation 17 * d - 1 = y * 40. The server obtains a set of integer solutions of the quadratic equation where the solution is d = 33 and y = 14. Then, the verification public key generated by the server is (55, 17), and the verification private key is (55, 33).
[0136] It should be noted that the above describes an example in which the server generates a key pair based on Euler's function, and in other possible embodiments, the server may generate a key pair in other manners, and the embodiments of the present application are not limited thereto.
[0137] In step 508, the server encrypts the generated verification information with the chip public key and the verification private key to obtain a first authentication code.
[0138] In one possible embodiment, the server encrypts the verification information with the chip public key to obtain a first verification code, and the server encrypts the first verification code with the verification private key to obtain a first authentication code.
[0139] For example, if the chip public key is (n 1 ,d 1 ), then the verification information z 1 For 1 ,d 1 ) to obtain the encryption formula z 1 d1 =c 1 (mod n 1 ), where c 1 is the verification information z 1 This is the first verification code after encrypting the formula z 1 d1 = c 1 (mod n 1 ) and perform form transformation on c 1 = z 1 d1 %n 1 We can obtain the verification information z 1 is 3, and n 1 =12, d 1 = 7, then c 1 =3 7 %12=3, that is, the first verification code c 1 is 3. The verification private key is (n 2 ,e 1 ), the first verification code c1 For 2 ,e 1 ) to generate the first verification code c 1 can be encrypted, and the encryption formula is c 1 e1 =k 1 (mod n 2 ), where k 1 is the first authentication code. 1 e1 = k 1 (mod n 2 ) and perform form transformation on k 1 = c 1 e1 %n 2 You can get n 2 = 55, e 1 = 17, k 1 =3 17 %55=53, which means the first authentication code is 53.
[0140] In step 509, the server sends second installation information to the electronic device, where the second installation information includes the first authentication code generated by the server.
[0141] In one possible embodiment, the server encrypts the second installation information with a server private key to obtain second encrypted information, which in some embodiments is also referred to as a server signature.
[0142] For example, the server maps the second installation information to a fourth information digest of the second installation information, and the server encrypts the fourth information digest and the second installation information with a server private key to obtain second encrypted information.
[0143] In step 510, the electronic device obtains second installation information.
[0144] In one possible embodiment, the electronic device decrypts the second encrypted information using a server public key to obtain second installation information, where the server public key corresponds to the server private key.
[0145] For example, the electronic device receives the second encrypted information and decrypts the second encrypted information using the server public key to obtain a fifth information digest and a fourth installation information. The electronic device maps the fourth installation information to a sixth information digest corresponding to the fourth installation information. In response to the sixth information digest being the same as the fourth information digest, the electronic device determines that the fourth installation information is the second installation information sent from the server.
[0146] In step 511, the electronic device installs a verification public key in the security chip, the public key is used to encrypt information, and the verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0147] Here, the process in which the electronic device installs the verification public key in the security chip can be referred to as writing the verification public key to the security chip.
[0148] In step 512, the electronic device sends the first authentication code to the security chip.
[0149] Alternatively, the electronic device may also send a first authentication code to the security chip while installing the verification public key, and the embodiments of the present application are not limited thereto.
[0150] In step 513, the security chip receives the first authentication code and the verification public key.
[0151] In step 514, the security chip decrypts the first authentication code using the chip private key and the verification public key of the security chip to obtain the first information.
[0152] In one possible embodiment, the security chip uses the verification public key to decrypt the first authentication code to obtain a second verification code, and the security chip uses the chip private key to decrypt the second verification code to obtain the first information.
[0153] For example, if the verification public key is (n 2 ,d 2 ), the first authentication code k 1 For, the security chip has a verification public key (n 2 ,d 2 ) to obtain the decoding formula k 1 d2 =c 2 (mod n 2 ) to get the first authentication code k 1 can be decoded, and the formula c 2 d2 =k(mod n 2 ) and perform form transformation on c 2 = k 1 d2 %n 2 The first authentication code k can be obtained. 1 =53, n 2 =55, d 2 = 33, and c 1 =53 33 %55=3, that is, the second verification code c 2 is 3. Compared to the previous example, the verification public key (n 2 ,d 2 ) is the chip public key (n 2 ,e 1 ), the obtained second verification code c 2 is the first verification code c generated by the server 1 The same as when the chip private key is (n 1 ,e 2 ), the security chip will decrypt the 2 e2 = z 2 (mod n 1 ) to generate the first verification code c 2 Decrypt the first information z 2 Of course, the chip private key (n1 ,e 2 ) is the verification private key (n 1 ,d 1 ), the first information z obtained by decoding 2 is the validation information generated by the server z 1 is also the same.
[0154] In step 515, the security chip encrypts the first information using the verification public key and the chip private key to obtain a second authentication code.
[0155] In one possible embodiment, the security chip encrypts the first information with the verification public key to obtain a third verification code, and the security chip encrypts the third verification code with the chip private key to obtain a second authentication code.
[0156] For example, if the verification public key is (n 2 ,d 2 ), the first information z 2 For, the security chip has a verification public key (n 2 ,d 2 ) to obtain the encryption formula z 2 d2 =c 3 (mod n 2 ), where c 3 is the first information z 2 This is the third verification code after encrypting the formula z 2 d2 =c 3 (mod n 2 ) and perform form transformation on c 3 = z 2 d2 %n 2 The first information z 2 is 4, and n 2 = 15, d 2 = 11, then c 3 =4 11 %15=4, that is, the third verification code c 3 is 4. The chip private key is (n 1 ,e 2), the third verification code c 3 For, the security chip is a chip private key (n 1 ,e 2 ) to generate the third verification code c 3 can be encrypted, and the encryption formula is c 3 e2 =k 2 (mod n 1 ), where k 2 is the second authentication code. 3 e2 =k 2 (mod n 1 ) and perform form transformation on k 2 = c 3 e2 %n 1 You can get n 1 = 55, e 2 = 33, k 2 =4 33 %55=9, which means the second authentication code is 9.
[0157] In step 516, the security chip transmits a second authentication code to the electronic device.
[0158] In step 517, the electronic device encrypts the second authentication code using the electronic device's private key to obtain third encrypted information.
[0159] For example, if the electronic device private key is (n 4 ,e 4 ), the second authentication code k 2 For 4 ,e 4 ) to obtain the encryption formula z 5 e4 = k 2 (mod n 4 ) to get the second authentication code k 2 where z 5 is the third encrypted information. 5 e4 = k 2 (mod n 4) and perform form transformation on k 2 = z 5 e4 %n 4 You can get the first installation information. 2 is 9, and n 4 = 25, e 4 = 21, then c 1 =9 21 %25=4, that is, the third encryption information is 9.
[0160] In step 518, the electronic device transmits the third encrypted information to the server.
[0161] Here, the third encrypted information is also called a security chip start request and is used to request the server to start the security chip.
[0162] In step 519, the server receives the third encrypted information.
[0163] In step 520, the server decrypts the third encrypted information using the electronic device public key to obtain a second authentication code.
[0164] For example, if the electronic device public key is (n 4 ,d 4 ), the third encrypted information z 5 For 4 ,d 4 ) to obtain the decoding formula k 2 d4 = z 5 (mod n 4 ) to generate the third encrypted information z 5 can be decoded, and the formula k 2 d4 = z 5 (mod n 4 ) and perform form transformation on z 5 = k 2 d4 %n 4 The third encrypted information z 5 = 9, n 2=55, d 2 = 21, z 5 =9 21 %55=9, and the second authentication code z 5 It can be obtained that is 9.
[0165] In step 521, the server decrypts the second authentication code using the chip public key to obtain a third verification code.
[0166] For example, if the chip public key is (n 1 ,d 1 ), the second authentication code k 2 For 1 ,d 1 ) to obtain the decoding formula k 2 d1 =c 3 (mod n 1 ) to get the second authentication code k 2 can be decoded, and the formula k 2 d1 =c 3 (mod n 1 ) and perform form transformation on c 3 = k 2 d1 %n 1 The second authentication code k can be obtained. 2 = 9, n 2 =13, d 2 = 11, then c 1 =9 11 %13=3, that is, the third verification code c 3 It can be obtained that is 3.
[0167] In step 522, the server decrypts the third verification code using the verification private key to obtain the first information.
[0168] For example, if the verification private key is (n 2 ,e 1 ), the third verification code c 3 For 2 ,e 1 ) to obtain the decryption formula z2 e1 =c 3 (mod n 2 ) to get the third verification code c 3 can be decoded to obtain the expression z 2 e1 =c 3 (mod n 2 ) and perform form transformation on c 3 = z 2 e1 %n 2 The third verification code c 3 =3, n 2 =11, d 2 = 9, then c 1 =3 9 %11=4, that is, the first information z 2 It can be obtained that is 4.
[0169] In step 523, the server responds that the first information in the second authentication code is the same as the verification information by sending verification success information of the security chip to the electronic device.
[0170] After receiving the successful verification information of the security chip, the electronic device completes the installation process for the security chip, and the security chip can be used normally.
[0171] That is, in a scenario of customizing a stored value card, after the electronic device receives the successful verification information of the security chip, the manufacturer of the security chip can ship the installed security chip from the factory, for example, send the security chip to the manufacturer that produced the stored value card, and the manufacturer that produced the stored value card installs the security chip in the stored value card. In the process of using the stored value card by a user, if there is a device that reads the information in the stored value card, the security chip can encrypt the information to avoid the information leakage of the stored value card. When the server writes information to the stored value card, the written information also needs to be decrypted by the security chip to ensure the security of writing the information.
[0172] In a data encryption scenario, after the electronic device receives the verification success information of the security chip, the manufacturer of the security chip can ship the installed security chip from the factory, for example, send the security chip to the device manufacturer, and have the security chip installed in the device by the device manufacturer. When a user uses a specific communication application to talk to the outside world, the security chip can encrypt the information sent by the user to avoid information leakage. When obtaining the reply information sent from the server, the reply information needs to be decrypted by the security chip to ensure the security of writing information.
[0173] In addition to step 523, in response to the first information in the second authentication code being different from the verification information, the server sends verification failure information of the security chip to the electronic device, so that the electronic device re-performs key installation on the security chip.
[0174] In one possible embodiment, in response to the first information in the second authentication code being different from the verification information, the electronic device can initialize the security chip and delete the data stored in the security chip. The above steps 501 to 511 are repeatedly performed to complete the reinstallation to the security chip.
[0175] All the above optional technical solutions can be arbitrarily combined to form alternative embodiments of the present application, which will not be specifically described herein.
[0176] The technical solution according to the embodiment of the present application can install the verification public key generated by the server into the security chip, so that the security chip can use the verification public key to encrypt information. In this way, the key installation process does not involve any private key transmission, so that the risk of private key leakage can be reduced and the security of information can be improved.
[0177] Besides, an embodiment of the present application further provides a key installation system, referring to FIG. 6 , the system includes a security chip 601 , an electronic device 602 and a server 603 .
[0178] The electronic device 602 is configured to send first installation information to the server 603, where the first installation information is used to indicate installation authority for the security chip 601 of the electronic device 602.
[0179] The server 603 is used to receive first installation information, and if it determines based on the first installation information that the electronic device 602 has installation authority for the security chip 601, it sends second installation information to the electronic device 602, where the second installation information includes a verification public key generated by the server 603.
[0180] The electronic device 602 is further configured to receive second installation information and install a verification public key in the security chip 601, where the verification public key is used to encrypt information, and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0181] In one possible embodiment, the electronic device 602 is further configured to encrypt the first installation information using the electronic device's 602 private key to obtain first encrypted information, and transmit the first encrypted information to the server 603.
[0182] The server 603 is further configured to receive the first encrypted information, and decrypt the first encrypted information using the electronic device public key to obtain the first installation information, where the electronic device public key corresponds to the electronic device private key.
[0183] In one possible embodiment, the electronic device 602 is further configured to map the first installation information to a first information summary corresponding to the first installation information.
[0184] The electronic device 602 is further configured to encrypt the first information digest and the first installation information using the electronic device private key to obtain first encrypted information.
[0185] The server 603 is further configured to receive the first encrypted information and decrypt the first encrypted information using the electronic device public key to obtain the second information digest and the third installation information.
[0186] The server 603 is further configured to map the third installation information to a third information summary corresponding to the third installation information.
[0187] The server 603 is further configured to determine, in response to the third information summary being the same as the second information summary, that the third installation information is the first installation information obtained by the electronic device 602 .
[0188] In one possible embodiment, the first installation information includes a chip public key of the security chip 601 , and the second installation information includes a first authentication code generated by the server 603 .
[0189] The server 603 is further configured to encrypt the generated verification information using the chip public key and the verification private key to obtain a first authentication code.
[0190] The electronic device 602 is further configured to send the first authentication code and the verification public key to the security chip 601 .
[0191] The security chip 601 is configured to receive a first authentication code and a verification public key.
[0192] The security chip 601 is further configured to decrypt the first authentication code using the chip private key and the verification public key of the security chip 601 to obtain the first information.
[0193] The security chip 601 is further configured to encrypt the first information using the verification public key and the chip private key to obtain a second authentication code.
[0194] The server 603 is further configured to obtain the second authentication code, and decrypt the second authentication code using the verification private key and the chip public key to obtain the first information.
[0195] The server 603 is further configured to send verification success information of the security chip 601 to the electronic device 602 in response to the first information in the second authentication code being the same as the verification information.
[0196] In one possible embodiment, the server 603 further comprises: Encrypt the verification information using a chip public key to obtain a first verification code; The first verification code is then encrypted using the verification private key to obtain a first authentication code.
[0197] In one possible embodiment, the security chip 601 further comprises: decrypting the first authentication code using the verification public key to obtain a second verification code; The chip is configured to decrypt the second verification code using the private key to obtain the first information.
[0198] In one possible embodiment, the security chip 601 is further configured to randomly generate a chip key pair, where the chip key pair includes a chip public key and a chip private key.
[0199] In one possible embodiment, the security chip 601 further comprises: encrypting the first information using the verification public key to obtain a third verification code; The chip is configured to encrypt the third verification code with a private key to obtain a second authentication code.
[0200] In one possible embodiment, the electronic device 602 further comprises: encrypting the second authentication code using the electronic device private key of the electronic device 602 to obtain third encrypted information; The third encrypted information is configured to be transmitted to the server 603 .
[0201] The server 603 further receiving the third encrypted information; decrypting the third encrypted information using the electronic device public key to obtain a second authentication code; Decrypt the second authentication code using the chip public key to obtain a third verification code; The third verification code is decrypted using the verification private key to obtain the first information.
[0202] In one possible embodiment, the server 603 is further configured to encrypt the second installation information with a server private key of the server 603 to obtain second encrypted information.
[0203] The electronic device 602 is further configured to decrypt the second encrypted information using a server public key, which corresponds to the server private key, to obtain second installation information.
[0204] In one possible embodiment, the server 603 is further configured to map the second installation information to a fourth information summary of the second installation information.
[0205] Server 603 is further configured to encrypt the fourth information digest and the second installation information using a server private key to obtain second encrypted information.
[0206] The electronic device 602 is further configured to receive the second encrypted information and decrypt the second encrypted information using the server public key to obtain the fifth information digest and the fourth installation information.
[0207] The electronic device 602 is further configured to map the fourth installation information to a sixth information summary that corresponds to the fourth installation information.
[0208] The electronic device 602 is further configured to determine, in response to the sixth information summary being the same as the fourth information summary, that the fourth installation information is the second installation information sent from the server 603.
[0209] In one possible embodiment, the security chip 601 is further configured to encrypt transmission information using the chip private key of the security chip to obtain first encrypted transmission information, encrypt the first encrypted transmission information using the verification public key to obtain second encrypted transmission information, and transmit the second encrypted transmission information to the server.
[0210] It should be noted that the key installation system and the key installation method according to the above embodiment belong to the same concept, and the specific implementation process thereof may be referred to the method embodiment, and will not be described repeatedly here.
[0211] The technical solution according to the embodiment of the present application can install the verification public key generated by the server into the security chip, so that the security chip can use the verification public key to encrypt information. In this way, the key installation process does not involve any private key transmission, so that the risk of private key leakage can be reduced and the security of information can be improved.
[0212] FIG. 7 is an exemplary structural diagram of a key installation device according to an embodiment of the present application. Referring to FIG. 7, the device includes: a first sending module 701, a first obtaining module 702 and an installing module 703.
[0213] The first sending module 701 is configured to send first installation information to a server, where the first installation information is used to indicate the installation authority of the electronic device to the security chip.
[0214] The first acquisition module 702 is configured to acquire second installation information, where the second installation information includes a verification public key generated by the server, and the second installation information is installation information sent by the server to the electronic device when it determines that the electronic device has installation authority for the security chip based on the first installation information.
[0215] The installation module 703 is configured to install a verification public key in the security chip, where the verification public key is used to encrypt information, and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0216] In one possible embodiment, the first transmission module 701 is configured to encrypt the first installation information using the electronic device private key of the electronic device, obtain first encrypted information, and transmit the first encrypted information to the server.
[0217] In one possible embodiment, the first sending module 701 is configured to map the first installation information to a first information digest corresponding to the first installation information, and encrypt the first information digest and the first installation information using the electronic device private key to obtain first encrypted information.
[0218] In one possible embodiment, the first acquisition module 702 is configured to acquire second encrypted information sent from the server, the second encrypted information being obtained by the server encrypting the second installation information using the server's server private key, and decrypting the second encrypted information using a server public key to obtain the second installation information, where the server public key corresponds to the server private key.
[0219] It should be noted that the above embodiment of the key installation device only takes the division of the above functional modules as an example when installing a key, but in actual application, the above functions can be assigned and completed by different functional modules as needed, that is, the internal structure of the electronic device can be divided into different functional modules to complete all or part of the above functions. Furthermore, the above embodiment of the key installation device belongs to the same concept as the embodiment of the key installation method, and its specific implementation process is referred to the embodiment of the method and will not be repeated here.
[0220] The technical solution according to the embodiment of the present application can install the verification public key generated by the server into the security chip, so that the security chip can use the verification public key to encrypt information. In this way, the key installation process does not involve any private key transmission, so that the risk of private key leakage can be reduced and the security of information can be improved.
[0221] FIG. 8 is an exemplary structural diagram of a key installation device according to an embodiment of the present application. Referring to FIG. 8, the device includes: a second obtaining module 801 and a second sending module 802 .
[0222] The second obtaining module 801 is configured to obtain first installation information sent from the electronic device, where the first installation information is used to indicate the installation authority of the electronic device to the security chip.
[0223] The second sending module 802 is configured to send second installation information to the electronic device in response to the electronic device having installation authority for the security chip, the second installation information including a verification public key generated by the server, so that the electronic device installs the verification public key in the security chip, the verification public key is used to encrypt information, and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0224] In one possible embodiment, the second acquisition module 801 is configured to acquire first encrypted information sent from the electronic device, the first encrypted information being obtained by the electronic device encrypting the first installation information using the electronic device's electronic device private key, and decrypting the first encrypted information using the electronic device public key to obtain the first installation information, where the electronic device public key corresponds to the electronic device private key.
[0225] In one possible embodiment, the first installation information includes a chip public key of the security chip, and the apparatus further includes a first encryption module and a fourth sending module.
[0226] The first encryption module is configured to use the chip public key and the verification private key to encrypt the generated verification information to obtain a first authentication code.
[0227] The second sending module 802 is further configured to send the first authentication code to the security chip, so that the security chip uses the chip private key and the verification public key of the security chip to decrypt the first authentication code to obtain the first information.
[0228] The second obtaining module 801 is further configured to obtain a second authentication code, where the second authentication code is an authentication code obtained by the security chip encrypting the first information using the verification public key and the chip private key.
[0229] The fourth sending module is configured to send verification success information of the security chip to the electronic device in response to the first information in the second authentication code being the same as the verification information.
[0230] In one possible embodiment, the first encryption module is configured to encrypt the verification information using the chip public key to obtain a first verification code, and to encrypt the first verification code using the verification private key to obtain a first authentication code.
[0231] In one possible embodiment, the third acquisition module is configured to receive third encrypted information, the third encrypted information being encrypted information obtained by the electronic device encrypting the second authentication code using the electronic device's electronic device private key, and to decrypt the third encrypted information using the electronic device public key to obtain the second authentication code, where the electronic device public key corresponds to the electronic device private key.
[0232] In one possible embodiment, the device further comprises: a first decryption module configured to decrypt the second authentication code using the chip public key to obtain a third verification code; and a second decryption module configured to decrypt the third verification code using the verification private key to obtain the first information.
[0233] In one possible embodiment, the device further comprises a fourth transmitting module.
[0234] The fourth sending module is configured to send verification failure information of the security chip to the electronic device in response to the first information in the second authentication code being different from the verification information, so that the electronic device re-performs key installation on the security chip.
[0235] In one possible embodiment, the second transmission module 802 is configured to encrypt the second installation information using the server's server private key to obtain second encrypted information, and transmit the second encrypted information to the electronic device.
[0236] In one possible embodiment, the second sending module 802 is configured to map the second installation information to a fourth information digest corresponding to the second installation information, and encrypt the fourth information digest and the second installation information using a server private key to obtain second encrypted information.
[0237] It should be noted that the above embodiment of the key installation device only takes the division of the above functional modules as an example when installing a key, but in actual application, the above functions can be assigned and completed by different functional modules as needed, that is, the internal structure of the server can be divided into different functional modules to complete all or part of the above functions. Furthermore, the above embodiment of the key installation device belongs to the same concept as the embodiment of the key installation method, and its specific implementation process is referred to the embodiment of the method, and will not be repeated here.
[0238] The technical solution according to the embodiment of the present application can install the verification public key generated by the server into the security chip, so that the security chip can use the verification public key to encrypt information. In this way, the key installation process does not involve any private key transmission, so that the risk of private key leakage can be reduced and the security of information can be improved.
[0239] FIG. 9 is an exemplary structural diagram of a key installation device according to an embodiment of the present application. Referring to FIG. 9, the device includes: a third obtaining module 901 and a transmission information encrypting module 902 .
[0240] The third acquisition module 901 is configured to acquire a verification public key installed in the security chip by the electronic device, where the verification public key is generated by a server, the verification public key is used to encrypt information, and the verification private key corresponding to the verification public key is used to decrypt the encrypted information.
[0241] The transmission encryption module 902 is configured to encrypt the transmission using the verification public key.
[0242] In one possible embodiment, the transmission encryption module 902 uses a chip private key to encrypt the transmission to obtain a first encrypted transmission; The first encrypted transmission is encrypted using the verification public key to obtain a second encrypted transmission.
[0243] In one possible embodiment, the apparatus further comprises a third decryption module, a second encryption module, and a third transmission module.
[0244] The third decryption module is configured to obtain a first authentication code, the first authentication code being obtained by the server encrypting verification information using the chip public key and the verification private key, and to decrypt the first authentication code using the chip private key and the verification public key to obtain first information.
[0245] The second encryption module is configured to encrypt the first information using the verification public key and the chip private key to obtain a second authentication code.
[0246] The third sending module is configured to send the second authentication code to the server, so that the server verifies the security chip according to the first information and the verification information in the second authentication code.
[0247] In one possible embodiment, the apparatus further comprises a generating module.
[0248] The generation module is configured to randomly generate a chip key pair, where the chip key pair includes a chip public key and a chip private key.
[0249] In one possible embodiment, the third decryption module is configured to decrypt the first authentication code using the verification public key to obtain a second verification code, and to decrypt the second verification code using the chip private key to obtain the first information.
[0250] In one possible embodiment, the second encryption module is configured to encrypt the first information using the verification public key to obtain a third verification code, and to encrypt the third verification code using the chip private key to obtain a second authentication code.
[0251] In one possible embodiment, the transmission information encryption module 902 is configured to encrypt the transmission information using the chip private key of the security chip to obtain first encrypted transmission information, encrypt the first encrypted transmission information using the verification public key to obtain second encrypted transmission information, and transmit the second encrypted transmission information to the server.
[0252] It should be noted that the above embodiment of the key installation device only takes the division of each of the above functional modules as an example when installing a key, but in actual application, the above functions can be assigned and completed by different functional modules as needed, that is, the internal structure of the security chip can be divided into different functional modules to complete all or part of the above functions. Furthermore, the above embodiment of the key installation device belongs to the same concept as the embodiment of the key installation method, and its specific implementation process is referred to the embodiment of the method, and will not be repeated here.
[0253] The technical solution according to the embodiment of the present application can install the verification public key generated by the server into the security chip, so that the security chip can use the verification public key to encrypt information. In this way, the key installation process does not involve any private key transmission, so that the risk of private key leakage can be reduced and the security of information can be improved.
[0254] 10 is an exemplary structural diagram of an electronic device according to an embodiment of the present application. The electronic device 1000 may be a smartphone, a tablet computer, a notebook computer or a desktop computer. The electronic device 1000 may also be called a user device, a portable electronic device, a laptop electronic device, a desktop electronic device, or other names.
[0255] Generally, the electronic device 1000 includes one or more processors 1001 and one or more memories 1002 .
[0256] The processor 1001 may include one or more processing cores, such as a 4-core processor or an 8-core processor. The processor 1001 may be implemented using at least one of the following hardware forms: a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1001 may also include a main processor and a secondary processor, where the main processor is a processor used to process data in an awake state, also referred to as a central processing unit (CPU), and the secondary processor is a low-power processor used to process data in a standby state.
[0257] The memory 1002 may include one or more computer readable storage media, which are non-transitory. The memory 1002 may also comprise one or more of magnetic disk memories, high speed random access memories, such as flash memories, and non-volatile memories. In some embodiments, the non-transitory computer readable storage media in the memory 1002 is configured to store at least one computer program, which is executed by the processor 1001 to implement a key installation method according to a method embodiment of the present application.
[0258] It will be apparent to one skilled in the art that the structure shown in FIG. 10 does not constitute a limitation on electronic device 1000 and that electronic device 1000 may include more or fewer components than shown, or may combine some components, or use different component arrangements.
[0259] 11 is an exemplary structural diagram of a server according to an embodiment of the present application, the server 1100 may vary greatly depending on different configurations or performances, and may include one or more processors (CPUs: Central Processing Units) 1101 and one or more memories 1102, where the one or more memories 1102 store at least one computer program, which is loaded and executed by the one or more processors 1101 to realize the method according to each of the above method embodiments. Of course, the server 1100 may further include components such as a wired or wireless network interface, a keyboard, and an input / output interface to facilitate input / output, and the server 1100 may further include other components to realize the functions of the device, which will not be described in detail here.
[0260] In an exemplary embodiment, a computer-readable storage medium, such as a memory containing a computer program, is further provided, which can be executed by a processor to realize the key installation method in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a read-only memory (CD-ROM: Compact Disc Read-Only Memory), a magnetic disk, a floppy disk, an optical data storage device, etc.
[0261] In an exemplary embodiment, there is further provided a computer program product or computer program, the computer program product or computer program including program code, the program code being stored in a computer readable storage medium, the processor of a computing device reading the program code from the computer readable storage medium, and the processor executing the program code to cause the computing device to perform the above key installation method.
[0262] It is obvious to those skilled in the art that all or part of the steps in the above embodiments may be completed through hardware, or may be completed by instructing relevant hardware by a program. The program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk, or an optical disk.
[0263] The above are merely alternative embodiments of the present application, and do not limit the present application, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application should all be included in the protection scope of the present application.
Claims
1. 1. A key installation method implemented by an electronic device, comprising: Sending first installation information to a server, the first installation information being used to indicate an installation authority of the electronic device to the security chip; acquiring second installation information, the second installation information including a verification public key generated by the server, the second installation information being installation information sent by the server to the electronic device when the server determines that the electronic device has an installation right for the security chip based on the first installation information; and a step of installing the verification public key in the security chip, wherein the verification public key is used to encrypt information, and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
2. The step of transmitting first installation information to the server includes: encrypting the first installation information using an electronic device private key to obtain first encrypted information; and transmitting the first encrypted information to the server.
3. The step of encrypting the first installation information using an electronic device private key of the electronic device to obtain first encrypted information includes: mapping the first installation information to a first information summary corresponding to the first installation information; 3. The method of claim 2, further comprising the step of: encrypting the first information digest and the first installation information with the electronic device private key to obtain the first encrypted information.
4. The step of acquiring second installation information includes: acquiring second encrypted information transmitted from the server, the second encrypted information being obtained by the server encrypting the second installation information using a server private key; 2. The method of claim 1, further comprising: decrypting the second encrypted information with a server public key to obtain the second installation information, the server public key corresponding to the server private key.
5. 1. A server-implemented key installation method, comprising: obtaining first installation information sent from the electronic device, the first installation information being used to indicate an installation authority of the electronic device to a security chip; a step of sending second installation information to the electronic device in response to the electronic device having installation authority for the security chip, the second installation information including a verification public key generated by the server so that the electronic device installs the verification public key in the security chip, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information.
6. The step of acquiring the first installation information transmitted from the electronic device includes: a step of acquiring first encrypted information transmitted from the electronic device, the first encrypted information being obtained by the electronic device encrypting the first installation information using an electronic device private key; 6. The method of claim 5, further comprising: decrypting the first encrypted information using an electronic device public key to obtain the first installation information, the electronic device public key corresponding to the electronic device private key.
7. The first installation information includes a chip public key of the security chip, and the key installation method includes: encrypting the generated verification information using the chip public key and the verification private key to obtain a first authentication code; sending the first authentication code to the security chip, so that the security chip uses a chip private key and the verification public key to decrypt the first authentication code to obtain first information; obtaining a second authentication code, the second authentication code being an authentication code obtained by the security chip encrypting the first information using the verification public key and the chip private key; The key installation method of claim 5 , further comprising: in response to the first information in the second authentication code being the same as the verification information, sending verification success information of the security chip to the electronic device.
8. The step of encrypting the generated verification information using the chip public key and the verification private key to obtain a first authentication code includes: encrypting the verification information with the chip public key to obtain a first verification code; and c) encrypting the first verification code with the verification private key to obtain the first authentication code.
9. The step of obtaining the second authentication code includes: receiving third encrypted information, the third encrypted information being encrypted information obtained by the electronic device encrypting the second authentication code using an electronic device private key of the electronic device; 8. The method of claim 7, further comprising: decrypting the third encrypted information using an electronic device public key to obtain the second authentication code, the electronic device public key corresponding to the electronic device private key.
10. In response to the first information in the second authentication code being the same as the verification information, before transmitting verification success information of the security chip to the electronic device, the key installation method further comprises: decrypting the second authentication code using the chip public key to obtain a third verification code; 8. The method of claim 7, further comprising the step of: decrypting the third verification code with the verification private key to obtain the first information.
11. The key installation method includes:
8. The key installation method of claim 7, further comprising the step of: in response to the first information in the second authentication code being different from the verification information, sending verification failure information of the security chip to the electronic device so that the electronic device re-performs key installation on the security chip.
12. The step of transmitting second installation information to the electronic device includes: mapping the second installation information to a fourth information summary corresponding to the second installation information; encrypting the fourth information digest and the second installation information using a server private key to obtain second encrypted information; and transmitting the second encrypted information to the electronic device.
13. A key installation method performed by a security chip, comprising: obtaining a verification public key installed in the security chip by an electronic device, the verification public key being generated by a server, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information; obtaining a first authentication code, the first authentication code being obtained by the server encrypting verification information using a chip public key and the verification private key; decrypting the first authentication code using a chip private key and the verification public key to obtain first information; encrypting the first information using the verification public key and the chip private key to obtain a second authentication code; sending the second authentication code to the server, so that the server verifies the security chip according to the first information and the verification information in the second authentication code; A key installation method including:
14. Prior to obtaining the first authentication code, the key installation method further comprises:
14. The key installation method of claim 13, further comprising: randomly generating a chip key pair, the chip key pair including the chip public key and the chip private key.
15. Decrypting the first authentication code using the chip private key and the verification public key to obtain first information, decrypting the first authentication code using the verification public key to obtain a second verification code; and decrypting the second verification code with the chip private key to obtain the first information.
16. The step of encrypting the first information using the verification public key and the chip private key to obtain a second authentication code includes: encrypting the first information using the verification public key to obtain a third verification code; and encrypting the third verification code with the chip private key to obtain the second authentication code.
17. A key installation system comprising a security chip, an electronic device and a server, The electronic device is configured to send first installation information to the server, the first installation information being used to indicate an installation authority for the security chip of the electronic device; The server is configured to receive the first installation information, and when determining that the electronic device has an installation authority for the security chip based on the first installation information, to send second installation information to the electronic device, the second installation information including a verification public key generated by the server; The electronic device is further configured to receive the second installation information and install the verification public key in the security chip, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information.
18. 1. A key installation device, comprising: A first transmitting module configured to transmit first installation information to a server, the first installation information being used to indicate an installation authority of an electronic device to a security chip; A first acquisition module configured to acquire second installation information, the second installation information including a verification public key generated by the server, the second installation information being installation information sent by the server to the electronic device when the server determines that the electronic device has an installation right for the security chip based on the first installation information; and an installation module configured to install the verification public key into the security chip, wherein the verification public key is used to encrypt information and a verification private key corresponding to the verification public key is used to decrypt the encrypted information.
19. 1. A key installation device, comprising: A second acquisition module configured to acquire first installation information sent from the electronic device, the first installation information being used to indicate the installation authority of the electronic device to a security chip; a second sending module configured to send second installation information to the electronic device in response to the electronic device having installation authority for the security chip, the second installation information including a verification public key generated by a server, such that the electronic device installs the verification public key in the security chip, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information.
20. 1. A key installation device, comprising: A third acquisition module configured to acquire a verification public key installed in a security chip by an electronic device, the verification public key being generated by a server, the verification public key being used to encrypt information, and a verification private key corresponding to the verification public key being used to decrypt the encrypted information; A transmission information encryption module, Obtaining a first authentication code, the first authentication code being obtained by the server encrypting verification information using a chip public key and the verification private key; decrypting the first authentication code using a chip private key and the verification public key to obtain first information; encrypting the first information using the verification public key and the chip private key to obtain a second authentication code; sending the second authentication code to the server, so that the server verifies the security chip according to the first information and the verification information in the second authentication code; A transmission information encryption module configured to perform the above-mentioned steps. A key installation device comprising:
21. 5. A computing device comprising one or more processors and one or more memories, the one or more memories storing at least one computer program, the one or more processors loading and executing the computer program to implement the key installation method of any one of claims 1 to 4.
22. A computer device comprising one or more processors and one or more memories, wherein the one or more memories store at least one computer program, and the one or more processors load and execute the computer program to realize a key installation method according to any one of claims 5 to 12.
23. A computing device comprising one or more processors and one or more memories, wherein the one or more memories store at least one computer program, and the one or more processors load and execute the computer program to realize the key installation method of any one of claims 13 to 16.
24. A computer program product for causing a computer to implement the key installation method according to any one of claims 1 to 4.
25. A computer program that causes a computer to realize the key installation method described in any one of claims 5 to 12.
26. A computer program that causes a computer to realize the key installation method described in any one of claims 13 to 16.
Citation Information
Patent Citations
Hardware security module, method of updating integrity check value stored in hardware security module, and method of updating program stored in terminal by using hardware security module
US20160232381A1
