OFD file processing method and device, medium and product

By parsing and encrypting the OFD file, and using the preset symmetric key to store it in the smart card, the problem that the electronic ID card in the smart card is easy to be stolen is solved, and higher security and protection effects are achieved.

CN118586027APending Publication Date: 2024-09-03CHINA UNITED NETWORK COMM GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410622060.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Electronic ID cards stored in smart cards are vulnerable to virus attacks in smart terminals, leading to user information leakage.

Method used

By importing the OFD file sent by the server for analysis and processing, multiple entry identification data are generated, and the data is encrypted using the preset symmetric key jointly determined by the terminal device and the smart card, and the encrypted data is sent to the smart card for decryption and storage to ensure electronic Secure storage of ID cards.

Benefits of technology

It improves the security of OFD files, prevents theft of electronic ID cards and user information leakage caused by virus attacks, and enhances storage security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586027A
    Figure CN118586027A
Patent Text Reader

Abstract

The invention provides an OFD file processing method and device, a medium and a product. The method comprises the following steps: importing an OFD file sent by a server, and analyzing the OFD file to obtain a plurality of item identification data; a preset symmetric key is adopted to encrypt the multiple pieces of entry identification data to obtain first encrypted data, and the preset symmetric key is jointly determined by the terminal device and the intelligent card; and sending the first encrypted data to a smart card, so that the smart card adopts the preset symmetric key to decrypt the first encrypted data, and stores the plurality of item identification data. According to the method provided by the invention, the storage security of the OFD file can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of file processing, and in particular to an OFD file processing method, device, medium and product. Background Art

[0002] The second-generation ID cards currently in use are equipped with a non-contact chip that cannot be copied and has a high degree of anti-counterfeiting. Therefore, the personal information stored in the chip can only be read after the ID card information reader and the chip have been authenticated for security. Among them, the personal information includes name, address, photo, etc.

[0003] Due to the readability and security of the second-generation ID card, it has been widely used in high-speed rail, hotel check-in, scenic spot visits, etc., which greatly facilitates people's lives. However, when people travel, they may lose or forget to bring their ID cards, which may hinder their travel.

[0004] In order to avoid the above-mentioned problem of travel obstruction caused by losing or forgetting to carry the identity card, the prior art can also obtain user information through a mobile phone application, and after the server where the application is located authenticates the user information, the electronic identity card in OFD (Open Fixed-layout Document, referred to as OFD) format stored in the server of the mobile phone application is sent to the user terminal via the Internet. The user terminal saves the electronic identity card to the smart card. However, if the user terminal is attacked by a virus, it is easy to cause the electronic identity card stored in the smart card to be stolen, thereby causing a technical problem of leakage of the user's personal information. Summary of the invention

[0005] The present application provides an OFD file processing method, device, medium and product to solve the technical problem that the electronic ID card stored in the smart card is vulnerable to virus attacks in the smart terminal, causing the electronic ID card to be stolen, thereby causing the user information to be leaked.

[0006] In a first aspect, the present application provides an OFD file processing method, which is applied to a terminal device, comprising:

[0007] Importing the OFD file sent by the server, and parsing the OFD file to obtain multiple entry identification data;

[0008] Encrypting the plurality of item identification data respectively using a preset symmetric key to obtain first encrypted data, wherein the preset symmetric key is jointly determined by the terminal device and the smart card;

[0009] The first encrypted data is sent to a smart card, so that the smart card uses the preset symmetric key to decrypt the first encrypted data and stores the multiple entry identification data.

[0010] Optionally, in the method as described above, before encrypting the plurality of item identification data respectively using a preset symmetric key to obtain the first encrypted data, the method further comprises:

[0011] Generate a first random number, and send the first random number to the smart card;

[0012] Combining the first random number, the second random number fed back by the smart card, and the identification information of the smart card to obtain combined data;

[0013] The combined data is encrypted to obtain the preset symmetric key.

[0014] Optionally, in the method as described above, the parsing of the OFD file to obtain a plurality of entry identification data includes:

[0015] Converting the OFD file to obtain encoded data;

[0016] According to a preset number of bytes, matching processing is performed on the encoded data and a plurality of preset entry identifiers to obtain a matching result;

[0017] The plurality of item identification data are determined according to the matching result, wherein the parsing order of the plurality of item identification data is different, and the item identification data include item identifications and file contents corresponding to the item identifications.

[0018] Optionally, in the method as described above, the first encrypted data includes: second encrypted data corresponding to a plurality of entry identification data, and sending the first encrypted data to the smart card includes:

[0019] Establishing a secure channel with the smart card, and sending file attributes of the OFD file to the smart card through the secure channel, wherein the file attributes are used to indicate the file size, the number of entry identification data, and the file hash value of the OFD file;

[0020] The plurality of second encrypted data are sent to the smart card in sequence according to the parsing order of the plurality of second encrypted data.

[0021] In a second aspect, the present application provides a method for processing an OFD file, which is applied to a smart card, comprising:

[0022] Receiving first encrypted data sent by a terminal device, where the first encrypted data is obtained by the terminal device encrypting a plurality of item identification data using a preset symmetric encryption key, where the plurality of item identification data is obtained by the terminal device parsing an OFD file;

[0023] The first encrypted data is decrypted using the preset symmetric encryption key to obtain the multiple entry identification data, and the multiple entry identification data are stored.

[0024] Optionally, in the method as described above, the first encrypted data includes: second encrypted data corresponding to a plurality of entry identification data, and the first encrypted data sent by the receiving terminal device includes:

[0025] Establish a secure channel with the terminal device, and receive file attributes of the OFD file and multiple second encrypted data in sequence through the secure channel, wherein the file attributes are used to indicate the file size of the OFD file, the number of entry identification data and the file hash value, and the sending order of the multiple second encrypted data is the same as the parsing order of the multiple entry identification data.

[0026] Optionally, in the method as described above, storing the plurality of entry identification data comprises:

[0027] For any entry identification data among the plurality of entry identification data, determining whether the data size of the entry identification data reaches the cache size of the file cache area;

[0028] If so, after receiving the first sub-item identification data of the cache size in the file cache area, encrypt the first sub-item identification data using a private key and store the first sub-item identification data;

[0029] Clearing the file cache area, and continuing to receive the entry identification data through the file cache area until the storage of the entry identification data is complete;

[0030] If not, after receiving the entry identification data in the file buffer area, the entry identification data is encrypted with a private key and stored.

[0031] In a third aspect, the present application provides a terminal device for processing an OFD file, comprising:

[0032] A processing module, used for importing the OFD file sent by the server, and parsing the OFD file to obtain a plurality of entry identification data;

[0033] The processing module is further used to encrypt the plurality of item identification data respectively using a preset symmetric key to obtain first encrypted data, wherein the preset symmetric key is jointly determined by the terminal device and the smart card;

[0034] The sending module is used to send the first encrypted data to a smart card, so that the smart card uses the preset symmetric key to decrypt the first encrypted data and store the multiple entry identification data.

[0035] In a fourth aspect, the present application provides a smart card device for processing an OFD file, comprising:

[0036] a receiving module, configured to receive first encrypted data sent by a terminal device, wherein the first encrypted data is obtained by the terminal device encrypting a plurality of item identification data using a preset symmetric encryption key, and the plurality of item identification data is obtained by the terminal device parsing an OFD file;

[0037] The control module is used to use the preset symmetric encryption key to decrypt the first encrypted data to obtain the multiple entry identification data and store the multiple entry identification data.

[0038] In a fifth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspect or the second aspect.

[0039] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect or the second aspect.

[0040] The present application provides a method, device, medium and product for processing OFD files. The method imports an OFD file sent by a server and parses the OFD file to obtain multiple entry identification data; uses a preset symmetric key to encrypt the multiple entry identification data respectively to obtain first encrypted data, and the preset symmetric key is jointly determined by the terminal device and the smart card; sends the first encrypted data to the smart card, so that the smart card uses the preset symmetric key to decrypt the first encrypted data, and stores the multiple entry identification data, thereby realizing the secure storage of the electronic identity card. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] Figure 1 A structural diagram of a first embodiment of an OFD file processing system provided in an embodiment of the present application;

[0043] Figure 2 A flowchart of a method for processing an OFD file provided in an embodiment of the present application;

[0044] Figure 3 A flowchart of a second embodiment of a method for processing an OFD file provided in an embodiment of the present application;

[0045] Figure 4 A flowchart of a third embodiment of a method for processing an OFD file provided in an embodiment of the present application;

[0046] Figure 5 A flowchart of a fourth embodiment of a method for processing an OFD file provided in an embodiment of the present application;

[0047] Figure 6 A flowchart of a fifth embodiment of a method for processing an OFD file provided in an embodiment of the present application;

[0048] Figure 7 A flowchart of a sixth embodiment of a method for processing an OFD file provided in an embodiment of the present application;

[0049] Figure 8 A flowchart of Embodiment 7 of a method for processing an OFD file provided in an embodiment of the present application;

[0050] Fig. 9 A schematic diagram of the structure of a terminal device embodiment 1 provided in an embodiment of the present application;

[0051] Fig.10 A schematic diagram of the structure of a smart card embodiment 1 provided in an embodiment of the present application.

[0052] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0053] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0054] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein.

[0055] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0056] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0057] First, the names involved in this application are explained:

[0058] OFD file: On October 14, 2016, my country issued the "Electronic Document Storage and Exchange Format Document" GB / T33190-2016 standard. The introduction of this standard has enabled my country to have its own independent format and technology for the first time, which is conducive to the integration of the entire industry and promotes the rapid development of related applications. As one of my country's independent electronic format document standards, OFD files have technical characteristics such as high readability, easy expansion, and support for separate expansion. They are widely used in the e-government industry.

[0059] Smart card: A general term for plastic cards with microchips embedded in them. Some smart cards contain a microelectronic chip, and smart cards need to use a reader / writer for data exchange. Smart cards are equipped with CPU, RAM and I / O, and can process a large amount of data without interfering with the work of the host CPU. Smart cards can also filter out erroneous data to reduce the burden on the host CPU. It is suitable for occasions with a large number of ports and faster communication speeds. The integrated circuit in the card includes a central processing unit, a programmable read-only memory, a random access memory, and an in-card operating system solidified in the read-only memory. The data in the card is divided into external reading and internal processing parts.

[0060] SM3: This encryption algorithm is a cryptographic hash function standard. The relevant standard is "GM / T 0004-2012 SM3 Cryptographic Hash Algorithm". In the commercial cryptographic system, SM3 is mainly used for digital signature and verification, message authentication code generation and verification, random number generation, etc. Its algorithm is public.

[0061] SM4: is a block cipher standard, and the relevant standard is "GM / T 0002-2012 SM4 Block Cipher Algorithm". In the commercial cryptographic system, SM4 is mainly used for data encryption. Its algorithm is public, and the block length and key length are both 128 bits. The encryption algorithm and key expansion algorithm both use a 32-round nonlinear iterative structure, and the S-box is a fixed 8-bit input and 8-bit output.

[0062] SHA (Secure Hash Algorithm, SHA for short) 256: is a secure hash algorithm. For any length of message, SHA256 will generate a 256-bit hash value, called a message digest. This digest is equivalent to an array of 32 bytes in length, a total of 256 bits, usually represented by a hexadecimal string of length 64, where 1 byte = 8 bits, and the length of a hexadecimal character is 4 bits.

[0063] ZIP file format: ZIP file format is a file format for data compression and document storage. ZIP usually uses the suffix ".zip" and its MIME format is application / zip. ZIP files can be roughly divided into three parts: data storage area, central directory area and a directory end marker. Among them, the data storage area contains one or more file entities. The file entity usually starts with the identifier 50 4B 03 04, which is often an important criterion for us to determine whether the file is a compressed package. The file entity records various information after the file is compressed. Each compressed file in the compressed package will correspond to a file entity. The central directory area mainly records the relevant information of the file directory, such as file comments, size, file name, etc. It also contains the file header of all compressed files, usually starting with the identifier 50 4b 01 02. The directory end marker mainly records the offset of the starting volume number of the compressed package, which mainly determines the directory structure of the file and the relevant information of the compressed package, and starts with 50 4b 05 06.

[0064] File hash value: It is a set of binary values ​​obtained by encrypting the file content. It is mainly used for file verification or signature. Common file hash value calculation methods include: MD5, SHA-1, SHA-256, etc. These methods convert file content into hash values ​​of different lengths according to different algorithms.

[0065] ECB (Electronic Code Book mode, referred to as ECB): is the most direct and simple message encryption method. In ECB mode, after plaintext is encrypted, the ciphertext will be directly obtained, and after the ciphertext is decrypted, the plaintext will also be directly obtained.

[0066] PKCS5Padding: used for data padding in the encryption and decryption process, it is a data block padding algorithm used in the data encryption standard DES. The basic idea of ​​this padding algorithm is to fill the current data block with additional data when the data block length is insufficient, so as to meet the encryption algorithm's requirements for the data block length. In this algorithm, the value of each padding byte is equal to the number of bytes filled.

[0067] Global Security Platform Organization Security Channel: It is usually divided into two parts. The first part is based on the 3DES CBC algorithm to initialize the security channel and perform two-way authentication. The protocol supports two forms of fixed keys. One form has only one fixed key: the security channel basic key, or the other form has three fixed keys: the security channel encryption key, the security channel MAC key and the data encryption key. Three process keys can be derived from the above fixed keys: C-MAC process key, R-MAC process key and encryption process key. The key derivation is generated in the form of fixed key encryption and key dispersion factor.

[0068] In the prior art, after the application in the user terminal obtains the user's facial information and ID number and uploads them to the server of the application, the server matches the facial information with the facial information corresponding to the ID number in the server. When the match is successful, the electronic ID card in OFD format is obtained and sent to the user's mobile phone. After the smart phone receives the electronic ID card, it sends the electronic ID card to the smart card, and the smart card stores the electronic ID card. Since the smart phone is in the mobile Internet environment, it is vulnerable to virus attacks, resulting in the electronic ID card stored in the smart card being stolen, which in turn leads to the technical problem of the user's personal information being leaked.

[0069] Based on this, in order to solve the above technical problems, the technical concept of the present application is: how to provide a new OFD file processing method to achieve secure storage of OFD files.

[0070] Figure 1 A structural diagram of an OFD file processing system embodiment 1 provided in the present application is shown in FIG. Figure 1 As shown, the system includes: a server 11, a terminal device 12, and a smart card 13.

[0071] The terminal device 12 imports the OFD file sent by the server 11, and parses the OFD file to obtain multiple entry identification data, and generates a symmetric key through interactive information between the terminal device 12 and the smart card 13. Then, the terminal device 12 uses the symmetric key to encrypt the multiple entry identification data to obtain first encrypted data, and then sends the first encrypted data to the smart card 13.

[0072] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0073] Figure 2 A flowchart of a method for processing an OFD file provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the execution subject of this embodiment is a terminal device. Specifically, the method includes:

[0074] S201: Importing the OFD file sent by the server, and parsing the OFD file to obtain a plurality of item identification data.

[0075] In this embodiment, it can be understood that the OFD file can be an electronic ID card, an electronic certificate, a call data file, an electronic document, etc.

[0076] In this embodiment, the OFD file is composed of multiple parts. After parsing the OFD file, information of each part of the OFD file is obtained.

[0077] S202: Using a preset symmetric key to encrypt a plurality of item identification data respectively to obtain first encrypted data.

[0078] In this embodiment, the preset symmetric key is jointly determined by the terminal device and the smart card.

[0079] In this embodiment, the terminal device generates first data and sends it to the smart card. The smart card generates second data based on the first data and sends the second data to the terminal device. The terminal device and the smart card generate a preset symmetric key based on the second data.

[0080] In this embodiment, for example, a preset symmetric key is used, and encryption algorithms such as SM4, ECB, and PKCS5Padding are used to encrypt multiple entry identification data respectively to obtain first encrypted data.

[0081] S203: Send the first encrypted data to the smart card, so that the smart card uses a preset symmetric key to decrypt the first encrypted data and stores a plurality of entry identification data.

[0082] In this embodiment, after the terminal device sends the first encrypted data to the smart card, the smart card uses a preset symmetric key to decrypt the first encrypted data to obtain multiple entry identification data, and stores the multiple entry identification data in sequence.

[0083] In this embodiment, the OFD file sent by the server is imported, and the OFD file is parsed to obtain multiple entry identification data; the multiple entry identification data are encrypted respectively using a preset symmetric key to obtain first encrypted data; the first encrypted data is sent to the smart card, so that the smart card uses the preset symmetric key to decrypt the first encrypted data and store the multiple entry identification data. Compared with the prior art in which the electronic certificate in the smart card is stolen after the terminal device is attacked by a virus, thereby causing personal information to be leaked, the present application parses the received OFD file to obtain multiple entry identification data, and uses the preset symmetric encryption key to encrypt the multiple entry identification data respectively to obtain the first encrypted data, which is then sent to the smart card. After the smart card uses the preset symmetric key to decrypt the first encrypted data, the multiple entry identification data are stored, thereby improving the security of OFD file storage.

[0084] Figure 3 The flowchart of the second embodiment of the OFD file processing method provided in the present application is based on the above embodiment. Figure 3 As shown, before step S202, the method further includes:

[0085] S301: Generate a first random number, and send the first random number to a smart card.

[0086] In this embodiment, a first random number of a preset length is generated according to a preset random number generation algorithm.

[0087] In this embodiment, for example, the terminal device generates a first random number of 876543218765ACFF according to a preset random number generation algorithm, and sends the first random number to the smart card.

[0088] S302: Combine the first random number, the second random number fed back by the smart card, and the identification information of the smart card to obtain combined data.

[0089] In this embodiment, after the smart card receives the first random number, it generates a second random number according to a preset random number generation algorithm, and sends the second random number and the identification information of the smart card to the terminal device. The terminal device combines the identification information of the smart card, the first random number, and the second random number into a character string.

[0090] In this embodiment, for example, the second random number is 11223344556677EE, and the identification information of the smart card is the ASCII code of the mobile phone number 12345678: 3133383132333435363738. After combining the identification information of the smart card, the first random number, and the second random number, the combined data obtained is: 3133383132333435363738876543218765ACFF11223344556677EE.

[0091] S303: Encrypt the combined data to obtain a preset symmetric key.

[0092] In this embodiment, the combined data is encrypted according to a preset encryption algorithm, and the encryption result is used as a preset symmetric key.

[0093] In this embodiment, for example, the preset encryption algorithm may be SM3 or SHA256 encryption algorithm.

[0094] In this embodiment, for example, the combined data is encrypted according to the SM3 encryption algorithm, and the encryption result is: 4E47F43B2CB95291AFA9DBDBEB6D11D51A95D3C71D1F441696A76C5E7B3D6F05, and the encryption result is used as the preset symmetric key.

[0095] In this embodiment, a first random number is generated and sent to a smart card; the first random number, a second random number fed back by the smart card, and identification information of the smart card are combined to obtain combined data; the combined data is encrypted to obtain a preset symmetric key, so that the terminal device and the smart card can jointly generate a key, thereby improving the security of OFD file encryption.

[0096] Figure 4 The flowchart of the third embodiment of the OFD file processing method provided in the present application is based on the above embodiment. Figure 4 As shown, a specific implementation of step S201 is:

[0097] S401: Import the OFD file sent by the server, and convert the OFD file to obtain encoded data.

[0098] In this embodiment, the OFD file is converted according to a preset conversion algorithm to obtain encoded data corresponding to the OFD file.

[0099] In this example, for example, the OFD file may be converted into a ZIP format to obtain a ZIP compressed package, and the ZIP compressed package may be converted into hexadecimal format to obtain hexadecimal data of the OFD file.

[0100] S402: According to a preset number of bytes, matching processing is performed on the encoded data and a plurality of preset entry identifiers to obtain a matching result.

[0101] In this embodiment, for example, the coded data and a plurality of preset entry identifiers are matched according to 4 bytes to obtain a matching result, wherein the plurality of preset entry identifiers may be 504B0304, 504B0102, 504B0505, and 504B0506.

[0102] S403: Determine multiple entry identification data according to the matching result.

[0103] In this embodiment, the parsing order of the plurality of item identification data is different, and the item identification data includes the item identification and the file content corresponding to the item identification.

[0104] In this embodiment, a plurality of entry identification data are determined according to the matching results and preset rules.

[0105] In this embodiment, for example, a plurality of entry identification data are determined according to the ZIP file format and the matching result.

[0106] In this embodiment, the OFD file sent by the server is imported, and the OFD file is converted to obtain encoded data; the encoded data and multiple preset entry identifiers are matched according to a preset number of bytes to obtain a matching result; based on the matching result, multiple entry identification data are determined to realize parsing of the OFD file into multiple entry identification data, thereby improving the security of OFD file storage.

[0107] Figure 5 The flowchart of the fourth embodiment of the OFD file processing method provided in the present application is based on the above embodiment. Figure 5 As shown, a specific implementation of step S203 is:

[0108] S501: Establish a secure channel with the smart card, and send the file attributes of the OFD file to the smart card through the secure channel.

[0109] In this embodiment, the file attributes include the file size of the OFD file, the number of entry identification data, and the file hash value.

[0110] In this embodiment, after the smart terminal and the smart card are encrypted and connected, the file attributes of the OFD file are sent to the smart card.

[0111] In this example, for example, a global security platform organization security channel is established between the smart terminal and the smart card, and the file attributes of the OFD file are sent to the smart card through the security channel.

[0112] S502: Send the plurality of second encrypted data to the smart card in sequence according to the parsing order of the plurality of second encrypted data.

[0113] In this embodiment, a secure channel is established with the smart card, and the file attributes of the OFD file are sent to the smart card through the secure channel; multiple second encrypted data are sent to the smart card in sequence according to the parsing order of the multiple second encrypted data, so as to improve the security of OFD file transmission between the terminal device and the smart card.

[0114] Figure 6 A flowchart of a fifth embodiment of a method for processing an OFD file provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the execution subject of this embodiment is a smart card. Specifically, the method includes:

[0115] S601: Receive first encrypted data sent by a terminal device.

[0116] In this embodiment, the first encrypted data is obtained by the terminal device encrypting a plurality of item identification data using a preset symmetric encryption key, and the plurality of item identification data is obtained by the terminal device parsing the OFD file.

[0117] S602: Using a preset symmetric encryption key to decrypt the first encrypted data, obtain a plurality of entry identification data, and store the plurality of entry identification data.

[0118] In this embodiment, a preset symmetric encryption key and a preset decryption algorithm are used to decrypt the first encrypted data to obtain a plurality of entry identification data, and the plurality of entry identification data are stored.

[0119] In this embodiment, for example, decryption algorithms such as SM4, ECB, and PKCS5Padding are used to decrypt the first encrypted data.

[0120] In this embodiment, first encrypted data sent by a terminal device is received; a preset symmetric encryption key is used to decrypt the first encrypted data to obtain multiple entry identification data, and the multiple entry identification data are stored. After receiving the first encrypted data sent by a terminal device, the present application uses a preset symmetric encryption key to decrypt the first encrypted data to obtain multiple entry identification data, and stores the multiple entry identification data to achieve secure storage of OFD files, thereby improving the security of OFD file storage.

[0121] Figure 7 The flowchart of the sixth embodiment of the OFD file processing method provided in the present application is based on the above embodiment. Figure 7 As shown, a specific implementation of step S601 is:

[0122] S701: Establish a secure channel with the terminal device, and sequentially receive file attributes of the OFD file and a plurality of second encrypted data through the secure channel.

[0123] In this embodiment, the file attribute is used to indicate the file size, the number of entry identification data and the file hash value of the OFD file, and the sending order of the plurality of second encrypted data is the same as the parsing order of the plurality of entry identification data.

[0124] In this embodiment, after the smart card establishes an encrypted connection with the terminal device, the file attributes of the OFD file and a plurality of second encrypted data are received in sequence through the encrypted connection.

[0125] In this embodiment, for example, the smart card and the terminal device establish a global security platform organization security channel, and receive the file attributes of the OFD file and a plurality of second encrypted data in sequence through the security channel.

[0126] In this embodiment, a secure channel is established with the terminal device, and the file attributes of the OFD file and a plurality of second encrypted data are received in sequence through the secure channel, thereby achieving secure reception of the OFD file.

[0127] Figure 8 The flowchart of Embodiment 7 of the OFD file processing method provided in the present application is based on the above embodiments. Figure 8 As shown, in step S602, a specific implementation method of storing multiple entry identification data is:

[0128] S801: for any entry identification data among the multiple entry identification data, determine whether the data size of the entry identification data reaches the cache size of the file cache area; if so, execute S802 and S803, if not, execute S804.

[0129] In this embodiment, for any entry identification data among the plurality of entry identification data, it is first determined whether the data size of the entry identification data reaches the cache size of the file cache area of ​​the smart card.

[0130] In this embodiment, for example, the cache size of the file cache area of ​​the smart card may be 8 KB or 16 KB.

[0131] S802: After receiving the first sub-entry identification data of the cache size in the file cache area, encrypt the first sub-entry identification data using a private key and store the first sub-entry identification data.

[0132] In this embodiment, in the file cache, bytes of the entry identification data are stored one by one in the file cache. When the cache is full, the first sub-entry identification data in the cache is encrypted with a private key and the first sub-entry identification data is stored.

[0133] S803: Clear the file cache area, and continue to receive the entry identification data through the file cache area until the entry identification data is completely stored.

[0134] In this embodiment, the data in the file cache area is deleted, and the entry identification data continues to be received through the file cache area until the storage of the entry identification data is completed.

[0135] S804: After receiving the entry identification data in the file buffer area, encrypt the entry identification data using a private key and store the entry identification data.

[0136] In this embodiment, when the data size of the entry identification data does not reach the cache size of the file cache, after the file cache receives the entry identification data, the private key is used to encrypt the entry identification data and store the entry identification data.

[0137] In this embodiment, for any entry identification data among multiple entry identification data, it is determined whether the data size of the entry identification data reaches the cache size of the file cache area; after the file cache area receives the first sub-entry identification data of the cache size, the first sub-entry identification data is encrypted using a private key and the first sub-entry identification data is stored; the file cache area is cleared, and the entry identification data continues to be received through the file cache area until the storage of the entry identification data is completed; after the file cache area receives the entry identification data, the entry identification data is encrypted using a private key and the entry identification data is stored to realize the storage of the OFD file.

[0138] Fig. 9 A schematic diagram of the structure of a terminal device embodiment 1 provided in the present application is shown in FIG. Fig. 9As shown, the terminal device includes: a processing module 91 and a sending module 92. Among them,

[0139] The processing module 91 is used to import the OFD file sent by the server, and parse the OFD file to obtain multiple item identification data; the processing module 91 is also used to encrypt the multiple item identification data respectively using a preset symmetric key to obtain first encrypted data, and the preset symmetric key is jointly determined by the terminal device and the smart card;

[0140] The sending module 92 is used to send the first encrypted data to the smart card, so that the smart card uses a preset symmetric key to decrypt the first encrypted data and store a plurality of entry identification data.

[0141] A terminal device provided in this embodiment can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0142] Fig.10 A schematic diagram of the structure of a smart card embodiment 1 provided in the present application is shown in FIG. Fig.10 As shown, the smart card includes: a receiving module 101 and a control module 102. Among them,

[0143] The receiving module 101 is used to receive first encrypted data sent by a terminal device. The first encrypted data is obtained by the terminal device encrypting multiple entry identification data using a preset symmetric encryption key. The multiple entry identification data is obtained by the terminal device parsing the OFD file.

[0144] The control module 102 is used to use a preset symmetric encryption key to decrypt the first encrypted data, obtain a plurality of entry identification data, and store the plurality of entry identification data.

[0145] A smart card provided in this embodiment can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described again here.

[0146] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the embodiment shown in the above method is implemented, which will not be repeated here.

[0147] The embodiment of the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the embodiment shown in the above method is implemented.

[0148] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0149] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0150] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0151] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0152] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.

[0153] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0154] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0155] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0156] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for processing OFD files, It is characterized in that Applied to terminal equipment, including: Importing the OFD file sent by the server, and parsing the OFD file to obtain multiple entry identification data; Encrypting the plurality of item identification data respectively using a preset symmetric key to obtain first encrypted data, wherein the preset symmetric key is jointly determined by the terminal device and the smart card; The first encrypted data is sent to a smart card, so that the smart card uses the preset symmetric key to decrypt the first encrypted data and stores the multiple entry identification data.

2. The method according to claim 1, It is characterized in that Before the plurality of item identification data are encrypted respectively using a preset symmetric key to obtain the first encrypted data, the method further includes: Generate a first random number, and send the first random number to the smart card; Combining the first random number, the second random number fed back by the smart card, and the identification information of the smart card to obtain combined data; The combined data is encrypted to obtain the preset symmetric key.

3. The method according to claim 1, It is characterized in that The OFD file is parsed to obtain a plurality of item identification data, including: Converting the OFD file to obtain encoded data; According to a preset number of bytes, matching processing is performed on the encoded data and a plurality of preset entry identifiers to obtain a matching result; The plurality of item identification data are determined according to the matching result, wherein the parsing order of the plurality of item identification data is different, and the item identification data include item identifications and file contents corresponding to the item identifications.

4. The method according to claim 1, It is characterized in that The first encrypted data includes: second encrypted data corresponding to a plurality of entry identification data, and sending the first encrypted data to the smart card includes: Establishing a secure channel with the smart card, and sending file attributes of the OFD file to the smart card through the secure channel, wherein the file attributes are used to indicate the file size, the number of entry identification data, and the file hash value of the OFD file; The plurality of second encrypted data are sent to the smart card in sequence according to the parsing order of the plurality of second encrypted data.

5. A method for processing OFD files, It is characterized in that Applied to smart cards, including: Receiving first encrypted data sent by a terminal device, where the first encrypted data is obtained by the terminal device encrypting a plurality of item identification data using a preset symmetric encryption key, where the plurality of item identification data is obtained by the terminal device parsing an OFD file; The first encrypted data is decrypted using the preset symmetric encryption key to obtain the multiple entry identification data, and the multiple entry identification data are stored.

6. The method according to claim 5, It is characterized in that The first encrypted data includes: second encrypted data corresponding to a plurality of entry identification data, and the first encrypted data sent by the receiving terminal device includes: Establish a secure channel with the terminal device, and receive file attributes of the OFD file and multiple second encrypted data in sequence through the secure channel, wherein the file attributes are used to indicate the file size of the OFD file, the number of entry identification data and the file hash value, and the sending order of the multiple second encrypted data is the same as the parsing order of the multiple entry identification data.

7. The method according to claim 6, It is characterized in that The storing of the plurality of entry identification data comprises: For any entry identification data among the plurality of entry identification data, determining whether the data size of the entry identification data reaches the cache size of the file cache area; If so, after receiving the first sub-item identification data of the cache size in the file cache area, encrypt the first sub-item identification data using a private key and store the first sub-item identification data; Clearing the file cache area, and continuing to receive the entry identification data through the file cache area until the storage of the entry identification data is complete; If not, after receiving the entry identification data in the file buffer area, the entry identification data is encrypted with a private key and stored.

8. A terminal device, It is characterized in that include: A processing module, used for importing the OFD file sent by the server, and parsing the OFD file to obtain a plurality of entry identification data; The processing module is further used to encrypt the plurality of item identification data respectively using a preset symmetric key to obtain first encrypted data, wherein the preset symmetric key is jointly determined by the terminal device and the smart card; The sending module is used to send the first encrypted data to a smart card, so that the smart card uses the preset symmetric key to decrypt the first encrypted data and store the multiple entry identification data.

9. A smart card, It is characterized in that include: a receiving module, configured to receive first encrypted data sent by a terminal device, wherein the first encrypted data is obtained by the terminal device encrypting a plurality of item identification data using a preset symmetric encryption key, and the plurality of item identification data is obtained by the terminal device parsing an OFD file; The control module is used to use the preset symmetric encryption key to decrypt the first encrypted data to obtain the multiple entry identification data and store the multiple entry identification data.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, It is characterized in that The method comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.