Smart card access authentication method, device, equipment and storage medium

By generating and updating key data in the idle state of the smart card, the problem of slow encryption calculation speed of small-capacity chips in the 5G network is solved, and the speed of the smart card accessing the 5G network is improved.

CN115103358BActive Publication Date: 2024-10-18EASTCOMPEACE TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210484533.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-06
Publication Date
2024-10-18
Estimated Expiration
2042-05-06

AI Technical Summary

Technical Problem

In 5G networks, small-capacity chips do not support hard implementation of the ECC algorithm, resulting in slow encryption calculations and prolonging the time for smart cards to access the network.

Method used

Generate new key data in the idle state, and update the valid mark of the key data in the storage space, so that the stored key data can be used directly when receiving the authentication instruction, avoiding key calculation and improving the authentication response time.

Benefits of technology

By generating key data in the idle state, the smart card can directly use the stored key data when accessing the 5G network, reducing the response execution time of the authentication command and improving the access speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115103358B_ABST
    Figure CN115103358B_ABST
Patent Text Reader

Abstract

The present invention provides a smart card access authentication method, device and smart card, which relates to network access of smart cards. The method comprises: receiving an authentication instruction, reading valid first key data from a first storage space; performing encryption calculation on the identity of the smart card through the first key data, obtaining authentication response data and outputting it, and configuring the key validity mark of the first key data to be invalid; determining that there is invalid key data in the first storage space, and the current working state is an idle state, then generating new key data as second key data, and storing the second key data in the first storage space. The present invention can speed up the authentication speed of network access of smart cards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network access of smart cards, and in particular to a smart card access authentication method, device, equipment and storage medium. Background Art

[0002] In the 5G network, the 5G smart card uses user identity privacy protection technology. When authenticating access to the 5G access network, the stored user permanent identification SUPI is encrypted to obtain the ciphertext SUCI, and then transmitted to the 5G network background for identity authentication, thus preventing the 5G user identity plaintext SUPI from being intercepted in the air interface and protecting the user identity privacy. In the current international standards, the 5G smart card uses the PKI encryption mechanism of the ECC elliptic curve to generate a temporary session key for accessing the 5G network, which is used for the calculation of the ciphertext SUCI transmitted this time.

[0003] However, during the encryption process, due to the different computing capabilities of different chips, especially small-capacity chips that do not support the hard implementation of the ECC algorithm, the calculation speed will be very poor, reducing the performance of network authentication and prolonging the time to access the 5G network. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the embodiment of the present invention provides a smart card access authentication method, device and smart card to reduce the time consumption of accessing the network.

[0005] On the one hand, an embodiment of the present invention provides a smart card access authentication method, comprising: receiving an authentication instruction, reading valid first key data from a first storage space, the first storage space storing at least one group of key data information, each group of the key data information including key data and a key validity mark, wherein the key validity mark is used to characterize whether the key data is valid; performing encryption calculation on the identity of the smart card through the first key data, obtaining and outputting authentication response data, and configuring the key validity mark of the first key data to be invalid; determining that the key data with the key validity mark as invalid exists in the first storage space, and the current working state is an idle state, generating new key data as second key data, and storing the second key data in the first storage space.

[0006] According to some embodiments of the present invention, generating the new key data as the second key data and storing the second key data in the first storage space includes: obtaining the storage address of the key data information in the first storage space that has the key validity marked as invalid; storing the second key data at the storage address, and configuring the key validity mark of the second key data to be valid.

[0007] According to some embodiments of the present invention, the first storage space stores a first authentication encryption type, and the first authentication encryption type is used to characterize the type of authentication encryption algorithm for generating the key data. The method includes: if it is determined that the first file is updated, the second authentication encryption type stored in the first file is compared with the first authentication encryption type, wherein the second authentication encryption type is used to characterize the type of authentication encryption algorithm of the authentication server; if it is determined that the first authentication encryption type is different from the second authentication encryption type, the key validity mark of all the key data information is configured as invalid.

[0008] According to some embodiments of the present invention, the method includes: determining the maximum total length of the key of the authentication encryption algorithm according to the type of the authentication encryption algorithm; and configuring the data storage length of the key data according to the maximum total length.

[0009] According to some embodiments of the present invention, the method includes: when the key validity mark of the key data is configured as invalid, configuring the first mark to a mark state; determining that the first mark is configured to a mark state and the current working state is an idle state, generating new key data as second key data, and storing the second key data in the first storage space.

[0010] According to some embodiments of the present invention, the method includes: counting the number of key data in the first storage space that are marked as valid by the key to obtain a second number; obtaining the number of groups of the key data information as the first number; and if it is determined that the first number is the same as the second number, configuring the first mark to a cleared state.

[0011] According to some embodiments of the present invention, the second quantity is stored in the first storage space, and the method includes: if it is detected that the key validity mark of the key data information is configured as invalid, then the quantity of the key data information whose key validity mark is configured as invalid is subtracted from the second quantity; if it is detected that the second key data is stored in the first storage space, then the quantity of the second key data is added to the second quantity.

[0012] On the other hand, an embodiment of the present invention provides a smart card access authentication device, including: a first module, used to receive an authentication instruction and read out valid first key data from a first storage space, the first storage space storing at least one group of key data information, each group of the key data information including key data and a key validity mark, wherein the key validity mark is used to characterize whether the key data is valid; a second module, used to perform encryption calculation on the identity of the smart card through the first key data, obtain authentication response data and output it, and configure the key validity mark of the first key data to be invalid; a third module, used to determine that there is key data with the key validity mark as invalid in the first storage space, and the current working state is an idle state, then generate new key data as second key data, and store the second key data in the first storage space.

[0013] The smart card access authentication method, apparatus, device and storage medium according to the embodiments of the present invention have at least the following beneficial effects: by generating key data in an idle state, that is, performing ECC key generation in idle time, when the smart card receives an access authentication instruction, it directly uses the key existing in the first storage space without calculating the key, thereby improving the response execution time of the authentication instruction, and also speeding up the speed at which the smart card device accesses the 5G network.

[0014] On the other hand, an embodiment of the present invention provides a device, including a processor and a memory coupled to the processor, the memory storing program instructions executable by the processor, and the processor implementing the above-mentioned smart card access authentication method when executing the program instructions stored in the memory.

[0015] On the other hand, the present invention provides a computer-readable storage medium, wherein program instructions are stored in the storage medium, and when the program instructions are executed by a processor, the above-mentioned smart card access authentication method is implemented.

[0016] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0018] Figure 1 It is a schematic diagram of an implementation environment of an embodiment of the present invention.

[0019] Figure 2 It is a flowchart of a smart card access authentication method provided by an embodiment of the present invention;

[0020] Figure 3 This is a storage example diagram of the first storage space in an embodiment of the present invention.

[0021] Figure 4 It is a flowchart of the key generation process in an embodiment of the present invention.

[0022] Figure 5 It is a schematic diagram of the internal modules of the smart card access device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. In the subsequent description, the use of suffixes such as "module", "component" or "unit" used to represent elements is only for the purpose of facilitating the description of the present invention, and has no specific meaning in itself. Therefore, "module", "component" or "unit" can be used in a mixed manner. "First", "second" and the like are only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or implicitly indicating the order of the indicated technical features. In this subsequent description, the continuous numbering of the method steps is for the convenience of review and understanding. In combination with the overall technical solution of the present invention and the logical relationship between the various steps, adjusting the implementation order between the steps will not affect the technical effect achieved by the technical solution of the present invention. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0024] Figure 1 An example of an implementation environment of an embodiment of the present invention is shown. A smart card is carried in the mobile device 102, such as a smart phone carrying a USIM card. When the mobile device 102 is turned on and connected to the 5G network, it receives an authentication instruction (i.e., a GET IDENTITY instruction), obtains key data, encrypts its own identity identifier SUPI and calculates MAC, obtains a ciphertext SUCI, and outputs response data to the server 101.

[0025] Reference Figure 2 , an embodiment of the present invention provides a smart card access authentication method, including but not limited to the following steps S100 to S300.

[0026] Step S100: receiving an authentication instruction, and reading valid first key data from a first storage space.

[0027] The first storage space stores at least one set of key data information, each set of key data information includes key data and a key validity mark, wherein the key validity mark is used to indicate whether the key data is valid.

[0028] Step S200, performing encryption calculation on the identity of the smart card through the first key data, obtaining and outputting authentication response data, and marking the first key data as invalid.

[0029] Specifically, the key validity mark of the used first key data is configured as invalid. Obviously, after reading the first key data, the key data information of the group where the first key data is located can be directly set to invalid data, for example, all filled with 0xFF.

[0030] Step S300: If it is determined that invalid key data exists in the first storage space and the current working state is an idle state, new key data is generated as second key data and stored in the first storage space.

[0031] Specifically, if there is a set of key data information in the first storage space, and the key validity mark of the key data information is configured to be invalid, then when the operating system (also called COS) of the smart card detects that the current working state is an idle state (for example, after sending a response, before receiving data, and before detecting that the card enters a sleep state), new key data is generated and used as second key data, and the second key data is stored in the first storage space.

[0032] The specific process of storing the second key data includes: obtaining the storage address of the key data information with the key validity mark as invalid in the first storage space; storing the second key data at the storage address, and configuring the key validity mark of the second key data to be valid.

[0033] In an embodiment of the present invention, the data stored in the first storage space is exemplified as follows: Figure 3 shown. Figure 3 The first storage space stores the encryption mode, the second quantity, and five sets of key data information (i.e. Figure 3 The first to fifth groups of keys in the Rfu field are reserved.

[0034] Each group of key data information includes at least: a key validity mark and key data. The key validity mark is used to indicate whether the key data in this group of key data information is valid. If the key validity information mark is configured as invalid (for example, the value 0xFF is used to indicate invalid), it means that the key data in this group of Key has been used and cannot be used again. If the key validity information mark is configured as valid (for example, the value 0x01 is used to indicate invalid), it means that the key data in this group of Key can be used. Taking ECC encryption as an example, the structure of the key data information may include the following: key validity information mark, encryption key length, encryption key, mac key length and mac key; wherein, the encryption key length and the mac key length can occupy one byte.

[0035] Reference Figure 3 , each group of key data information may also include other data, such as: encryption type (equivalent to the first authentication encryption type), indicating the type of encryption scheme used to generate key data in the first storage space. The data storage length of each group of key data information depends on the longest key in each encryption type (or encryption mode) of the authentication encryption algorithm. Specifically, according to the type of authentication encryption algorithm, the maximum total length of the key of the authentication encryption algorithm is determined; according to the maximum total length and the key validity mark, the data storage length of the key data is configured. Taking ECC encryption as an example, the total length of the public and private key data of ProfileA and ProfileB is inconsistent. In order to facilitate access, the length of each pair of keys is uniformly stored using 0x63 bytes, and all idle bytes after filling the key are filled with 0xFF.

[0036] For example, refer to Figure 3 Each group of key data information may also include: a second quantity, which indicates the number of valid keys currently in the first storage space. Specifically, when the key validity mark of the key data information is configured as invalid, the number of key data information whose key validity mark is configured as invalid is subtracted from the second quantity; when the second key data is stored in the first storage space, the number of the second key data is added to the second quantity.

[0037] In the embodiment of the present invention, before the smart card leaves the factory, the encryption type is determined according to the information provided by the service provider, and at least one set of key data is generated according to the encryption type and stored in a Figure 3 The first storage space is shown.

[0038] The operating system of the smart card monitors whether the first file is updated. The first file stores the type of authentication encryption algorithm used to characterize the authentication server (equivalent to the second authentication encryption type). When it is determined that the first file is updated, the second authentication encryption type stored in the first file is compared with the first authentication encryption type. If the first authentication encryption type is different from the second authentication encryption type, the key validity mark of all key data information is configured to be invalid, and the first authentication encryption type is modified to the second authentication encryption type. In this way, when the smart card is in an idle state, new key data can be generated according to the second authentication encryption type and filled to cover the original key data in the first storage space.

[0039] The following will take the ECC encryption algorithm as an example to describe the method of this embodiment. If the smart card is encrypted with ProfileA type before leaving the factory to generate the key data in the first storage space; and the second authentication encryption type detected in the first file is ProfileB, then Figure 3The first storage space shown is all set to 0xFF, that is, the key validity mark of all key data information is configured to be invalid, and all key data is cleared. At this time, the first mark is also configured to the mark state. The first mark is used to indicate whether the ECC Keypair process needs to be executed; the Keypair process is the first process in the ECC algorithm, which is relatively independent and depends on less data on the card, and new key data can be generated.

[0040] When the smart card operating system receives the GET IDENTITY instruction (equivalent to the authentication instruction), it finds and reads the valid key data from the first storage space, performs encryption calculation on its own identity tag according to the key data, and outputs the authentication response data. The smart card operating system clears the read key data, that is, sets all the data in the read Key group to 0xFF, and configures the first mark to the mark state to indicate that the ECC keyPair process needs to be executed.

[0041] like Figure 4 As shown, the operating system of the smart card will check whether the execution mark (equivalent to the first mark) of the ECC keyPair is set when the current working state is idle, such as after sending a response, before receiving data, and when the card is detected to enter a dormant state. If it is set (that is, the first mark is in the marked state), check whether the number of valid Key groups has reached the maximum value; Figure 3 For example, it is determined whether the second number is 5. If the maximum value has been reached, the execution flag of the keyPair is cleared, which is equivalent to configuring the first flag to be cleared, and then executing the ECC keyPair process. The key data generated by the ECC keyPair process will be stored in the first storage space, overwriting the invalid key data information therein.

[0042] Obviously, in the above process, after detecting that the execution flag of ECC keyPair is set, the keyPair execution process can also be executed first, and after executing keyPair, it will be detected whether the second number is the maximum value. If it is, the flag bit will be cleared; if not, keyPair will continue to be executed until the second number reaches the maximum value.

[0043] Reference Figure 5 An embodiment of the present invention provides a smart card access authentication device, including but not limited to a first module 100, a second module 200 and a third module 300.

[0044] The first module 100 is used to receive an authentication instruction and read out valid first key data from a first storage space. The first storage space stores at least one group of key data information. Each group of key data information includes key data and a key validity mark, wherein the key validity mark is used to indicate whether the key data is valid.

[0045] The second module 200 is used to perform encryption calculation on the identity of the smart card through the first key data, obtain authentication response data and output it, and configure the key validity mark of the first key data to be invalid.

[0046] The third module 300 is used to determine that there is key data with a key validity mark as invalid in the first storage space, and the current working state is an idle state, then generate new key data as second key data, and store the second key data in the first storage space.

[0047] The embodiment of the present invention also provides a computer device, such as a smart card, including a processor and a memory coupled to the processor, the memory storing program instructions executable by the processor, and the processor implementing the above-mentioned smart card access authentication method when executing the program instructions stored in the memory. Among them, the processor can also be called a CPU (Central Processing Unit). The processor may be an integrated circuit chip with signal processing capabilities. The processor can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor, or the general-purpose processor can also be any conventional processor, etc. The memory can include various components (e.g., machine-readable media), including but not limited to random access memory components, read-only components and any combination thereof. The memory can also include: (e.g., stored in one or more machine-readable media) instructions (e.g., software); the instructions implement the method of the embodiment of the present invention. It is hoped that it is understood that in order to avoid redundancy, the content not involved in this embodiment can refer to the above-mentioned smart card access authentication method.

[0048] The embodiment of the present invention further provides a storage medium, in which program instructions are stored, and when the program instructions are executed by a processor, the above-mentioned smart card access authentication method can be implemented. It is hoped that, in order to avoid redundancy, the contents not involved in this embodiment can refer to the above-mentioned smart card access authentication method.

[0049] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above and the functional modules / units in the devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0050] In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium (storage medium for short), which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer-readable medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0051] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the present invention shall be within the scope of the present invention.

Claims

1. A smart card access authentication method, characterized in that: include: receiving an authentication instruction, reading out valid first key data from a first storage space, wherein the first storage space stores at least one set of key data information, each set of the key data information including key data and a key validity flag, wherein the key validity flag is used to indicate whether the key data is valid; Perform encryption calculation on the identity of the smart card through the first key data, obtain authentication response data and output it, and configure the key validity mark of the first key data to be invalid; Determining that the key data marked as invalid by the key validity exists in the first storage space, and the current working state is an idle state, generating new key data as second key data, and storing the second key data in the first storage space; The first storage space stores a first authentication encryption type, the first authentication encryption type is used to characterize the type of the authentication encryption algorithm for generating the key data, and the method includes: If it is determined that the first file is updated, the second authentication encryption type stored in the first file is compared with the first authentication encryption type, wherein the second authentication encryption type is used to characterize the type of the authentication encryption algorithm of the authentication server; If it is determined that the first authentication encryption type is different from the second authentication encryption type, the key validity flag of all the key data information is configured to be invalid.

2. The smart card access authentication method according to claim 1, characterized in that: The step of generating the new key data as the second key data and storing the second key data in the first storage space includes: Obtaining a storage address of the key data information in the first storage space where the key is marked as invalid; The second key data is stored at the storage address, and the key validity mark of the second key data is configured to be valid.

3. The smart card access authentication method according to claim 1, characterized in that: The method comprises: Determine the maximum total length of the key of the authentication encryption algorithm according to the type of the authentication encryption algorithm; The data storage length of the key data is configured according to the maximum total length.

4. The smart card access authentication method according to claim 1, characterized in that: The method comprises: When the key validity flag of the key data is configured as invalid, configuring the first flag as a flag state; If it is determined that the first mark is configured as a mark state and the current working state is an idle state, new key data is generated as second key data, and the second key data is stored in the first storage space.

5. The smart card access authentication method according to claim 4, characterized in that: The method comprises: Counting the number of key data marked as valid by the key in the first storage space to obtain a second number; Acquire the number of groups of the key data information as a first quantity; If it is determined that the first number is the same as the second number, the first mark is configured to be in a cleared state.

6. The smart card access authentication method according to claim 5, characterized in that: The first storage space stores the second quantity, and the method includes: detecting that the key validity flag of the key data information is configured as invalid, subtracting the number of the key data information whose key validity flag is configured as invalid from the second number; If it is detected that the second key data is stored in the first storage space, the second quantity is added to the quantity of the second key data.

7. A smart card access authentication device, characterized in that: include: A first module is configured to receive an authentication instruction and read out valid first key data from a first storage space, wherein the first storage space stores at least one set of key data information, each set of the key data information includes key data and a key validity mark, wherein the key validity mark is used to indicate whether the key data is valid; The second module is used to perform encryption calculation on the identity of the smart card through the first key data, obtain authentication response data and output it, and configure the key validity mark of the first key data to be invalid; A third module is used to determine that the key data marked as invalid by the key validity exists in the first storage space, and the current working state is an idle state, then generate new key data as second key data, and store the second key data in the first storage space; The first storage space stores a first authentication encryption type, which is used to characterize the type of authentication encryption algorithm for generating the key data. The smart card access authentication device is also used to determine whether the first file is updated, and then compare the second authentication encryption type stored in the first file with the first authentication encryption type, wherein the second authentication encryption type is used to characterize the type of authentication encryption algorithm of the authentication server; if it is determined that the first authentication encryption type is different from the second authentication encryption type, the key validity mark of all the key data information is configured to be invalid.

8. A computer device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the smart card access authentication method according to any one of claims 1 to 6.

9. A computer-readable storage medium, wherein program instructions are stored in the storage medium, and when the program instructions are executed by a processor, the smart card access authentication method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Pre-generating and buffering method for encryption card key pairs

    CN102006162A