Disclosure of Invention
The invention aims to provide a hierarchical management method and system for a smart card supply chain, which are used for solving the problems that the conventional management method cannot quickly respond to small-customer smart card service and has high management cost.
The smart card supply chain hierarchical management method provided by the invention for solving the technical problems comprises the following steps:
1) The primary management mechanism creates virtual clients, uniformly encrypts and initializes the blank smart cards in batches according to virtual client information, and constructs corresponding secondary client key authorization relations, wherein the encryption initialization refers to constructing a card space structure on the blank smart cards and carrying out general encryption on application files in the cards;
2) The primary management mechanism issues the smart card after encryption initialization and the corresponding secondary client key authorization relationship to the secondary management mechanism according to the order information of the secondary management mechanism;
3) The secondary management mechanism determines a final client, performs authorization authentication on the smart card according to a final client order and a secondary client key authorization relationship corresponding to the smart card allocated to the final client, and realizes smart card encryption activation by utilizing final client information;
4) And writing the activated smart card into the information of the final cardholder, and then performing key calculation to obtain the final client key.
Further, in the process of carrying out general encryption on the application file, when the ciphertext key corresponding to the application file is stored in the intelligent card, the key is stored in a manner of lacking one key, two keys or more keys, and when the intelligent card is encrypted and activated, the key lacking in the intelligent card is complemented according to the secondary client key authorization relationship.
And according to the primary client root key and the unique number of the intelligent card, adopting a set encryption algorithm to obtain an authentication key of the intelligent card, and when the authentication key is consistent with an authorization authentication key in the secondary client key authorization relationship, passing the intelligent card authentication.
Further, in step 3), when the smart card is a secure control card, after the smart card passes the authentication, the secure control card obtains the missing key by adopting a set encryption algorithm according to the secondary client root key and the service application code of the missing key, and writes or updates the key into the secure control card, when the smart card is a user card, after the smart card passes the authentication, the smart card obtains the missing key by adopting the set encryption algorithm according to the secondary client root key, the service application code of the missing key and the unique number of the secure control card matched with the user card, and writes or updates the key into the user card.
Further, the universal encryption is achieved in any mode that 1) encryption keys of all files of all applications in all smart cards are the same, 2) encryption keys of all files of all applications in each smart card are the same, but encryption keys of all smart cards are different, 3) encryption keys of all smart cards are different, and encryption keys of all files under all applications in each smart card are different.
The method has the advantages that the method can effectively carry out hierarchical management of the supply chain of the card, fully ensure the key control right of the primary management mechanism on the card while ensuring the key safety of the card, and greatly reduce the supply chain resource cost caused by card management while helping the secondary management mechanism to quickly respond to business opportunity demands of small and medium customer smart card businesses.
The invention provides a smart card supply chain hierarchical management system for solving the technical problems, which comprises a primary management mechanism, a secondary management mechanism and a final client, wherein the primary management mechanism is used for creating a virtual primary client, carrying out encryption initialization on empty smart cards in batches according to the primary client, and constructing a corresponding secondary client key authorization relationship for the batch of smart cards; according to order information of the secondary management mechanism, the primary management mechanism is used for issuing an intelligent card after encryption initialization and a corresponding secondary client key authorization relationship to the secondary management mechanism, wherein the encryption initialization is to construct a card space structure on a blank intelligent card and carry out general encryption on application files in the card;
The secondary management mechanism is used for determining a final client, carrying out authorization authentication on the smart card and realizing the encryption activation of the smart card by utilizing the final client information according to a final client order and a secondary client key authorization relationship corresponding to the smart card distributed to the final client, and carrying out key calculation after the final client user writes the activated smart card into the final cardholder information to obtain a final client key.
Further, in the process of carrying out general encryption on the application file, when the ciphertext key corresponding to the application file is stored in the intelligent card, the key is stored in a manner of lacking one key, two keys or more keys, and when the intelligent card is encrypted and activated, the key lacking in the intelligent card is complemented according to the secondary client key authorization relationship.
And according to the primary client root key and the unique number of the intelligent card, adopting a set encryption algorithm to obtain an authentication key of the intelligent card, and when the authentication key is consistent with an authorization authentication key in the secondary client key authorization relationship, passing the intelligent card authentication.
Further, in step 3), when the smart card is a secure control card, after the smart card passes the authentication, the secure control card obtains the missing key by adopting a set encryption algorithm according to the secondary client root key and the service application code of the missing key, and writes or updates the key into the secure control card, when the smart card is a user card, after the smart card passes the authentication, the smart card obtains the missing key by adopting the set encryption algorithm according to the secondary client root key, the service application code of the missing key and the unique number of the secure control card matched with the user card, and writes or updates the key into the user card.
Further, the universal encryption is achieved in any mode that 1) encryption keys of all files of all applications in all smart cards are the same, 2) encryption keys of all files of all applications in each smart card are the same, but encryption keys of all smart cards are different, 3) encryption keys of all smart cards are different, and encryption keys of all files under all applications in each smart card are different.
The system has the beneficial effects that the system can effectively carry out the hierarchical management of the supply chain of the card, fully ensure the key control right of the primary management mechanism on the card while ensuring the key safety of the card, and greatly reduce the supply chain resource cost caused by card management while helping the secondary management mechanism to quickly respond to the business opportunity demands of small and medium customer smart card business.
Detailed Description
The following describes the embodiments of the present invention further with reference to the drawings.
The basic idea of the invention is that the supply chain of the smart card is managed in a grading way, a primary management mechanism carries out batch encryption initialization on the blank smart card according to one or more created virtual clients, establishes the key authorization relationship between the virtual clients and the secondary clients, then issues the key authorization relationship to the secondary management mechanism, and encrypts a final client into a final client key according to the key authorization relationship of the secondary clients by the secondary management mechanism. Therefore, the key control right of the primary management mechanism to the card is fully ensured while the security of the card key is ensured, the assistance secondary management mechanism rapidly responds to the business opportunity demand of the small-medium-sized customer smart card business, and meanwhile, the problem of supply chain resource cost caused by card management is also greatly reduced.
The invention relates to a hierarchical management method embodiment of a smart card supply chain
Based on the basic idea, as shown in fig. 2, the smart card supply chain hierarchical management method of the present embodiment includes:
1) The primary management mechanism creates virtual clients, uniformly encrypts and initializes the blank smart cards in batches according to virtual client information, and constructs corresponding secondary client key authorization relations, wherein the encryption initialization refers to constructing a card space structure on the blank smart cards and carrying out general encryption on application files in the cards;
2) The primary management mechanism issues the smart card after encryption initialization and the corresponding secondary client key authorization relationship to the secondary management mechanism according to the order information of the secondary management mechanism;
3) The secondary management mechanism determines a final client, performs authorization authentication on the smart card according to a final client order and a secondary client key authorization relationship corresponding to the smart card allocated to the final client, and realizes smart card encryption activation by utilizing final client information;
4) And writing the activated smart card into the information of the final cardholder, and then performing key calculation to obtain the final client key.
The smart card includes an M1 card (non-contact IC card, NXP Mifare1 series), a CPU card, a PSAM card (Pin Secure Access Module Card), an ESAM card (Embedded SecureAccess Module Card), a mobile NFC card, a SE card (Secure Element), and the like.
The primary management mechanism creates one or more virtual clients, namely primary clients for short, wherein the information of the primary clients comprises client IDs, client names and secondary client key authorization relations, the secondary clients are secondary clients which are developed in batches by the secondary management mechanism based on primary client authorization, namely final clients, and the final client information comprises the primary client IDs, the secondary client names and the secondary client key authorization relations.
As a preferred embodiment, the secondary key authorization relationship includes an authorization authentication key, an authorization quantity, and an authorization validity period. The authorization authentication key is used for verifying the correctness of the smart card key issued by the primary management mechanism, and is calculated according to the primary client factor, the secondary client factor and the card characteristic information of the smart card and a setting algorithm. The algorithm of the authorized authentication key is consistent with the existing traditional standard algorithm, and symmetric algorithms such as 3DES, SM4 and the like can be adopted. The authorized amount is used to control the number of final customers that the secondary management authority is allowed to create.
When the encryption initialization is carried out on the blank smart card, general encryption is usually carried out on application files of various smart card structures, and a general encryption key is stored in the smart card. The universal encryption can be realized in any mode that 1) the encryption keys of all files of all applications in all smart cards are the same, 2) the encryption keys of all files of all applications in each smart card are the same, but the encryption keys of all smart cards are different, 3) the encryption keys of all smart cards are different, and the encryption keys of all files under all applications in each smart card are different. The algorithm involved in the key value calculation process is mainly symmetric algorithms 3DES and SM4, and a card characteristic value hash algorithm is adopted. The feature value includes a card unique number (card unique number), a card custom number (ASN), an application number, a file number, and the like.
In order to achieve both security and computational complexity, the present embodiment preferably uses 2) general encryption.
The smart cards comprise a user card and a security control card, wherein the user card comprises an M1 card, a CPU card, an NFC card, a SIM card and the like, and application files of the user card after initialization comprise a CPU card file and a sector file. The security control card is generally a PSAM card, an ESAM card, an SE card and the like, is used for storing security information such as an encryption algorithm, a secret key, a certificate and the like, realizes functions such as security authentication, decryption, digital signature and the like, and is mainly used in the fields such as commercial POS machines, network point terminals, direct connection terminals, public transportation systems, mobile payment and the like. The user card and the security control card are generally matched for use, and one security control card usually corresponds to a plurality of user cards. For example, in campus cards, the card held by the student is a user card, and the security control card is arranged in terminal machines such as a canteen card swiping machine, a water-saving device of a water house, a POS machine of a campus supermarket and the like, so as to read and write data of the card. The security control card in this embodiment is used for storing the ciphertext key corresponding to the application file of the user card, and is used in cooperation with the user card.
In order to ensure the security of the smart card and prevent unauthorized client strings from using, in the embodiment, when the space structure of the card and general encryption are constructed on the user card according to standard logic, one, two or more keys of key application files are deliberately lacked, while when the security control card stores the ciphertext keys corresponding to the application files of the user card, the stored ciphertext keys are not complete, and one, two or more key keys are lacked. Therefore, the user who obtains the user card and the corresponding security control card needs to be authenticated by key authorization, and the key which is lack in the user card and the key which is lack in the security control card are complemented so as to be normally used.
In this embodiment, when 1 primary client is used, after initializing the blank smart card according to the unified client encryption, the primary management mechanism constructs a corresponding secondary client key authorization relationship, and then issues the smart card and the corresponding secondary client key authorization relationship to each secondary management mechanism according to order information of the secondary management mechanism; after the secondary management mechanism determines the final customer, the smart card (user card and corresponding security control card) and the corresponding secondary customer key authorization relationship are distributed to the final customer according to the final customer order, and encryption activation is carried out on the final customer side, or the secondary management mechanism encrypts and activates the corresponding quantity of smart cards according to the final customer order and distributes the smart cards to the final customer.
Before the smart card assigned to the final client is encrypted and activated, the smart card authorization authentication is performed according to the second-level key authorization relationship, and the intermediate key which is generally encrypted by the first-level client is hashed by the first-level client root key. The secondary key authorization relationship contains the primary client root key, so that hash verification can be performed according to card characteristic information. The method for authenticating the smart card authorization comprises the steps of obtaining an authentication key of the smart card by adopting a set encryption algorithm according to a primary client root key and a unique number of the smart card, authenticating the smart card by using the authentication key, and considering that the smart card authentication passes when the authentication key obtained by calculation is consistent with an authorization authentication key stored in the secondary authorization relationship.
And when encryption activation is carried out, according to the secondary key authorization relationship, the key keys which are absent in the user card and the security control card are obtained through calculation by a set algorithm, and the user card and the security control card are updated and complemented. The smart card comprises a user card and a matched security control card, and when the smart card is the security control card, as a preferred implementation manner, after the security control card passes the authentication, the security control card uses a set encryption algorithm to obtain the missing key according to the service application code of the secondary client root key and the missing key, and writes or updates the key into the security control card. When the smart card is a user card, after the user card passes the authentication, the missing key is obtained by adopting a set encryption algorithm according to the secondary client root key, the service application code of the missing key and the unique number of the security control card matched with the user card, and the key is written into or updated to the user card. Among them, the set encryption algorithm is preferably a symmetric encryption algorithm such as 3DES and SM 4.
In the above method for authenticating and key supplementing the security control card and the user card, the key difference between the security control card and the user card is N (N is preferably 1, but may also be 2 or 3), and the algorithms used for the two card supplementing must be consistent. The key updating method belongs to industry standard specifications, and reference is made to PBOC specifications, which are not described in detail herein.
The authentication and key completion method of this embodiment is further illustrated below, assuming that the primary client root key included in the secondary key authorization relationship is a RootKey1, the secondary client root key included is a RootKey2, the PSAM card encrypted by the primary client is PsamCard, the unique number of the PSAM card is ASN1, the PSAM card lacks the PSAM01 key, and the key service application number is App01, and then the method for completing the PSAM01 key of the PSAM card is as follows:
1) Hashing the RootKey1+ASNS1 by adopting a 3DES/SM4 algorithm to obtain an authentication key of the PSAM card, authenticating the PSAM card by using the authentication key (the authentication key is considered to pass when the authentication key is consistent with an authorization authentication key in a secondary client authorization relationship), and performing the following step 2) after the authentication is passed;
2) And hashing the RootKey2+App 01 by adopting a 3DES/SM4 algorithm to obtain a final key of the application file, namely a missing Psam01 number key, and writing or updating the final key value into the PSAM card.
Assuming that the User card encrypted from the primary client is UserCard <1 >, the unique number of the User card is ASN2, the User card lacks a User01 number key, the key service application number is App01, and the complement method of the User card User01 number key is as follows:
1) Hashing the RootKey1+ASN2 by adopting a 3DES/SM4 algorithm to obtain an authentication key of the user card, authenticating the user card by using the authentication key (the authentication key is considered to pass when the authentication key is consistent with an authorization authentication key in a secondary client authorization relationship), and performing the following step 2) after the authentication is passed;
2) And hashing the RootKey2+App01+ASN2 by adopting a 3DES/SM4 algorithm to obtain a final key of the application file, namely a missing User01 number key, and writing or updating the final key value into the User card.
In the above method for complementing the PSAM card and the user card, the key difference between the PSAM card and the user card is N (N is preferably 1, but may also be 2 or 3), and the algorithms adopted for complementing the two cards must be consistent. The key updating method belongs to industry standard specifications, and reference is made to PBOC specifications, which are not described in detail herein.
And then, the completed user card is subjected to personalized treatment, including personalized user card information, such as writing the basic information of the end user into the card, and the key is recalculated and authenticated by the security control card according to the basic information of the end user to obtain the key of the end user, and finally, the release of the smart card to the end user is completed.
In this embodiment, the step of performing the two-stage encryption activation on the smart card and the step of performing the personalization processing on the user card may be performed by the secondary management mechanism and the final client, respectively, or may be performed by being combined with each other at the final client side.
In this embodiment, the primary management mechanism performs blank smart card inventory management. The secondary management mechanism manages the intelligent card stock issued by the primary management mechanism, and when the stock of the secondary management mechanism is insufficient, the primary management mechanism issues the intelligent card after encryption initialization to the secondary management mechanism according to the quantity in the order application by submitting the order application to the primary management mechanism.
The smart card supply chain hierarchical management system embodiment of the invention
As shown in fig. 1, the management system comprises a primary management mechanism, a secondary management mechanism and a final client, wherein the primary management mechanism is used for creating a virtual primary client, carrying out encryption initialization on the blank smart cards in batches according to the primary client, and constructing a corresponding secondary client key authorization relationship for the batch smart cards; according to order information of the secondary management mechanism, the primary management mechanism is used for issuing an intelligent card after encryption initialization and a corresponding secondary client key authorization relationship to the secondary management mechanism, wherein the encryption initialization is to construct a card space structure on a blank intelligent card and carry out general encryption on application files in the card;
The secondary management mechanism is used for determining a final client, carrying out authorization authentication on the smart card according to a final client order and a secondary client key authorization relationship corresponding to the smart card allocated to the final client, and realizing the encryption activation of the smart card by utilizing final client information, wherein a final client user writes the activated smart card into final cardholder information and then carries out key calculation to obtain a final client key.
The specific functions of the primary management mechanism, the secondary management mechanism and the end customer are referred to above in the management method embodiments and will not be described in detail herein.