NFC tag verification data obfuscation method, restoration method and related device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-13
- Publication Date
- 2026-08-11
AI Technical Summary
即便服务器端的校验逻辑复杂,攻击者仍可复制或伪造出一套能够通过中间传输环节的有效数据包,从而绕过前端验证,实现标签的仿冒与非法流通,使得NFC标签验证系统的整体安全性低
本发明提供的NFC标签验证数据混淆方法,通过先将原始的令牌数据和加密校验码按预设长度划分为多个数据段,并对每个数据段进行字符逆序混淆处理,再将所有处理后的数据段进行整体的逆序拼接混淆,最终生成令牌混淆数据和校验码混淆数据。基于本领域常识可知,经过上述分段、段内逆序及段间逆序拼接的多重混淆变换后,生成的混淆数据与原始验证数据在表象上已无直接对应关系。该方法使得即使攻击者截获了从NFC标签验证装置发送至服务器的混淆数据,也难以直接逆向推导出原始的、有效的令牌和校验码内容,从而实现了对NFC标签验证数据在传输过程中的有效隐匿,增加了数据被恶意解析和复制的难度,提升了NFC标签验证流程前端数据传输环节的安全性,从而提升了NFC标签验证系统的整体安全性。
Smart Images

Figure CN122554830A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Near Field Communication (NFC) security technology, specifically to an NFC tag verification data obfuscation method, restoration method, and related equipment. Background Technology
[0002] Due to its convenience, NFC technology has been widely used in areas such as product anti-counterfeiting and traceability. NFC tags, as data carriers, can effectively enhance product anti-counterfeiting capabilities by interacting with backend servers for verification.
[0003] However, many existing NFC anti-counterfeiting verification schemes have security vulnerabilities in the data transmission between the tag and the reader / writer. Verification data is typically transmitted in plaintext or with simple encryption during the process of sending data from the NFC tag to the verification device. This allows attackers to easily intercept and analyze the original verification data format and content by monitoring the communication link. Even if the server-side verification logic is complex, attackers can still copy or forge a set of valid data packets that can pass through the intermediate transmission links, thereby bypassing front-end verification and enabling the counterfeiting and illegal circulation of tags, resulting in low overall security of the NFC tag verification system. Summary of the Invention
[0004] The purpose of this invention is to provide an NFC tag verification data obfuscation method, restoration method, and related equipment. By performing multi-layer obfuscation processing on the original NFC tag verification data, the difficulty of cracking the data during transmission is increased, thereby improving the overall security of the NFC tag verification system.
[0005] In a first aspect, the present invention provides an NFC tag verification data obfuscation method, applied to an NFC tag verification device, comprising: sending a data reading instruction to an NFC tag and receiving original NFC tag verification data returned by the NFC tag; wherein the NFC tag verification data includes token data and an encrypted verification code; dividing the token data and the encrypted verification code into several first token data segments and several first verification code data segments according to a preset length; performing character reverse order obfuscation on each first token data segment and on each first verification code data segment; performing reverse concatenation obfuscation on all the first token data segments after character reverse order obfuscation to obtain token obfuscated data; and performing reverse concatenation obfuscation on all the first verification code data segments after character reverse order obfuscation to obtain verification code obfuscated data; and sending the token obfuscated data and the verification code obfuscated data to a server for verification.
[0006] Secondly, the present invention also provides an NFC tag verification data restoration method, applied to a server, comprising: receiving token obfuscation data and verification code obfuscation data sent by an NFC tag verification device; dividing the token obfuscation data and verification code obfuscation data into several second token data segments and several second verification code data segments according to a preset length; performing character reverse order restoration processing on each second token data segment and on each second verification code data segment; concatenating all the second token data segments after character reverse order restoration in forward order to generate token data; and concatenating all the second verification code data segments after character reverse order restoration in forward order to generate an encrypted verification code.
[0007] Thirdly, the present invention also provides an NFC tag verification device, comprising: a data reading unit, configured to send a data reading instruction to an NFC tag and receive the original NFC tag verification data returned by the NFC tag; wherein the NFC tag verification data includes token data and an encrypted verification code; an obfuscation segmentation unit, configured to divide the token data and the encrypted verification code into several first token data segments and several first verification code data segments according to a preset length; a character reversal obfuscation unit, configured to perform character reversal obfuscation processing on each of the first token data segments and on each of the first verification code data segments; a reversal concatenation obfuscation unit, configured to perform reversal concatenation obfuscation processing on all the first token data segments after character reversal obfuscation processing to obtain token obfuscated data; and to perform reversal concatenation obfuscation processing on all the first verification code data segments after character reversal obfuscation processing to obtain verification code obfuscated data; and an obfuscated data sending unit, configured to send the token obfuscated data and the verification code obfuscated data to a server for verification.
[0008] Fourthly, the present invention also provides a server, comprising: a data receiving unit for receiving token obfuscation data and verification code obfuscation data sent by an NFC tag verification device; a restoration and division unit for dividing the token obfuscation data and verification code obfuscation data into several second token data segments and several second verification code data segments according to a preset length; a character reverse order restoration unit for performing character reverse order restoration processing on each second token data segment and on each second verification code data segment; and a reverse order concatenation and restoration unit for concatenating all the second token data segments after character reverse order restoration in forward order to generate token data; and concatenating all the second verification code data segments after character reverse order restoration in forward order to generate an encrypted verification code.
[0009] Fifthly, the present invention also provides an NFC tag verification data obfuscation and restoration system, including the above-described NFC tag verification device and the above-described server.
[0010] The present invention produces at least the following beneficial effects: The NFC tag verification data obfuscation method provided by this invention first divides the original token data and encrypted verification code into multiple data segments of a preset length, performs character reversal obfuscation on each data segment, and then concatenates all the processed data segments in reverse order to generate obfuscated token data and obfuscated verification code data. Based on common knowledge in the art, after the above-mentioned multiple obfuscation transformations of segmentation, intra-segment reversal, and inter-segment reversal concatenation, the generated obfuscated data no longer has a direct correspondence with the original verification data. This method makes it difficult for attackers to directly reverse-engineer the original, valid token and verification code content even if they intercept the obfuscated data sent from the NFC tag verification device to the server. This effectively conceals the NFC tag verification data during transmission, increases the difficulty of malicious data parsing and copying, improves the security of the front-end data transmission link in the NFC tag verification process, and thus enhances the overall security of the NFC tag verification system. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart of an NFC tag verification data obfuscation method according to an embodiment of the present invention; Figure 2 This is a flowchart of an NFC tag verification data restoration method according to an embodiment of the present invention; Figure 3 This is a schematic block diagram of an NFC tag verification device according to an embodiment of the present invention; Figure 4 This is a schematic block diagram of a server according to an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] It should be understood that, when used in this specification and the appended claims, the terms “comprising” and “including” indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more of its features, integrals, steps, operations, elements, components and / or collections thereof.
[0015] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0016] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0017] To facilitate the description of this application, the following concepts related to this application are introduced.
[0018] Near Field Communication (NFC) is a short-range, high-frequency wireless communication technology that allows contactless point-to-point data transfer between electronic devices, typically operating within a 10-centimeter range. In this embodiment, NFC is used for data reading and command interaction between the tag verification device and the NFC tag.
[0019] Token data: In the security verification process, it is a one-time encrypted data generated by the NFC tag based on its locally stored unique identifier, key and dynamic parameters, combined with an externally input random number, through an encryption algorithm.
[0020] Encryption verification code: A piece of code generated synchronously during the encryption process to verify the integrity of the data and the authenticity of its source.
[0021] Data obfuscation: A technique that alters the original appearance of data through specific rules, aiming to increase the difficulty for unauthorized parties to parse the data.
[0022] refer to Figure 1 This application provides an NFC tag verification data obfuscation method, applied to an NFC tag verification device, comprising: S110: Send a data read command to the NFC tag and receive the original NFC tag verification data sent back by the NFC tag; wherein the NFC tag verification data includes token data and encryption verification code.
[0023] The purpose of this step is to obtain key data from the NFC tag for subsequent verification. Specifically, after establishing a near-field communication connection with the NFC tag on the product packaging, the NFC tag verification device (e.g., a smartphone with the brand's official verification application installed) sends a data read command to the tag. The NFC tag responds to this command, reads the token data generated in this verification session and the accompanying encrypted verification code from its secure storage area, and sends this back to the NFC tag verification device as the original NFC tag verification data. The encrypted verification code is a fixed-length code synchronously generated by the NFC tag during the encryption process of generating the token data, used for subsequent verification of the integrity and authenticity of the token data.
[0024] S120: Divide the token data and the encryption verification code into several first token data segments and several first verification code data segments according to a preset length. Specifically, the preset length can be 16 bytes or other fixed lengths agreed upon in advance by the NFC tag verification device and the server.
[0025] The purpose of this step is to prepare for subsequent segmentation and obfuscation processing by splitting continuous string data into easily operable data units. Specifically, after receiving the token data and the encryption verification code, the obfuscation processing module of the NFC tag verification device divides these two strings into fixed-length segments according to a pre-set data segment length, such as 16 bytes. If the total length of the token data is not divisible by 16, the last data segment that is less than the preset length is padded with zeros to reach the preset length. The encryption verification code is processed in the same way, ultimately forming two sets of ordered data segment sequences.
[0026] S130: Perform character reverse order obfuscation on each of the first token data segments and perform character reverse order obfuscation on each of the first check code data segments.
[0027] The purpose of this step is to initially disrupt the internal structure of each basic data unit, thereby compromising the readability of the original data. Specifically, the obfuscation processing module iterates through each first token data segment and first checksum data segment generated in step S120. For each data segment, a string reversal operation is performed. For example, a data segment containing "1234567890ABCDEF" will become "FEDCBA0987654321" after processing. This operation changes the character order within the data segment, making any attempt to directly read the data impossible to obtain meaningful information.
[0028] S140: Perform reverse concatenation and obfuscation on the first token data segment after all characters have been reversed to obtain token obfuscated data; and perform reverse concatenation and obfuscation on the first check code data segment after all characters have been reversed to obtain check code obfuscated data.
[0029] The purpose of this step is to further scramble the logical order between data segments, building upon the obfuscation in the previous step, to achieve double obfuscation. Specifically, the obfuscation module reverses the original order of all first token data segments that have undergone character reversal processing. That is, the data segment that was originally first is moved to the end, the data segment that was originally second is moved to the second to last, and so on. Then, these segments are concatenated into a complete string to form the obfuscated token data. For example, if the original data segment order is segment 1, segment 2, segment 3, the concatenated order is segment 3, segment 2, segment 1. The same operation is performed on all first checksum data segments that have undergone character reversal processing to obtain obfuscated checksum data. At this point, the original form of the data has been deeply hidden.
[0030] S150: Send the token obfuscation data and checksum obfuscation data to the server for verification.
[0031] The purpose of this step is to securely transmit the obfuscated data to a remote server for final legitimacy verification. Specifically, the network communication module of the NFC tag verification device packages the obfuscated token data and checksum data, along with other necessary information for this verification session, such as tag security verification parameters and tag key data, into a tag verification command, which is then sent to the remote server through a pre-established encrypted network channel. Upon receiving the command, the server will invoke the appropriate data restoration method for subsequent processing.
[0032] The embodiments of this application employ the above method, which produces at least the following beneficial effects: By employing a dual obfuscation mechanism of segmented character reversal and inter-segment reversal concatenation, a deep morphological transformation of token data and encrypted verification codes in NFC tag verification is achieved. This method reduces the risk of sensitive data being directly intercepted and parsed during transmission from the NFC tag verification device to the server, thereby enhancing the confidentiality and security of verification data during public network transmission.
[0033] By processing data in a way that only transforms its form without altering its essential informational nature, efficient matching with server-side reconstruction algorithms is achieved. This method reduces the hardware costs and processing time introduced by adding complex encryption mechanisms, thereby enhancing the security of the communication link with lower resource overhead.
[0034] This method can be applied to NFC anti-counterfeiting verification scenarios for high-end consumer goods and luxury products. When consumers use their mobile phones to verify the authenticity of goods, this method obfuscates key data such as tokens read from product tags before uploading them, suppressing the possibility of data being eavesdropped on and recovered on public networks, and improving the data security of the anti-counterfeiting verification process.
[0035] In some embodiments, before sending the token obfuscation data and checksum obfuscation data to the server for verification, the method further includes: A first random verification character is added at a preset position in the token obfuscation data; a second random verification character is added at a preset position in the verification code obfuscation data.
[0036] The purpose of this step is to add another layer of randomness verification barrier on top of the already obfuscated data. The specific implementation steps are as follows: The first step is to determine the insertion location and content. The obfuscation module generates two sets of strings consisting of random numbers and letters, serving as the first and second random checksum characters. Simultaneously, it identifies key locations in the obfuscated data, such as the start and end points, as the insertion points.
[0037] The second step is to perform character addition. A first random check character is added to a preset position in the token obfuscation data, for example, simultaneously added to the beginning and end of the token obfuscation data. A second random check character is added to the beginning and end of the checksum obfuscation data in the same manner, forming the final obfuscated data packet to be sent out.
[0038] By adding random check characters to obfuscated data, further protection is achieved for data integrity and identifiability. This method enhances the randomness and unpredictability of data patterns, reducing the risk that attackers can deduce the restoration rules by analyzing fixed obfuscation patterns, thereby strengthening the robustness of the data obfuscation mechanism.
[0039] In a more specific embodiment, adding a first random verification character at a preset position in the token obfuscation data and adding a second random verification character at a preset position in the verification code obfuscation data includes: A first random check character is added to the beginning and end of the token obfuscation data, respectively; and a second random check character is added to the beginning and end of the check code obfuscation data, respectively.
[0040] The purpose of this step is to set the obfuscation flag in the most prominent position, so that the true start and end points of the obfuscated data are hidden. The specific implementation steps are as follows: The first step is to generate header and footer check characters. The obfuscation module generates header and footer check characters, each possibly consisting of 6 random characters, which together form the first random check character. Similarly, it generates the header and footer of the second random check character for the obfuscated check code data.
[0041] The second step is to append a header checksum character to the beginning of the token obfuscation data and a tail checksum character to the end. For example, if the token obfuscation data is "FEDC...321", the header checksum character is "A7B3C5", and the tail checksum character is "E9F1D2", then the result after appending the header checksum character is "A7B3C5FEDC...321E9F1D2". Perform the same operation on the checksum obfuscation data.
[0042] By explicitly adding random checksum characters at both ends, the boundaries and alignment of the obfuscated data are altered. This method reduces the accuracy of any automated attacks attempting to directly locate and extract data segments, suppresses the possibility of brute-force disassembly based on the data frame structure, and thus increases the difficulty of cracking.
[0043] Optionally, the first random check character consists of numbers and letters, and the second random check character also consists of numbers and letters. This means that its character space is a set of 0-9, AF or AZ, az, and the specific combination can be a pure number string, a pure letter string, or a mixed alphanumeric string. This embodiment of the present disclosure does not limit this. This configuration makes the check character and the obfuscated data body, which is usually hexadecimal data, have similar morphological characteristics, increasing the difficulty of distinguishing the two from their appearance.
[0044] Specifically, the data obfuscation process is as follows: Divide the original token data or original encrypted verification code data into several data segments, each segment consisting of 16 bytes. If the last segment is less than 16 bytes, pad it with zeros. Reverse the character order of each data segment. For example, if the data segment is "1234567890ABCDEF", the reversed data segment will be "FEDCBA0987654321". Concatenate all the processed data segments in reverse order. For example, if the original data segment order is segment 1, segment 2, segment 3, the concatenated data segment order will be segment 3, segment 2, segment 1. Finally, add two random verification characters to the beginning and end of the concatenated data to generate the obfuscated data. For example, the original token data is "1234567890ABCDEF12345678", which is divided into two segments of 16 bytes each: segment 1 "1234567890ABCDEF" and segment 2 "12345678" (after padding with zeros, it becomes "1234567800000000"); segment 1 in reverse order is "FEDCBA0987654321", and segment 2 in reverse order is "0000000087654321"; after concatenation, the result is "0000000087654321FEDCBA0987654321". Random check characters “5A” and “7B” are added to the beginning and end, and the final obfuscated token data is “5A0000000087654321FEDCBA09876543217B”.
[0045] The purpose of data obfuscation is to prevent data from being stolen and directly parsed during transmission. Even if the obfuscated data is stolen, counterfeiters who do not know the obfuscation restoration rules will not be able to restore the original data, thus further improving the security of data transmission.
[0046] Reference Figure 2 This application also provides an NFC tag verification data restoration method, applied to a server, corresponding to the aforementioned NFC tag verification data obfuscation method, including: S210: Receives token obfuscation data and verification code obfuscation data sent by the NFC tag verification device.
[0047] The purpose of this step is to obtain the obfuscated data to be restored on the server side. Specifically, the server's data receiving module listens for and receives tag verification instruction data packets from the NFC tag verification device through the network interface, and parses the token obfuscation data and checksum obfuscation data from the data packets, and passes them to the data restoration processing module.
[0048] S220: Divide the token obfuscation data and the check code obfuscation data into several second token data segments and several second check code data segments according to a preset length.
[0049] The purpose of this step is to prepare for the deobfuscation operation by restoring the received obfuscated data into an ordered sequence of data segments. Specifically, the data restoration processing module uses a preset length (e.g., 16 bytes) that is exactly the same as the obfuscating end as the segmentation parameter to segment the token obfuscation data and checksum obfuscation data from beginning to end, resulting in two sets of ordered second token data segments and second checksum data segments.
[0050] S230: Perform character reversal restoration processing on each of the second token data segments and on each of the second check code data segments.
[0051] The purpose of this step is to restore the character order within each data segment to its pre-obfuscation state. Specifically, the data restoration processing module iterates through each second token data segment and second checksum data segment, performing the same character reversal operation as in obfuscation step S130. Since the inverse transformation of the reversal operation is itself, the character arrangement within each data segment will be restored to its original state after this step.
[0052] S240: Concatenate the second token data segment after reversing all characters in the correct order to generate token data; and concatenate the second check code data segment after reversing all characters in the correct order to generate encrypted check code.
[0053] The purpose of this step is to restore the original order of the data segments, ultimately reconstructing the complete original data. Specifically, the data restoration processing module concatenates all the second token data segments obtained after step S230 according to their original order (i.e., forward order) before being concatenated in reverse order during obfuscation, thereby generating complete, original token data. The second checksum data segment is processed in the same way to generate the original encrypted checksum. At this point, the data restoration process is complete, and the server can perform subsequent verification and comparison work based on the restored token data and encrypted checksum.
[0054] In some embodiments, prior to step S220, the method further includes: Remove the first random check character at a preset position in the token obfuscation data; remove the second random check character at a preset position in the check code obfuscation data.
[0055] The purpose of this step is to remove the randomness protection layer added during the obfuscation process and restore the clean obfuscated main data. The specific implementation steps are as follows: The first step is to locate the check characters. For example, the data restoration processing module accurately locates the precise positions of the first and second random check characters in the corresponding obfuscated data according to the rules pre-agreed with the obfuscation device, such as identifying strings of specific lengths located at the beginning and end of the data.
[0056] The second step is to perform character removal. For example, from the received token obfuscation data, the located header and tail check characters are deleted, leaving only the pure middle part, which is the token obfuscation data to be divided in step S220. The same operation is performed on the checksum obfuscation data, removing the first and last second random check characters.
[0057] By removing random checksum characters through preprocessing, it is ensured that subsequent segmented restoration operations can be performed based on clean and correct obfuscated data. This method eliminates the possibility of restoration failure due to misaligned data boundaries, guaranteeing the accuracy and reliability of the data restoration process.
[0058] In some embodiments, after obtaining the token obfuscation data and the checksum obfuscation data in step S140 and before sending them in step S150, one or more combinations of the following steps may be included: Attaching and obfuscating timestamps: After the token obfuscation data and checksum obfuscation data are generated, the system timestamp of the current NFC tag verification device (accurate to milliseconds) is obtained. This timestamp string is segmented, characters are reversed, and segments are concatenated in reverse order according to the same preset length as in step S120 to generate an obfuscated timestamp. The obfuscated timestamp is then concatenated with the token obfuscation data and checksum obfuscation data in a predetermined order to form a single data packet.
[0059] The purpose of this step is to embed a timeliness identifier into the obfuscated data, so that the data format transmitted in each session is uniquely bound to the time of generation. Specifically, a UTC millisecond timestamp can be obtained, such as "1680505123456", which can be used as the original timestamp. After being processed into an obfuscated timestamp by applying the same obfuscation rules, it can be appended to the header of the token obfuscated data.
[0060] Correspondingly, in the NFC tag verification data restoration method, after receiving data in step S210 and before dividing in step S220, a step can be added: identifying and separating the obfuscated timestamp. The server extracts the obfuscated timestamp portion and the main obfuscated data portion from the overall data packet according to a predetermined splicing order. Then, the same restoration operation as steps S220-S240 is performed on the obfuscated timestamp to obtain the original timestamp. The server verifies whether the difference between this timestamp and the current server time is within a preset valid time window (e.g., 5 minutes). If the timeout occurs, the data is deemed invalid, and the verification process is terminated directly. This mechanism reduces the risk of replay attacks.
[0061] Generate and append an integrity checksum: After the token obfuscation data and checksum obfuscation data are generated, they are concatenated into a string to be protected. A preset hash algorithm, such as the Chinese national cryptographic algorithm SM3, is used to calculate a message digest for this string, generating a fixed-length integrity checksum. This integrity checksum is then obfuscated by segmenting it into preset length segments, reversing the order, and concatenating the segments to obtain an obfuscated checksum, which is then appended to the end of the data to be protected.
[0062] The purpose of this step is to enhance tamper-proof verification capabilities. Specifically, the NFC tag verification device calls the SM3 hash module, taking token obfuscation data and checksum obfuscation data as input, and outputting a 256-bit digest value, which is represented as a hexadecimal string. This digest is then obfuscated to obtain an obfuscated checksum. The final data sent consists of token obfuscation data, checksum obfuscation data, and obfuscated checksum.
[0063] Correspondingly, in the NFC tag verification data restoration method, after receiving data in step S210, the following steps are performed first: separating and restoring the integrity check code for integrity verification. The server separates the obfuscated check code portion according to a predetermined format and restores the original integrity check code according to the same restoration rules as in S220-S240. Then, this portion is stripped away, and the SM3 digest value is calculated for the remaining token obfuscation data and check code obfuscation data portions, and compared with the restored integrity check code. If they do not match, it indicates that the data has been damaged or tampered with during transmission, and the server directly terminates the verification and returns a failure message. This method suppresses the situation where data tampering goes undetected, protecting the integrity of the transmitted content.
[0064] Perform overall XOR masking on the obfuscated data: After the token obfuscation data and checksum obfuscation data are generated, a preset mask byte sequence shared with the server is used, such as a fixed-length byte string derived from the session key, to perform a bitwise XOR operation on each byte of the obfuscated data to generate the masked data.
[0065] The purpose of this step is to add a reversible linear transformation to the obfuscated data, increasing the ability of unauthorized parties to directly identify obfuscation patterns. Specifically, if the mask sequence length is 32 bytes, the data bytes are repeatedly XORed. After this operation, the statistical characteristics of the data are further hidden.
[0066] Reference Figure 3 This application also provides an NFC tag verification device 300, comprising: The data reading unit 301 is used to send a data reading command to the NFC tag and receive the original NFC tag verification data sent back by the NFC tag; wherein the NFC tag verification data includes token data and encryption verification code.
[0067] The obfuscation segmentation unit 302 is used to divide the token data and the encryption verification code according to a preset length to obtain a number of first token data segments and a number of first verification code data segments.
[0068] The character reverse order obfuscation unit 303 is used to perform character reverse order obfuscation processing on each of the first token data segments and on each of the first check code data segments.
[0069] The reverse concatenation and obfuscation unit 304 is used to perform reverse concatenation and obfuscation on the first token data segment after all characters have been reversed and obfuscated, to obtain token obfuscated data; and to perform reverse concatenation and obfuscation on the first check code data segment after all characters have been reversed and obfuscated, to obtain check code obfuscated data.
[0070] The obfuscated data sending unit 305 is used to send the obfuscated token data and obfuscated verification code data to the server for verification.
[0071] Reference Figure 3 In some embodiments, the NFC tag verification device 300 further includes: The verification character adding unit 306 is used to add a first random verification character at a preset position in the token obfuscation data and a second random verification character at a preset position in the verification code obfuscation data.
[0072] The NFC tag verification device can typically be manifested as a software module and / or hardware component installed in a smartphone, tablet, or dedicated NFC reader / writer.
[0073] For specific limitations regarding the NFC tag verification device 300, please refer to the limitations of the NFC tag verification data obfuscation method described above, which will not be repeated here. Each module in the aforementioned NFC tag verification device 300 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0074] Reference Figure 4 This application also provides a server 400, including: The data receiving unit 401 is used to receive token obfuscation data and verification code obfuscation data sent by the NFC tag verification device.
[0075] The restoration and partitioning unit 402 is used to partition the token obfuscation data and the check code obfuscation data according to a preset length to obtain several second token data segments and several second check code data segments.
[0076] The character reversal restoration unit 403 is used to perform character reversal restoration processing on each of the second token data segments and on each of the second check code data segments.
[0077] The reverse concatenation and restoration unit 404 is used to concatenate the second token data segment after all characters have been reversed and restored in the forward order to generate token data; and to concatenate the second verification code data segment after all characters have been reversed and restored in the forward order to generate an encrypted verification code.
[0078] The server can be a single server or a distributed server cluster consisting of multiple servers; this disclosure does not limit this.
[0079] For specific limitations regarding the server 400, please refer to the limitations of the NFC tag verification data restoration method described above, which will not be repeated here. Each module in the aforementioned server 400 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0080] Reference Figure 4 In some embodiments, the server 400 may further include a check character removal unit 405, which is used to perform the steps in the aforementioned method before the restoration and partitioning unit works, to remove random check characters at the beginning and end of the data.
[0081] This application also provides an NFC tag verification data obfuscation and restoration system, which consists of the aforementioned NFC tag verification device and a server connected via network communication. The NFC tag verification device is responsible for performing data obfuscation operations and sending the obfuscated data to the server, while the server is responsible for receiving and performing data restoration operations. This system works collaboratively to complete the secure transmission and processing of sensitive data during the NFC tag verification process.
[0082] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A NFC tag verification data obfuscation method applied to a NFC tag verification device, characterized in that, include: Send a data read command to the NFC tag and receive the original NFC tag verification data sent back by the NFC tag; wherein, the NFC tag verification data includes token data and encryption verification code; The token data and the encryption verification code are divided into several first token data segments and several first verification code data segments according to a preset length. Each of the first token data segments is subjected to character reverse order obfuscation, and each of the first check code data segments is subjected to character reverse order obfuscation. The first token data segment, after all characters have been reversed and obfuscated, is then concatenated in reverse order to obtain obfuscated token data; and the first checksum data segment, after all characters have been reversed and obfuscated, is then concatenated in reverse order to obtain obfuscated checksum data. The obfuscated token data and obfuscated checksum data are sent to the server for verification.
2. The NFC tag verification data obfuscation method according to claim 1, characterized in that, Before sending the obfuscated token data and obfuscated checksum data to the server for verification, the process also includes: A first random verification character is added at a preset position in the token obfuscation data; a second random verification character is added at a preset position in the verification code obfuscation data.
3. The NFC tag verification data obfuscation method according to claim 2, characterized in that, The first random verification character is added at a preset position in the token obfuscation data; Add a second random check character at a preset position in the checksum obfuscation data, including: Add a first random check character at the beginning and end of the token obfuscation data; And add a second random check character at the beginning and end of the check code obfuscation data.
4. The NFC tag verification data obfuscation method according to claim 2, characterized in that, The first random check character consists of numbers and letters, and the second random check character consists of numbers and letters.
5. A method for restoring NFC tag verification data, applied to a server, characterized in that, include: Receive token obfuscation data and verification code obfuscation data sent by the NFC tag verification device; The token obfuscation data and the check code obfuscation data are divided into several second token data segments and several second check code data segments according to a preset length. Each second token data segment is reversed and restored in character order; and each second check code data segment is reversed and restored in character order. The second token data segment, after all characters have been reversed and restored, is concatenated in forward order to generate token data. And concatenate the second check code data segment, after reversing all characters, in forward order to generate an encrypted check code.
6. The NFC tag verification data restoration method according to claim 5, characterized in that, Before dividing the token obfuscation data and checksum obfuscation data into preset lengths, the method further includes: Remove the first random check character at a preset position in the token obfuscation data; remove the second random check character at a preset position in the check code obfuscation data.
7. An NFC tag verification device, characterized in that, include: The data reading unit is used to send a data reading command to the NFC tag and receive the original NFC tag verification data sent back by the NFC tag; wherein, the NFC tag verification data includes token data and an encrypted verification code; The obfuscation segmentation unit is used to divide the token data and the encryption verification code into several first token data segments and several first verification code data segments according to a preset length. The character reverse order obfuscation unit is used to perform character reverse order obfuscation processing on each of the first token data segments and on each of the first check code data segments. The reverse concatenation and obfuscation unit is used to perform reverse concatenation and obfuscation on the first token data segment after all characters have been reversed and obfuscated to obtain token obfuscated data; and to perform reverse concatenation and obfuscation on the first check code data segment after all characters have been reversed and obfuscated to obtain check code obfuscated data. The obfuscated data sending unit is used to send the obfuscated token data and obfuscated checksum data to the server for verification.
8. The NFC tag verification device according to claim 7, characterized in that, Also includes: A verification character adding unit is used to add a first random verification character at a preset position in the token obfuscation data; A second random check character is added at a preset position in the check code obfuscation data.
9. A server, characterized in that, include: The data receiving unit is used to receive token obfuscation data and verification code obfuscation data sent by the NFC tag verification device. The restoration division unit is used to divide the token obfuscation data and the check code obfuscation data into several second token data segments and several second check code data segments according to a preset length. The character reverse order restoration unit is used to perform character reverse order restoration processing on each of the second token data segments and on each of the second check code data segments; The reverse concatenation and restoration unit is used to concatenate the second token data segment after all characters have been reversed and restored in forward order to generate token data. And concatenate the second check code data segment, after reversing all characters, in forward order to generate an encrypted check code.
10. An NFC tag verification data obfuscation and restoration system, characterized in that, It includes the NFC tag verification device as described in claim 7 and the server as described in claim 9.