Key charging method
Through the combination of triple verification and encryption algorithms between the quantum cryptographic service platform and the charging terminal, the problems of identity uncertainty and leakage risk in key charging in the existing technology are solved, and a higher level of key charging is achieved. Security and flexibility ensure the traceability and system stability of quantum key distribution.
Patent Information
- Application Number
- CN202410789876.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-10
AI Technical Summary
Existing quantum key filling methods fail to effectively limit the identity of the filling person, leading to the risk of key leakage and distribution record tracking difficulties, which may lead to service interruption or system instability.
By pre-entering the depositor ID on the quantum cryptographic server platform and conducting triple verification between the filling terminal and the management medium, including signature public and private key verification and timestamp verification, the identity authentication of the depositor is ensured, and the encryption key is generated and issued. Key, use SM2 and SM3 algorithms to encrypt key transmission, and combine symmetric and asymmetric cryptographic algorithms to improve security.
It effectively limits the identity of the person or device for key filling, reduces the risk of key tampering or theft, improves the security and flexibility of key filling, ensures the tracking and auditing of quantum key distribution, and avoids service interruption and system instability.
Smart Images

Figure CN118631440A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum keys, and in particular to a key filling method. Background Art
[0002] Quantum keys have true random characteristics and are increasingly used in confidential communication scenarios. For example. By injecting quantum keys into storage devices and then installing the storage devices into terminals, quantum keys can be used to protect terminal data. The quantum key injection methods disclosed in the prior art do not limit the identity of the injector. Any person or device can access the quantum secret service platform to obtain quantum keys and inject them into storage devices. There is a risk of key leakage, and it is difficult to track quantum key distribution records. In particular, attackers may perform key injection operations incorrectly, resulting in service interruption or system instability. Summary of the invention
[0003] To at least partially solve the above problems, the present invention provides a key injection method.
[0004] The key charging method provided by the present invention includes a charging terminal and a quantum secret service platform, wherein the charging terminal is at least connected to a user medium, and the method includes: the quantum secret service platform pre-enters the charge operator ID, and the charging terminal carries the charge operator ID to apply for charge operator authentication to the quantum secret service platform; if the charge operator authentication is passed, the quantum secret service platform issues the charging key in response to the charging key application sent by the charging terminal, and the charging key is written into the user medium.
[0005] Furthermore, before applying for filler certification, the filling terminal is also connected to a management medium, which generates an SM2 signature public-private key pair, in which the signature public key is entered into the quantum secret service platform; when applying for filler certification, the timestamp and quantum secret service platform information are also sent to the management medium for signature, and the signature data is forwarded to the quantum secret service platform.
[0006] Furthermore, the quantum secret service platform uses the signature public key to verify the signature data, verify that the refiller ID is consistent with the pre-entered one, the timestamp is within a preset interval with the current time, and the quantum secret service platform information is consistent with this platform, then the authentication is passed and an authentication token is returned to the refill terminal.
[0007] Furthermore, the filler passes the authentication and applies to the quantum cryptographic service platform for the filling key, including: reporting the user medium filling information; applying for the filling key generation; and applying for the filling key issuance.
[0008] Furthermore, reporting the user medium charging information specifically includes: the charging terminal obtains the module information of the connected user medium, carries the module information and the authentication token to report the charging information to the quantum secret service platform, wherein the module information at least includes the serial number; the quantum secret service platform verifies that the authentication token is correct, and then enters the charging information.
[0009] Furthermore, applying for the generation of the injection key specifically includes: the injection terminal carries the authentication token, the serial number, and the key injection amount to apply to the quantum secret service platform for the generation of the injection key; the quantum secret service platform verifies that the authentication token is correct, prepares the quantum key with reference to the key injection amount, and returns the key acquisition token to the injection terminal.
[0010] Furthermore, applying for the issuance of the charging key specifically includes: the charging terminal applies to the management medium for an SM2 encryption public-private key pair, the SM2 encryption public-private key pair including an encryption public key and an encryption private key, and carries the encryption public key, the key acquisition token, the key charging amount, and the key starting handle to apply to the quantum secret service platform for the issuance of the charging key; the quantum secret service platform verifies that the key acquisition token is correct, selects the quantum key according to the key starting handle and the key charging amount to form the charging key, and calculates the charging key using the SM3 hash algorithm. The charging key hash value is used to encrypt the charging key using a quantum encryption key in combination with a symmetric encryption algorithm, the quantum encryption key is encrypted using the encryption public key, and the charging key hash value, the charging key ciphertext, and the quantum encryption key ciphertext are returned to the charging terminal; the charging terminal or the management medium decrypts the quantum encryption key ciphertext using the encryption private key, decrypts the charging key using the quantum encryption key, and calculates the charging key hash value, and compares it with the returned hash value. If they are consistent, the charging key is written into the user medium.
[0011] Furthermore, the charging key is written successfully, and the charging terminal sends a charging success notification to the quantum secret service platform; the quantum secret service platform receives the charging success notification and destroys the key acquisition token.
[0012] Furthermore, the user medium is pre-set with a login PIN code, and the key charging can only be performed after the charging terminal verifies that the input login PIN code is consistent with the pre-set login PIN code.
[0013] Furthermore, the charging key is written into the user medium specifically including: the charging terminal obtains the input login PIN code and modification PIN code, encrypts the charging key using the preset byte hash value of the modification PIN code to form write data, and uses the preset byte hash value of the login PIN code to encrypt at least the module information, the quantum secret service platform information, and the modification PIN code to form a write header; the write data and the write header group are stored in the user medium; if the modification PIN code is obtained to be empty, the default modification PIN code is the same as the login PIN code.
[0014] Furthermore, the charging terminal is connected to the quantum secret service platform via a local area network.
[0015] Furthermore, if the charging terminal is not connected to the management medium, before applying for the charging staff authentication, the charging terminal generates the SM2 signature public-private key pair, and enters the signature public key into the quantum secret service platform; when applying for the charging staff authentication, the charging terminal signs the timestamp and the quantum secret service platform information, and sends the signature data and the charging staff ID package to the quantum secret service platform; when applying for the issuance of the charging key, the charging terminal generates the SM2 encryption public-private key pair, carries the encryption public key, the key acquisition token, the key charging amount, and the key start handle to apply to the quantum secret service platform for the issuance of the charging key, and receives the charging key hash value, the charging key ciphertext, and the quantum encryption key ciphertext returned by the quantum secret service platform; the charging terminal uses the encryption private key to decrypt the quantum encryption key ciphertext, uses the quantum encryption key to decrypt and obtain the charging key, and calculates the charging key hash value, compares it with the returned hash value, and if they are consistent, writes the charging key to the user medium.
[0016] The present invention has at least the following beneficial effects:
[0017] (1) The present invention pre-enters the filler ID into the quantum secret service platform. The filling terminal carries the filler ID of the local side to apply for filler authentication to the quantum secret service platform. The quantum secret service platform verifies that the filler ID carried by the filling terminal is consistent with the pre-entered filler ID to pass the filler authentication, thereby issuing the filling key. By limiting the identity of the person or device filling the key, it can resist external malicious attacks and illegal operations by internal personnel, reduce the risk of key tampering or theft, and avoid service interruption or system instability; and can track and audit quantum key distribution records based on the filler ID.
[0018] (2) The present invention introduces a management medium, so that the signature operation no longer depends on the terminal environment that may be attacked, and the key injection process has a higher level of security features; and the management medium is easy to move, which improves the flexibility of key injection; in particular, the quantum secret service platform is set up to issue an authentication token only after the experience signature and triple verification are successful, which improves the accuracy and security of identity authentication.
[0019] (3) The present invention sets a charging terminal to report the charging information of the user medium after obtaining the authentication token to apply for the charging key, so as to avoid irrelevant media accessing the quantum secret service platform, resulting in the performance degradation of the quantum secret service platform and network congestion, affecting the operation and efficiency of its normal business.
[0020] (4) The present invention is configured to apply for charging key generation after the charging information is successfully reported, so that the quantum secret service platform prepares the quantum key for the subsequent issuance of the charging key, thereby improving the responsiveness of the entire key charging system; and in this process, the quantum secret service platform returns a key acquisition token as a credential for further access to the quantum secret service platform to obtain the charging key, so as to add an additional security layer outside the authentication token.
[0021] (5) The present invention is provided with a key acquisition token to apply for the issuance of a charging key. The quantum cryptographic service platform verifies the key acquisition token to confirm the user's medium charging authority, which not only prevents the charging key from being illegally issued, but also facilitates the management of the user's medium acquisition authority. It also uses an asymmetric cryptographic algorithm to protect the transmission of the encryption key, and uses a symmetric cryptographic algorithm to protect the transmission of the charging key. The symmetric cryptographic algorithm has a high encryption and decryption rate. The data is transmitted by combining the asymmetric cryptographic algorithm with the symmetric cryptographic algorithm. While ensuring the security of the issuance of the charging key, it also improves the efficiency of the charging key.
[0022] (6) The present invention uses a modified PIN code hash value to encrypt the charging key and write it into the user medium, so that the charging key is stored in the user medium as ciphertext to avoid key leakage; and the modified PIN code of each user medium is different, and the encryption key of the charging key of different user media is also different, thereby improving the security of key storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0024] Figure 1 It is an interactive schematic diagram of a key injection method in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0027] Unless otherwise specified, the ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects and are not used to limit the order, timing, priority or importance of the multiple objects.
[0028] The present invention provides a key filling method, such as Figure 1 As shown, it includes a charging terminal and a quantum secret service platform. The charging terminal and the quantum secret service platform can be connected through a local area network to enhance the security and privacy, reliability and stability of communication, and also realize high-speed data transmission. Preferably, the two communicate based on the Websocket protocol of SSL to reduce handshakes and avoid repeated connection establishment, further making data transmission efficient. The charging terminal is at least connected to the user medium, and the charging terminal includes but is not limited to a computer. The charging terminal and the user medium can be connected via USB. The quantum secret service platform includes a quantum key generation device, which is used to generate a truly random quantum key. The quantum secret service platform can respond to the charging key application initiated by the charging terminal and issue a quantum key to it.
[0029] The method includes: the quantum secret service platform pre-enters the filler ID, and the filling terminal carries the filler ID to apply for filler authentication to the quantum secret service platform; if the filler authentication is passed, the quantum secret service platform responds to the filling key application sent by the filling terminal and issues the filling key, and the filling key is written into the user medium. Specifically, before key filling, the filler ID is manually entered in the management configuration interface of the quantum secret service platform, and on the filling terminal side, the filler ID is written into the key filling program installed in the filling terminal, or the filler enters the key in the filling terminal during key filling. The charging terminal carries the charging staff ID on this side and applies for charging staff authentication to the quantum secret service platform. The quantum secret service platform verifies whether the charging staff ID carried by the charging terminal is consistent with the pre-entered one. If they are consistent, it indicates that the identity of the charging staff or the charging terminal is legal, and the charging staff authentication is passed; if they are inconsistent, it indicates that the charging staff or the charging terminal is not authorized, and the charging staff authentication fails, and the quantum secret service platform refuses to issue the charging key to the charging terminal. If the charging staff authentication is passed, the quantum secret service platform returns an authentication token to the charging terminal. The charging terminal receives the authentication token and sends a charging key application to the quantum secret service platform. The quantum secret service platform responds to the application, returns the charging key to the charging terminal, records the corresponding relationship between the charging key and the charging staff ID, and the charging key is written into the user medium by the charging terminal.
[0030] The present invention pre-enters the filler ID in the quantum secret service platform, and the filling terminal carries the filler ID on this side to apply for filler authentication to the quantum secret service platform. The quantum secret service platform verifies that the filler ID carried by the filling terminal is consistent with the pre-entered filler ID to pass the filler authentication, thereby issuing the filling key. By limiting the identity of the person or device for key filling, it can resist external malicious attacks and illegal operations by internal personnel, reduce the risk of key tampering or theft, and avoid service interruption or system instability; and can track and audit quantum key distribution records based on the filler ID.
[0031] In one embodiment of the present invention, before applying for filler certification, the filling terminal is also connected to the management medium, and the management medium generates an SM2 signature public-private key pair, wherein the signature public key is entered into the quantum secret service platform; when applying for filler certification, the timestamp and quantum secret service platform information are also sent to the management medium for signature, and the signature data is forwarded to the quantum secret service platform. Specifically, in this embodiment, the filling terminal is connected to the user medium and the management medium at the same time, and the management medium generates a signature public-private key pair based on the SM2 algorithm, and the signature public-private key pair includes a signature private key and a signature public key, wherein the signature public key is entered into the quantum secret service platform before applying for filler certification, and preferably, it can be entered into the quantum secret service platform at the same time as the filler ID. When applying for filler certification, the filling terminal carries the timestamp and quantum secret service platform information in addition to the filler ID. The filling terminal first sends the filler ID, timestamp, and quantum secret service platform information to the management medium. The management medium signs the timestamp and quantum secret service platform information with the signature private key, and returns the signature data and the filler ID package to the filling terminal, which is forwarded to the quantum secret service platform by the filling terminal. Among them, the quantum secret service platform information includes the quantum secret service platform ID, IP and port number. The present invention sets the filling terminal to be connected to the management medium, and the management medium signs part of the data of the filler's authentication application, and verifies the signature at the communication end, thereby ensuring the integrity and authenticity of the communication of the filler's authentication application.
[0032] In a further embodiment of the present invention, the quantum secret service platform uses the signature public key to verify the signature data, and verifies that the filler ID is consistent with the pre-entered one, the timestamp is in a preset interval with the current time, and the quantum secret service platform information is consistent with the current platform, then the authentication is passed, and the authentication token is returned to the filling terminal. Specifically, the quantum secret service platform receives the filler authentication application sent by the filling terminal, and uses the pre-entered signature public key to verify the signature data. The verification is successful, indicating that the received filler authentication data is complete and the signature data is generated by the management medium; then verify that the filler ID in the signature data is consistent with the pre-entered one, indicating that the filler or the filling terminal device is legal; also verify that the timestamp in the signature data is in a preset interval with the current time to confirm that the signature is valid; also verify that the quantum secret service platform information in the signature data is consistent with the current platform to ensure that the filling terminal accurately accesses the corresponding quantum secret service platform. If the signature verification and triple verification are successful, the authentication is passed, and the authentication token is returned to the filling terminal. After the filling terminal passes the authentication, the quantum secret service platform will associate the filler ID carried in the filler authentication application with the entered public key. If the management medium remains unchanged, when the user medium is filled with keys again, there is no need to regenerate the SM2 signature public and private key pair and enter the signature public key in the quantum secret service platform. The present invention introduces a management medium so that the signature operation no longer depends on the terminal environment that may be attacked, and the key filling process has a higher level of security features; and the management medium is easy to move, which improves the flexibility of key filling; in particular, the quantum secret service platform is set up to issue an authentication token only after the experience signature and triple verification are successful, which improves the accuracy and security of identity authentication.
[0033] In a further embodiment of the present invention, the charging operator passes the authentication and applies to the quantum secret service platform for the charging key, including: reporting the user medium charging information; applying for the charging key generation; applying for the charging key issuance. By dividing the key charging into three steps, the parameter review of each step can be strictly controlled, and the security of the charging key issuance can be enhanced.
[0034] In a further embodiment of the present invention, reporting the user medium charging information specifically includes: the charging terminal obtains the module information of the connected user medium, carries the module information and the authentication token to report the charging information to the quantum secret service platform, wherein the module information at least includes a serial number; the quantum secret service platform verifies that the authentication token is correct, and then enters the charging information. Specifically, if the charging operator passes the authentication, the charging terminal obtains the authentication token, and then applies to the connected user medium to obtain its module information. The user medium responds to the application and sends its own module information to the charging terminal, wherein the module information includes a serial number and a name, and the serial number is a unique code for the user medium. The charging terminal sends the module information and the authentication token to the quantum secret service platform to report the charging information of the user medium. In this process, the charging terminal can also send the charging operator ID to the quantum secret service platform, so that the quantum secret service platform can confirm that the identity of the other party in this interaction is legal. The quantum secret service platform compares the authentication token sent by the charging terminal with the authentication token on this side, indicating that the current charging has been authorized, and then enters the charging information of the user medium, and returns a successful response to the charging information report to the charging terminal. The present invention arranges the charging terminal to report the charging information of the user medium after obtaining the authentication token to apply for the charging key, so as to avoid irrelevant media accessing the quantum secret service platform, resulting in performance degradation and network congestion of the quantum secret service platform, and affecting the operation and efficiency of its normal business. If the charging information is reported successfully, the quantum secret service platform will establish an association between the user medium serial number and the filler ID. If the user medium is subsequently filled with a key again, the quantum secret service platform will also verify the association between the serial number and the filler ID in the step of reporting the user medium charging information. If there is no match, the charging information is refused to be entered.
[0035] In a further embodiment of the present invention, applying for the generation of the charging key specifically includes: the charging terminal carries the authentication token, the serial number, and the key charging amount to apply for the generation of the charging key to the quantum secret service platform; the quantum secret service platform verifies that the authentication token is correct, prepares the quantum key with reference to the key charging amount, and returns the key acquisition token to the charging terminal. Specifically, the charging terminal receives a successful response to the charging information report, sends the authentication token, the serial number of the user medium to be charged, and the key charging amount to be charged to the user medium to the quantum secret service platform, and can also send the charger ID to the quantum secret service platform together, so that the quantum secret service platform confirms that the identity of the other party in this interaction is legal. If the quantum secret service platform compares the authentication token sent by the charging terminal with the authentication token on this side, it will prepare the quantum key with reference to the sent key charging amount, and return the key acquisition token to the charging terminal. Among them, the prepared quantum key amount is not less than the key charging amount, and the quantum key is used to form the charging key. The quantum secret service platform records the correspondence between the user medium serial number and the prepared quantum key, so that the relevant quantum key can be queried based on the serial number later. For example, the injection key injected into the user medium can be queried based on the serial number, key start handle, and key injection amount. The present invention is set to apply for injection key generation after the injection information is successfully reported, so that the quantum secret service platform prepares the quantum key and prepares for the subsequent injection key issuance, thereby improving the responsiveness of the entire key injection system; and the quantum secret service platform returns a key acquisition token in this process as a credential for further access to the quantum secret service platform to obtain the injection key, so as to add an additional security layer outside the authentication token.
[0036] In a further embodiment of the present invention, applying for the issuance of the charging key specifically includes: the charging terminal applies to the management medium for obtaining an SM2 encryption public-private key pair, the SM2 encryption public-private key pair including an encryption public key and an encryption private key, and carries the encryption public key, the key acquisition token, the key charging amount, and the key starting handle to apply to the quantum secret service platform for the issuance of the charging key; the quantum secret service platform verifies that the key acquisition token is correct, selects the quantum key according to the key starting handle and the key charging amount to form the charging key, and uses the SM3 hash algorithm Calculate the charging key hash value, encrypt the charging key using the quantum encryption key in combination with the symmetric encryption algorithm, encrypt the quantum encryption key using the encryption public key, and return the charging key hash value, the charging key ciphertext, and the quantum encryption key ciphertext to the charging terminal; the charging terminal or the management medium decrypts the quantum encryption key ciphertext using the encryption private key, decrypts the charging key using the quantum encryption key to obtain the charging key, and calculates the charging key hash value, compares it with the returned hash value, and if they are consistent, writes the charging key to the user medium. Specifically, the charging terminal receives a key acquisition token, indicating that it can apply for the charging key, and then applies to the connected management medium for the SM2 encrypted public-private key pair. The management medium generates an SM2 encrypted public-private key pair and sends it to the charging terminal. The SM2 encrypted public-private key pair includes an encrypted public key and an encrypted private key. The charging terminal sends the encrypted public key, key acquisition token, key charging amount, and key start handle to the quantum secret service platform. The quantum secret service platform compares the key acquisition token sent by the charging terminal and is consistent with this side, indicating that the charging terminal has the qualifications to apply for the charging key to be issued. Then, according to the key start handle and key charging amount, the relevant key is selected from the prepared quantum key to form the charging key. It can be understood that in the process of applying for the generation of the charging key, the quantum secret service platform can prepare multiple quantum keys. The key start handle is used to confirm the selected starting position from the key data formed by multiple quantum keys, and select the relevant key data fragment according to the key charging amount to form the charging key. The charging terminal can also send the charging ID to the quantum secret service platform together, so that the quantum secret service platform can confirm the legality of the identity of the other end of this interaction. The quantum secret service platform forms a charging key and associates the charging key with the charging staff ID to track and audit the charging key distribution record based on the charging staff ID. When the charging key is formed, the quantum secret service platform uses the SM3 hash algorithm to calculate the charging key hash value, and also uses the quantum encryption key combined with the symmetric encryption algorithm to encrypt the charging key to form a charging key ciphertext, wherein the quantum encryption key can be prepared when the quantum secret service platform prepares the quantum key during the application for charging key generation, or it can be generated when the quantum secret service platform receives the charging key issuance application. The quantum secret service platform also uses the encrypted public key sent by the charging terminal to encrypt the quantum encryption key to form a quantum encryption key ciphertext.The quantum secret service platform returns the charging key hash value, charging key ciphertext, and quantum encryption key ciphertext to the charging terminal. In one embodiment, the charging terminal uses the pre-acquired encryption private key to decrypt the quantum encryption key ciphertext to obtain the quantum encryption key, and uses the quantum encryption key in combination with the symmetric encryption algorithm to decrypt the charging key ciphertext to obtain the charging key. It can be understood that for symmetric encryption algorithms, the same key can realize data encryption and decryption for each other. The symmetric encryption algorithm used in the present invention is preferably the SM4 encryption algorithm. The charging terminal also uses the SM3 hash algorithm to calculate the charging key hash value, and compares it with the hash value returned by the quantum secret service platform. If they are consistent, it indicates that the charging key issued by the quantum secret service platform has not been tampered with during the transmission process. On this basis, the charging key is stored in the user medium. In another embodiment, the charging terminal forwards the return data of the quantum secret service platform for the application of charging key to the management medium, and the management medium uses the pre-generated encryption private key to decrypt the quantum encryption key ciphertext to obtain the quantum encryption key, and uses the quantum encryption key in combination with the symmetric cryptographic algorithm to decrypt the charging key ciphertext to obtain the charging key, and also uses the SM3 hash algorithm to calculate the charging key hash value, and compares it with the hash value returned by the quantum secret service platform. If they are consistent, the charging key is stored in the user medium. The present invention is set to carry a key acquisition token to apply for charging key issuance, and the quantum secret service platform obtains the token by verifying the key to confirm the user medium charging authority, which not only avoids the charging key from being illegally issued, but also facilitates the management of the user medium's access authority, such as setting the validity period of the token to manage the user medium's access to the quantum secret service platform; it also uses an asymmetric cryptographic algorithm to protect the encryption key transmission, and uses a symmetric cryptographic algorithm to protect the charging key transmission, and the symmetric cryptographic algorithm has a high encryption and decryption rate, and transmits data by combining an asymmetric cryptographic algorithm with a symmetric cryptographic algorithm, while ensuring the security of charging key issuance, it also improves the efficiency of charging key.
[0037] In a preferred embodiment, the charging key is written successfully, and the charging terminal sends a charging success notification to the quantum cryptographic service platform; the quantum cryptographic service platform receives the charging success notification and destroys the key acquisition token, such as clearing the buf where it is located. In this way, the key acquisition token is valid for one time, which can prevent replay attacks, that is, even if the key acquisition token is intercepted, the attacker cannot reuse it to access the quantum encryption platform at a later time.
[0038] In a further embodiment of the present invention, the user medium is pre-set with a login PIN code, and the charging terminal verifies that the input login PIN code is consistent with the pre-set login PIN code before the key charging can be performed. Specifically, before the first key charging, the charging terminal is electrically connected to the user medium to initialize it and write the login PIN code into it; when charging the key, it is necessary to manually enter the login PIN code in the key charging program interface of the charging terminal. If the charging terminal verifies that the input login PIN code is consistent with the pre-set login PIN code before the key charging, it allows further key charging steps to be performed, such as applying for a charge operator certification from the quantum key service platform.
[0039] In a preferred embodiment, the charging key is written into the user medium specifically including: the charging terminal obtains the input login PIN code and modification PIN code, encrypts the charging key using the preset byte hash value of the modification PIN code to form write data, uses the preset byte hash value of the login PIN code to encrypt at least the module information, the quantum secret service platform information, and the modification PIN code to form a write header, and the write data and the write header group are packaged and stored in the user medium; if the modification PIN code is obtained to be empty, the default modification PIN code is the same as the login PIN code. Specifically, the charging terminal obtains the login PIN code and modification PIN code entered by the recharger. If the obtained modification PIN code is empty, that is, the recharger has not entered the modification PIN code, the default modification PIN code is the same as the login PIN code. The charging terminal calculates the hash value of the login PIN code and the modification PIN code using the SM3 hash algorithm, encrypts the charging key using the preset byte hash value of the modification PIN code to form write data, and uses the preset byte hash value of the login PIN code to encrypt at least the module information, the quantum secret service platform information, and the modification PIN code to form a write header. Preferably, the charging terminal uses the SM3 hash algorithm to calculate the login PIN code and the modified PIN code to obtain the corresponding hash value, and takes the first 16 bits of each as the key, and encrypts the header data such as the charging key and the module information respectively in combination with the symmetric cryptographic algorithm. The written data and the written header form a data packet and are stored by the charging terminal to the user medium to complete the key charging. When the user medium is used, by obtaining the input PIN code, calculating the hash value and taking the same preset bytes, the written data can be decrypted to obtain the charging key, so that the charging key can be used to encrypt the communication data. It can be understood that the PIN code entered at this time is the latest modified PIN code. The present invention uses the modified PIN code hash value to encrypt the charging key and write it to the user medium, so that the charging key is stored in the user medium as ciphertext to avoid key leakage; the determinism of the hash calculation is used, combined with the symmetric cryptographic algorithm to implement encryption, without the need to exchange keys, thereby enhancing the security of key charging; and the modified PIN codes of each user medium are different, and the encryption keys of the charging keys of different user media are also different, thereby improving the security of key storage.
[0040] In another embodiment of the present invention, the key charging method is implemented without the need for management media, that is, the charging terminal is only connected to the user media during the key charging process. Compared with the aforementioned embodiment in which the charging terminal is simultaneously connected to the user media and the management media during the key charging process, the key charging process is simplified and the charging efficiency is improved. In this embodiment, the charging terminal is not connected to the management medium. Before applying for the charging staff certification, the charging terminal generates the SM2 signature public-private key pair and enters the signature public key into the quantum secret service platform; when applying for the charging staff certification, the charging terminal signs the timestamp and the quantum secret service platform information, and sends the signature data and the charging staff ID package to the quantum secret service platform. The quantum secret service platform uses the signature public key to verify the signature data, verify that the charging staff ID is consistent with the pre-entered one, the timestamp is in a preset interval with the current time, and the quantum secret service platform information is consistent with this platform, then the authentication is passed and the authentication token is returned to the charging terminal. After the filler passes the authentication, the filling terminal obtains the module information of the connected user medium, and carries the module information and the authentication token to report the filling information to the quantum secret service platform, where the module information at least includes the serial number. The quantum secret service platform verifies that the authentication token is correct, then enters the filling information, and returns a successful response to the filling information report to the filling terminal. The filling terminal carries the authentication token, serial number, and key charging amount to apply to the quantum secret service platform for charging key generation; the quantum secret service platform verifies that the authentication token is correct, prepares the quantum key according to the key charging amount, and returns the key acquisition token to the filling terminal. The charging terminal receives the key acquisition token and applies to the quantum secret service platform for the issuance of the charging key. Specifically, the charging terminal generates the SM2 encryption public-private key pair, carries the encryption public key, the key acquisition token, the key charging amount, and the key start handle to apply to the quantum secret service platform for the issuance of the charging key, and receives the charging key hash value, the charging key ciphertext, and the quantum encryption key ciphertext returned by the quantum secret service platform; the charging terminal uses the encryption private key to decrypt the quantum encryption key ciphertext, uses the quantum encryption key to decrypt and obtain the charging key, and calculates the charging key hash value, compares it with the returned hash value, and if they are consistent, writes the charging key to the user medium.
[0041] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A key filling method, It is characterized in that The method comprises a charging terminal and a quantum secret service platform, wherein the charging terminal is at least connected to a user medium, and the method comprises: The quantum secret service platform pre-enters the filler ID, and the filling terminal carries the filler ID to apply for filler authentication from the quantum secret service platform; If the recharger passes the authentication, the quantum secret service platform will issue the recharge key in response to the recharge key application sent by the recharge terminal, and the recharge key will be written into the user medium.
2. The method according to claim 1, It is characterized in that Before applying for filler certification, the filling terminal is also connected to a management medium, and the management medium generates an SM2 signature public-private key pair, wherein the signature public key is entered into the quantum secret service platform; When applying for filler certification, the timestamp and quantum secret service platform information are also sent to the management medium for signature, and the signature data is forwarded to the quantum secret service platform.
3. The method according to claim 2, It is characterized in that The quantum secret service platform uses the signature public key to verify the signature data, verify that the refiller ID is consistent with the pre-entered one, that the timestamp is within a preset interval with the current time, and that the quantum secret service platform information is consistent with this platform, then the authentication is successful and an authentication token is returned to the refill terminal.
4. The method according to claim 3, It is characterized in that The filler passes the authentication and applies for the filling key from the quantum secret service platform, including: Reporting the user medium charging information; Applying for generation of the charging key; Apply for the issuance of the charging key.
5. The method according to claim 4, It is characterized in that Reporting the user medium charging information specifically includes: The charging terminal obtains the module information of the connected user medium, and reports the charging information to the quantum secret service platform by carrying the module information and the authentication token, wherein the module information at least includes a serial number; The quantum secret service platform verifies that the authentication token is correct and then enters the charging information.
6. The method according to claim 5, It is characterized in that Applying for the generation of the charging key specifically includes: The charging terminal carries the authentication token, the serial number, and the key charging amount to apply to the quantum secret service platform for the generation of the charging key; The quantum secret service platform verifies that the authentication token is correct, prepares the quantum key with reference to the key charging amount, and returns the key acquisition token to the charging terminal.
7. The method according to claim 6, It is characterized in that Applying for the issuance of the charging key specifically includes: The charging terminal applies to the management medium for an SM2 encryption public-private key pair, wherein the SM2 encryption public-private key pair includes an encryption public key and an encryption private key, and carries the encryption public key, the key acquisition token, the key charging amount, and the key start handle to apply to the quantum secret service platform for the charging key to be issued; The quantum secret service platform verifies that the key acquisition token is correct, selects the quantum key according to the key start handle and the key charging amount to form the charging key, calculates the charging key hash value using the SM3 hash algorithm, encrypts the charging key using the quantum encryption key combined with the symmetric encryption algorithm, encrypts the quantum encryption key using the encryption public key, and returns the charging key hash value, the charging key ciphertext, and the quantum encryption key ciphertext to the charging terminal; The charging terminal or the management medium uses the encrypted private key to decrypt the quantum encryption key ciphertext, uses the quantum encryption key to decrypt and obtain the charging key, and calculates the charging key hash value, and compares it with the returned hash value. If they are consistent, the charging key is written into the user medium.
8. The method according to claim 7, It is characterized in that The charging key is written successfully, and the charging terminal sends a charging success notification to the quantum secret service platform; The quantum secret service platform receives the recharging success notification and destroys the key acquisition token.
9. The method according to claim 1, It is characterized in that The user medium is pre-set with a login PIN code, and the key charging can only be performed after the charging terminal verifies that the input login PIN code is consistent with the pre-set login PIN code.
10. The method according to any one of claims 5 to 9, It is characterized in that The charging key is written into the user medium specifically including: The charging terminal obtains the input login PIN code and modification PIN code, encrypts the charging key using the preset byte hash value of the modification PIN code to form write data, and uses the preset byte hash value of the login PIN code to encrypt at least the module information, the quantum secret service platform information, and the modification PIN code to form a write header; The write data and the write header group packet are stored in the user medium; If the modified PIN code is empty, the default modified PIN code is the same as the login PIN code.
11. The method according to any one of claims 1 to 9, It is characterized in that The charging terminal is connected to the quantum secret service platform via a local area network.
12. The method according to claim 7, It is characterized in that If the filling terminal is not connected to the management medium, before applying for filler authentication, the filling terminal generates the SM2 signature public-private key pair and enters the signature public key into the quantum secret service platform; When applying for filler authentication, the filling terminal signs the timestamp and the quantum secret service platform information, and sends the signature data and the filler ID package to the quantum secret service platform; When applying for the issuance of the charging key, the charging terminal generates the SM2 encryption public-private key pair, carries the encryption public key, the key acquisition token, the key charging amount, and the key start handle to apply to the quantum secret service platform for the issuance of the charging key, and receives the charging key hash value, the charging key ciphertext, and the quantum encryption key ciphertext returned by the quantum secret service platform; The charging terminal uses the encrypted private key to decrypt the quantum encryption key ciphertext, uses the quantum encryption key to decrypt and obtain the charging key, and calculates the charging key hash value, and compares it with the returned hash value. If they are consistent, the charging key is written into the user medium.
