Payment processing methods, devices, terminal equipment and storage media
By using a fixed offset to generate a user signature code to encrypt payment data in UPI, the inconvenience and security issues caused by manually entering offsets during version updates are resolved, achieving convenient and efficient payment data transmission and security verification.
Patent Information
- Application Number
- CN202210914604.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-07-29
AI Technical Summary
In the Unified Payments Interface (UPI), each time the operating system or mobile payment application version is updated, the offset of the new version needs to be manually entered, which leads to security verification failure and affects the convenience of payment processing.
A user feature code is generated using a fixed offset. The payment data is then encrypted using the user feature code and decrypted on the server side, ensuring that no new offset needs to be manually entered when the version is updated.
It improves the convenience of payment processing, enhances the security of payment data transmission, and reduces the risk of security verification failure due to version updates.
Smart Images

Figure CN115204855B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of payment technology, specifically to a payment processing method, apparatus, terminal equipment, and storage medium. Background Technology
[0002] The Unified Payment Interface (UPI) is a payment method gaining popularity in India. UPI has high requirements for data transmission and verification security. Currently, one method uses offsets for security verification. Each time a new version is released, the offset for the new version needs to be manually entered in the backend. If this is forgotten, the new version will fail the security verification, resulting in low convenience for payment processing. Summary of the Invention
[0003] This application provides a payment processing method, apparatus, terminal device, and storage medium, which can improve the convenience of payment processing.
[0004] The first aspect of this application provides a payment processing method, including:
[0005] A user feature code is generated based on feature information, which includes: user identifier and fixed offset;
[0006] The payment data is encrypted using the user's feature code to obtain the encrypted payment data;
[0007] The encrypted payment data is transmitted to the server.
[0008] A second aspect of this application provides a payment processing method, including:
[0009] Receive encrypted payment data from the terminal device;
[0010] A user feature code is generated based on feature information, which includes: user identifier and fixed offset;
[0011] The encrypted payment data is decrypted using the user's signature.
[0012] A third aspect of this application provides a payment processing apparatus, comprising:
[0013] The first generation unit is used to generate a user feature code based on feature information, the feature information including: user identifier and fixed offset;
[0014] An encryption unit is used to encrypt payment data using the user feature code to obtain encrypted payment data;
[0015] A transmission unit is used to transmit the encrypted payment data to the server.
[0016] A fourth aspect of this application provides a payment processing apparatus, comprising:
[0017] A receiving unit is used to receive encrypted payment data from a terminal device;
[0018] The second generation unit is used to generate a user feature code based on feature information, the feature information including: user identifier and fixed offset;
[0019] The decryption unit is used to decrypt the encrypted payment data using the user feature code.
[0020] A fifth aspect of this application provides a terminal device including a processor and a memory, the memory being used to store computer programs or instructions, and the processor being configured to invoke the computer programs or instructions to execute the step instructions as described in the first aspect of this application.
[0021] A sixth aspect of this application provides a server including a processor and a memory, the memory being used to store computer programs or instructions, and the processor being configured to invoke the computer programs or instructions to execute the step instructions as described in the second aspect of this application.
[0022] A seventh aspect of this application provides a computer-readable storage medium storing a computer program for electronic data interchange, the computer program including program instructions that, when executed by a processor, cause the processor to perform the steps described in the first or second aspect of this application.
[0023] An eighth aspect of this application provides a computer program product, wherein the computer-readable storage medium stores a computer program or instructions that, when executed by a processor, cause the processor to perform the steps and instructions as described in the first or second aspect of this application.
[0024] In this embodiment, a user feature code is generated based on feature information, including a user identifier and a fixed offset. Payment data is then encrypted using the user feature code to obtain encrypted payment data. The encrypted payment data is then transmitted to the server. The user feature code is generated based on the fixed offset and the user identifier. Since the fixed offset does not change during version updates, there is no need for manual input of the new offset in the background for each version update, thereby improving the convenience of payment processing. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of the architecture of a payment processing system provided in an embodiment of this application;
[0027] Figure 2 This is a schematic diagram of the hardware and software system architecture of a terminal device provided in an embodiment of this application;
[0028] Figure 3 This is a flowchart illustrating a payment processing method provided in an embodiment of this application;
[0029] Figure 4 This is a flowchart illustrating another payment processing method provided in an embodiment of this application;
[0030] Figure 5 This is a flowchart illustrating another payment processing method provided in an embodiment of this application;
[0031] Figure 6 This is a flowchart illustrating another payment processing method provided in an embodiment of this application;
[0032] Figure 7 This is a schematic diagram of the structure of a payment processing device provided in an embodiment of this application;
[0033] Figure 8 This is a schematic diagram of another payment processing device provided in an embodiment of this application;
[0034] Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;
[0035] Figure 10 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0036] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0037] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0038] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
[0039] Please see Figure 1 , Figure 1 This is a schematic diagram of the architecture of a payment processing system provided in an embodiment of this application. Figure 1 As shown, the payment processing system 10 includes a terminal device 110 and a server 120. The terminal device 110 and the server 120 can communicate with each other via a wireless network or a wired data connection.
[0040] It should be noted that the wireless network may include mobile cellular networks (such as fourth-generation 4G or fifth-generation 5G mobile communication networks), satellite communication networks, Internet of Things (IoT), vehicle-to-everything (V2X) networks, wireless local area networks (WLAN), wide area networks (WAN), Bluetooth (BT), wireless fidelity (Wi-Fi), Zigbee, near field communication (NFC), ultra-wideband (UWB), light fidelity (LiFi), infrared (IR), etc.
[0041] The wired network can be constructed using data lines such as serial transmission interface data lines, asynchronous transmission interface (such as RS-232) data lines, universal serial bus (USB) data lines, metal wires, optical fibers, cables, and optical fiber cables.
[0042] The payment processing system can be a B / S architecture payment management platform or a C / S architecture payment management platform; there are no specific restrictions on this.
[0043] In this embodiment, mobile payment by the user needs to be implemented through a terminal device. The terminal device can generate specific payment data based on the type of service the user needs to pay for, in order to complete the transaction. Simultaneously, the server can perform corresponding authentication processing on this payment data and feed back the authentication results to the terminal device, thereby completing the transaction and ensuring the security of the payment process. In this embodiment, "authentication" can be interpreted as the same concept as "verification," "checking," or "inspection," and no specific limitations are imposed.
[0044] In addition, the payment processing system 10 may also include other numbers of terminal devices and other numbers of servers, without specific limitations.
[0045] The terminal device and server of the embodiments of this application will be described in detail below.
[0046] The terminal device in this application embodiment is a terminal with payment functionality. It can be a handheld device, in-vehicle device, wearable device, augmented reality (AR) device, virtual reality (VR) device, projection device, projector, or other device connected to a wireless modem. It can also be various specific forms of user equipment (UE), terminal device, terminal, mobile terminal, smartphone, smart screen, smart TV, smartwatch, laptop, smart speaker, camera, game controller, microphone, station (STA), access point (AP), mobile station (MS), personal digital assistant (PDA), personal computer (PC), or relay device, etc.
[0047] For example, the terminal device can be a wearable device. This wearable device, also known as a smart wearable device, is a general term for intelligent devices that utilize wearable technology to intelligently design and develop everyday wearables, such as smart glasses, smart gloves, smartwatches, various smart bracelets with specific feature monitoring, and smart jewelry. This wearable device can be worn directly on the body or integrated into the user's clothing or accessories; it is a portable device. This wearable device can not only utilize dedicated hardware architectures but also dedicated software architectures for data interaction, cloud interaction, etc. This wearable smart device can achieve complete or partial functionality without relying on other smart devices.
[0048] In the embodiments of this application, the software system of the terminal device may adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.
[0049] The hardware and software system of a terminal device may include a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer.
[0050] This hardware layer may include hardware such as CPU, memory management unit (MMU), and memory (also known as storage).
[0051] This memory can be used to store software programs and / or modules, and may include a program storage area and a data storage area.
[0052] This stored program area can be used to store the operating system or software programs required for at least one function. The operating system can be any one or more computer operating systems that implement business processing through processes. Examples include Android, RTOS (real-time operating system), UNIX, Linux, DOS, Windows, and Mac operating systems.
[0053] This storage area can be used to store data required or generated by the operating system or at least one function.
[0054] The following example uses a layered operating system to illustrate the hardware and software systems of a terminal device.
[0055] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram of the hardware and software system architecture of a terminal device provided in an embodiment of this application. Figure 2As shown, the memory 220 stores the operating system layer 230. The operating system layer includes a kernel layer 2301, a system runtime library layer 2302, an application framework layer 2303, and an application layer 2304. The layers communicate with each other through software interfaces, and the kernel layer 2301, system runtime library layer 2302, and application framework layer 2303 belong to the operating system space. The processor 210 can execute computer programs or instructions stored in the memory 220 to perform related operations.
[0056] The processor 210 can be viewed as a complete system-on-chip (SOC) that can be used to run or load an operating system and may include one or more processing units.
[0057] For example, processor 210 may include at least one of the following: central processing unit (CPU), application processor (AP), microcontroller unit (MCU), single-chip microcomputer (SCM), microcontroller, graphics processing unit (GPU), image signal processor (ISP), controller, digital signal processor (DSP), field-programmable gate array (FPGA), application-specific integrated circuit (ASIC), baseband processor, neural-network processing unit (NPU), etc. Different processing units may be separate or integrated together. Additionally, processor 210 may also include memory 220.
[0058] The processor 210 may also include one or more communication interfaces. These communication interfaces may include at least one of the following: a serial peripheral interface (SPI), an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and a universal serial bus (USB) interface.
[0059] The memory 220 can be used to store computer programs or instructions, to store data, and to store the operating system layer 230. The processor 210 can call programs stored in the memory 220 to run the operating system. The memory 220 can save or cache instructions recently used or repeatedly used by the processor 210, and can also save or cache data, synchronizing or transmitting this data to other processors for execution.
[0060] The memory 220 may include at least one of random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).
[0061] Kernel layer 2301 provides underlying operating system drivers for various hardware components of terminal devices, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, power management, NFC drivers, UWB drivers, mobile payment drivers, etc.
[0062] The system runtime library layer 2302 can be used to provide key feature support for the operating system through various C / C++ libraries. For example, the SQLite library provides database support, the OpenGL / ES library provides 3D graphics support, and the Webkit library provides browser engine support.
[0063] The system runtime layer 2302 can also be used to provide operating system runtime libraries, which mainly provide some core libraries that allow developers to write applications using scripting languages.
[0064] Application framework layer 2303 can be used to provide various application programming interfaces (APIs) and programming frameworks that may be used to build applications in application layer 2304, so that developers can use these APIs to create applications.
[0065] The application framework layer 2303 may include a window manager, content providers, a view system, a telephone manager, a resource manager, a notification manager, a message manager, an activity manager, a package manager, a location manager, a payment manager, etc.
[0066] Application layer 2304 belongs to user space, and at least one application (or simply "application") runs in application layer 2304. These applications can be native applications that come with the operating system or third-party applications developed by third-party developers. For example, the application layer can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, and mobile payment.
[0067] The server in this application embodiment can be a software or hardware unit used to provide functions such as payment authentication processing.
[0068] For example, the hardware and software unit can be Infrastructure as a Service (IaaS), Platform as a Service (PaaS), Software as a Service (SaaS) platform, database, etc.
[0069] In addition, the server can be a cloud server, hardware server, software server, hardware and software server, authentication server, payment authentication / verification management platform, IoT server, web server, application server, load balancer (Nginx), data center network equipment, personal computer (PC), computing device, network equipment in 5G system, and network equipment in future evolved public land mobile network (PLMN), computer supporting 802.11 protocol, etc., without specific restrictions.
[0070] Currently, the Unified Payment Interface (UPI) is a dominant payment method in the mobile payment field. UPI is increasingly popular in India, holding over 50% market share. Consequently, numerous mobile wallet platforms and payment apps exist for UPI payments, such as Paytm, Google Pay, MiPay, and PhonePE. Users can select the service type within these platforms or apps to perform mobile payment transactions.
[0071] When a user makes a mobile payment for a selected service type (such as digital products, goods, phone bills, gas and water bills, game top-ups, food delivery, tolls, etc.), the terminal device generates certain payment data (payment messages, etc.) for this transaction, such as user information, order amount (e.g., top-up amount), business account information (e.g., the mobile phone number used for top-ups), and identification information for the selected service type. This payment data needs to be transmitted between the terminal device and the server. To ensure the security of payment data transmission, this payment data needs to be encrypted to guarantee the security of this transaction.
[0072] Currently, there is a method that uses offsets for security verification. Each time a new version of the operating system or mobile payment application (APP) is released, the offset for the new version needs to be manually entered in the backend. If this is forgotten, the new version will fail security verification, resulting in lower convenience for payment processing.
[0073] An offset, also known as an offset address, can be the offset of the target function corresponding to a dynamic library file. An offset address is the offset of a specific address within a segment relative to the segment's starting address (segment address) after memory segmentation in a computer. The offset of the target function corresponding to the dynamic library file will change after operating system updates or mobile payment application version updates. The offset can be a string of a certain length.
[0074] The embodiments of this application use a fixed offset, which does not change during version updates. Each version update does not require manual input of the new version's offset in the background, thereby improving the convenience of payment processing.
[0075] Throughout the payment process, a dynamic library file exists in the terminal device's operating system. This dynamic library file can be a C / C++ dynamic library developed on the operating system, used to implement the underlying payment (mobile payment / transaction, etc.) behavior logic, such as an SO file in Android / Linux. The server itself can also be configured with the operating system's dynamic library file.
[0076] Meanwhile, throughout the entire payment processing flow, this dynamic library file can maintain multiple target functions (such as payment functions or Virtual Payment Account (VPA) functions) to implement the underlying (mobile payment / transaction, etc.) behavioral logic.
[0077] The process of a user selecting a service type on a mobile wallet platform or payment application to perform related payment (mobile payment / transaction, etc.) behavior can be understood as the dynamic library file being loaded and the target function in the dynamic library file being called.
[0078] At this point, the terminal device (kernel or processor) extracts the user identifier and the offset of the target function corresponding to the SO file in the dynamic library file, and generates a user feature code by using a certain algorithm based on the user identifier and the offset of the target function corresponding to the SO file in the dynamic library file. The payment data is then encrypted using the user feature code.
[0079] It should be noted that the server itself is also configured with the operating system's dynamic library files. The offset of the objective function corresponding to the SO file in the dynamic library file maintained by the server is the same as the offset of the objective function corresponding to the SO file in the dynamic library file maintained by the terminal device. That is, the server is also configured with fixed offsets, and for the same objective function, the fixed offset in the terminal device is the same as the fixed offset in the server. The server can also generate a user signature based on the user identifier and the fixed offset.
[0080] For different users, the fixed offset corresponding to the same objective function is the same.
[0081] SO files are a type of executable file format in dynamic library files. After an SO file is compiled, each function corresponding to the SO file is placed in a fixed location. However, every time the SO file is modified (for example, during a version update), the physical location of each function changes, and the function offset changes as well.
[0082] In the compilation process of this application embodiment, the target function corresponding to the SO file is compiled to a fixed location through a plugin. When other functions besides the target function are modified, the address of the target function after compilation will not be affected, thereby ensuring that the offset of the target function is fixed and will not change with version updates.
[0083] The compilation process of an SO file may involve more than a dozen steps, including lexical analysis, syntax analysis, finding the abstract syntax tree (AST), locating the target function corresponding to the SO file within the AST, and defining the target function's symbol at a fixed address during the translation of the target function into intermediate code. During the conversion of the intermediate code into binary code, this target function is positioned at a fixed offset address, thus ensuring that the offset of the target function is constant.
[0084] The following provides a detailed explanation of the relevant concepts and beneficial effects involved in the payment processing flow of this application embodiment.
[0085] 1) Business Type
[0086] In this embodiment, the business type can be used to represent a business that can be subject to payment (mobile payment / transaction) behavior, such as digital products, goods, phone bills, gas and water bills, game top-ups, food delivery orders, toll fees, etc. The identification information of the business type can be used to uniquely identify the business type, so that the business identifier can be identified and distinguished through the identification information of the business type.
[0087] The service type can be provided by the mobile wallet platform or payment application (APP) of the terminal device. Therefore, users can select the service type in the mobile wallet or payment application to perform relevant mobile payment activities according to their own needs.
[0088] It's important to note that an application, also known as an app, is a program designed to perform one or more specific tasks or functions. These programs run on the operating system, interact with the user at the application layer, and have a visual user interface. For example, an application can run on... Figure 2 The application layer 2304 is shown.
[0089] Payment applications can refer to applications that have payment (mobile payment / transaction, etc.) functions.
[0090] 2) Payment data
[0091] In this embodiment, payment data, also known as payment messages, can be used to represent data generated when making payments for a business type (mobile payment / transaction, etc.), such as user information, order amount, business account information, and identification information of the selected business type. The business account information may include UPI account, bank card account, user account on a mobile wallet platform or payment application, etc.
[0092] Understandably, when a user selects a service type on a mobile wallet platform or payment application to perform a related mobile payment action, the terminal device can control the mobile wallet platform or payment application to generate payment data.
[0093] In addition, payment data can be Hypertext Transfer Protocol (HTTP) data.
[0094] 3) User Identifier (User ID)
[0095] In the embodiments of this application, the user identifier, also known as the user unique identifier, can be a unique identifier for each user, so as to identify and distinguish users through the user identifier.
[0096] It should be noted that when users register / login to mobile wallet platforms or payment applications, they provide relevant personal information, such as their registration / login account password and contact information. Therefore, mobile wallet platforms or payment applications can use this personal information as a user identifier.
[0097] 4) User signature code (USC)
[0098] In this embodiment, the USC can be generated based on the user identifier and a fixed offset (the offset of the target function corresponding to the SO file in the operating system's dynamic library file).
[0099] Optionally, the USC can be generated based on the user identifier, fixed offset, mobile phone number, and integrated circuit card identity (ICCID).
[0100] Different users (i.e., different user identifiers) generate different USCs. Therefore, this increases the difficulty of cracking payment data. For example, if different users top up the same mobile number for the same amount, and the payment data (mobile number and top-up amount) is encrypted, the encryption results will differ for each user, thus increasing the difficulty of cracking the payment data.
[0101] A client can run on a terminal device, and a server can run on a server. A client, also called a user terminal, refers to a program that provides local services to clients, corresponding to the server. A server is a service program that can communicate with the client.
[0102] Please see Figure 3 , Figure 3 This is a flowchart illustrating a payment processing method provided in an embodiment of this application. Figure 3 As shown, the payment processing method may also include the following steps.
[0103] 301. The terminal device generates a user feature code based on feature information, which includes: user identifier and fixed offset.
[0104] In this embodiment of the application, the terminal device can generate a user feature code based on the user identifier and a fixed offset.
[0105] In one embodiment, the terminal device can obtain the result by performing an XOR operation and a hash operation based on the user identifier and a fixed offset.
[0106] Optionally, in step 301, the terminal device generates a user feature code based on the feature information, which may specifically include the following steps:
[0107] (11) The terminal device performs an XOR operation between the fixed offset and the user identifier to obtain the fifth XOR result;
[0108] (12) The terminal device performs a hash operation on the fifth XOR result to obtain a first hash result, and the user feature code includes the first hash result.
[0109] In this embodiment, the terminal device can convert the string in the fixed offset into binary using the American Standard Code for Information Interchange (ASCII) table to obtain a first binary value. Then, it can convert the string in the user identifier into binary using the ASCII table to obtain a second binary value. The first and second binary values are then XORed to obtain a binary XOR result (binary value). This binary XOR result is then converted into a string using the ASCII table, resulting in a fifth XOR result. For example, the character "A" can be converted to binary as "01000001" using the ASCII table.
[0110] Hash operations can convert the fifth XOR result (string) into a fixed-length first hash result (string), i.e., the user signature, using a hash function. The length of the user signature is the length of the string in the first hash result. To facilitate the universality of this user signature, its length can be set to 16 bytes, or 128 bits. A 16-byte user signature can be used in various common encryption algorithms (such as AES, MD5, etc.).
[0111] A hash function is a function that can convert a string of any length into a string of a fixed length.
[0112] In one embodiment, the terminal device may obtain the result by performing XOR processing, hash operation, and selection processing based on the user identifier and a fixed offset.
[0113] Optionally, in step 301, the terminal device generates a user feature code based on the feature information, which may specifically include the following steps:
[0114] (21) The terminal device performs an XOR operation between the fixed offset and the user identifier to obtain the fifth XOR result;
[0115] (22) The terminal device performs a hash operation on the fifth XOR result to obtain the first hash result;
[0116] (23) The terminal device selects a string of N bytes from the first hash result according to the set rules, and the user feature code includes the string of N bytes.
[0117] In this embodiment of the application, steps (21) to (22) can be referred to steps (11) to (12) above, and will not be repeated here.
[0118] N is an integer greater than or equal to 2.
[0119] The first hash result consists of a string of M bytes, where M is twice N.
[0120] The terminal device selects a string of N bytes from the first hash result according to a set rule. The user feature code includes the string of N bytes, comprising:
[0121] The terminal device selects characters at even-numbered positions from a string of M bytes in a left-to-right order as the string of N bytes.
[0122] For example, take M=32 and N=16.
[0123] The string of M bytes includes: EF90392389909ABC9009909090786543. Then, the character at the even position selected from the string of M bytes in left-to-right order is: F09390AC09000853, which is used as the string of N bytes.
[0124] The embodiments of this application involve selecting N bytes of string from the first hash result, which increases the difficulty of cracking the user's signature and thus further enhances the security of payment data.
[0125] 302. The terminal device encrypts the payment data using the user's feature code to obtain the encrypted payment data.
[0126] In this embodiment, the payment data can be encrypted using a first encryption algorithm (e.g., a symmetric encryption algorithm). A symmetric encryption algorithm is one that uses the same key for both encryption and decryption. For example, the symmetric encryption algorithm may include the Advanced Encryption Standard (AES) symmetric encryption algorithm.
[0127] On the server side, in order to decrypt the encrypted payment data, the same user signature is required for decryption.
[0128] 303, The terminal device transmits encrypted payment data to the server.
[0129] Payment data is transmitted after being encrypted using user signature codes, which ensures the security of payment data transmission.
[0130] In this embodiment, the user feature code is generated based on a fixed offset and a user identifier. Since the fixed offset does not change during version updates, there is no need for manual input of the new version's offset in the background for each version update, thereby improving the convenience of payment processing.
[0131] Please see Figure 4 , Figure 4This is a flowchart illustrating another payment processing method provided in an embodiment of this application. Figure 4 As shown, the payment processing method may also include the following steps.
[0132] 401. The terminal device generates a user feature code based on feature information, which includes: user identifier and fixed offset.
[0133] 402. The terminal device encrypts the payment data using the user's feature code to obtain the encrypted payment data.
[0134] 403, the terminal device transmits encrypted payment data to the server.
[0135] For details on the implementation of steps 401 to 403, please refer to [link / reference]. Figure 3 Steps 301 to 303 shown are not repeated here.
[0136] 404, the server has received encrypted payment data from the terminal device.
[0137] Steps 403 and 404 can be the same step, the difference being the subject of execution.
[0138] 405. The server generates a user feature code based on feature information, which includes: user identifier and fixed offset.
[0139] In this embodiment, the server may store a mapping between device identifiers and user identifiers, with each device identifier corresponding to one user identifier. This mapping between device identifiers and user identifiers can be established when a user registers an account on a terminal device.
[0140] The server can query the user identifier corresponding to the device identifier of the terminal device based on the correspondence between the device identifier and the user identifier. It can also obtain the offset of the objective function corresponding to the SO file in the dynamic library file of the server's operating system (e.g., SO file), thereby obtaining feature information containing the user identifier and a fixed offset.
[0141] The server and terminal devices use the same method to generate user feature codes. In step 405, the server generates user feature codes based on feature information, which can be done in the same way as in step 401, and will not be repeated here.
[0142] 406, the server decrypts the encrypted payment data using the user's signature.
[0143] In this embodiment, the server and terminal device use the same key (user feature code) for encryption and decryption, ensuring that the encrypted payment data transmitted can be decrypted by the server. Since different users have different user identifiers, the generated user feature codes are also different, thereby increasing the difficulty of cracking the user feature codes and thus improving the security of payment data transmission.
[0144] Optionally, before performing step 401, the following steps may also be performed:
[0145] (31) The terminal device obtains a fixed offset, performs an XOR operation between the user identifier and the fixed offset, and obtains a first XOR result.
[0146] (32) The terminal device encrypts the first XOR result to obtain the first encrypted result;
[0147] (33) The terminal device transmits the first encryption result to the server.
[0148] In this embodiment of the application, the terminal device performs an XOR operation between the user identifier and the fixed offset to obtain a first XOR result. This may include: the terminal device converting the string in the fixed offset into binary to obtain a first binary value; converting the string in the user identifier into binary using the ASCII table to obtain a second binary value; performing an XOR operation between the first binary value and the second binary value to obtain a binary XOR result (binary value); and converting the binary XOR result into a string using the ASCII table, which is the first XOR result.
[0149] The terminal device can encrypt the first XOR result using a second encryption algorithm to obtain a first encrypted result. The second encryption algorithm may include an RSA encryption algorithm; for example, RSA2048 can be used to encrypt the first XOR result to obtain the first encrypted result.
[0150] The process of the terminal device transmitting the first encryption result to the server may include: the terminal device encoding the first encryption result to obtain encoded first data, and the terminal device transmitting the encoded first data to the server.
[0151] The terminal device does not directly encode the feature information (user identifier and fixed offset). Instead, it performs XOR processing, encryption, and encoding on the feature information before transmitting the encoded data to the server. There is no hard-coded information (information that directly encodes the feature information) on the terminal device (client) side. Even if malicious actors decompile the client code, they cannot see the feature information, thus improving the security of the feature information during transmission.
[0152] Optionally, before performing step 404, the following steps may also be performed:
[0153] (41) The server receives the first encryption result from the terminal device and decrypts the first encryption result to obtain the first XOR result;
[0154] (42) The server queries the user identifier corresponding to the device identifier of the terminal device according to the correspondence between device identifier and user identifier;
[0155] (43) The server performs an XOR operation between the user identifier corresponding to the device identifier and the fixed offset to obtain a third XOR result;
[0156] (44) If the first XOR result and the third XOR result are the same, the server encrypts the feature information and stores it in the database.
[0157] In step (41), "decrypting the first encryption result to obtain the first XOR result" can be performed before step (42), after step (42), or simultaneously. This application embodiment does not limit this.
[0158] In this embodiment, the server receives a first encrypted result from the terminal device, decrypts the first encrypted result using a second encryption algorithm, and obtains a first XOR result. The terminal device encrypts the first XOR result using the second encryption algorithm to obtain a first encrypted result. The server decrypts the first encrypted result using the second encryption algorithm to obtain the first XOR result. The terminal device and the server use the same encryption algorithm (the second encryption algorithm), thereby ensuring that the first encrypted result can be decrypted on the server.
[0159] The server's memory can store the mapping relationship between device identifiers and user identifiers. This mapping relationship can include at least two device identifiers and at least two user identifiers, with each device identifier corresponding to one user identifier.
[0160] The user identifier and the fixed offset are XORed. The user identifier and the fixed offset are converted into binary values using the ASCII table. The two binary values are then XORed to obtain the binary XOR result. The binary XOR result is then converted into an XOR result using the ASCII table.
[0161] For details on the implementation of step (43), please refer to the specific description of step (31) above, which will not be repeated here.
[0162] Optionally, if the first XOR result and the third XOR result are different, the server sends a prompt message to the terminal device, the prompt message being used to indicate to the user that the identifier verification failed.
[0163] In this embodiment, before transmitting encrypted payment data to the server, the terminal device transmits the first XOR result obtained by XORing the user identifier with the fixed offset to the server. This allows the server to verify whether the feature information (user identifier and fixed offset) of the terminal device is the same as the feature information (user identifier and fixed offset) of the server before executing step 404, thereby verifying the user identifier and ensuring that the user is a genuine and legitimate user.
[0164] Optionally, after performing step 406, the following steps may also be performed:
[0165] If decryption is successful, the server generates payment result data based on the decrypted payment data and returns the payment result data to the terminal device.
[0166] In this embodiment of the application, upon successful decryption, the corresponding payment result data can be returned to the user for display. The payment result data may include at least one of the following: payment success notification data, payment recipient, payment amount, payment method, payment time, and description of the paid goods.
[0167] Optionally, after performing step 406, the following steps may also be performed:
[0168] If decryption fails, the server returns a payment failure result to the terminal device.
[0169] In this embodiment of the application, when decryption fails, a corresponding payment failure result can be returned to the user for display. The payment failure result may include at least one of the following: the reason for the failure and a solution after the failure.
[0170] Please see Figure 5 , Figure 5 This is a flowchart illustrating another payment processing method provided in an embodiment of this application. Figure 5 As shown, the payment processing method may also include the following steps.
[0171] 501. The terminal device generates a user feature code based on feature information, which includes: user identifier, fixed offset, mobile phone number, and integrated circuit card identification code.
[0172] In this embodiment, the terminal device can generate a user feature code based on four elements: user identifier, fixed offset, mobile phone number, and integrated circuit card identification code. The user feature code considers more factors, increasing the difficulty of cracking it and thus enhancing the security of payment data.
[0173] The terminal device can generate a user feature code by performing at least one XOR operation and hash operation based on the feature information, so that each element in the feature information, including the user identifier, fixed offset, mobile phone number, and integrated circuit card identification code, participates in the XOR operation or hash operation (directly or indirectly).
[0174] Optionally, in step 501, the terminal device generates a user feature code based on the feature information, which may specifically include the following steps:
[0175] (51) The terminal device performs an XOR operation between the fixed offset and the user identifier to obtain the sixth XOR result;
[0176] (52) If the length of the sixth XOR result is the same as that of the mobile phone number, the terminal device performs an XOR operation on the sixth XOR result and the mobile phone number to obtain the seventh XOR result.
[0177] (53) The terminal device performs a hash operation on the seventh XOR result to obtain the second hash result;
[0178] (54) The terminal device selects a string of N bytes from the second hash result according to the set rules;
[0179] (55) The terminal device generates an N-byte user feature code based on the N-byte string and the integrated circuit card identification code;
[0180] (56) If the sixth XOR result is not the same as the string length of the mobile phone number, the terminal device selects the first string with the same string length as the mobile phone number based on the sixth XOR result;
[0181] (57) The terminal device performs an XOR operation on the first string and the mobile phone number to obtain the eighth XOR result;
[0182] (58) The terminal device performs a hash operation on the eighth XOR result to obtain the third hash result;
[0183] (59) The terminal device selects a string of Q bytes from the third hash result according to the set rules;
[0184] (510) The terminal device generates a Q-byte user feature code based on the Q-byte string and the integrated circuit card identification code.
[0185] Q is an integer greater than or equal to 2.
[0186] If the sixth XOR result has the same string length as the mobile phone number, steps (52) to (55) are executed; if the sixth XOR result has a different string length than the mobile phone number, steps (56) to (510) are executed.
[0187] In this embodiment of the application, step (51) may specifically include the following steps: The terminal device can convert the string in the fixed offset into binary through the ASCII table to obtain the first binary value, and convert the string in the user identifier into binary through the ASCII table to obtain the second binary value. The first binary value and the second binary value are XORed to obtain the third binary value, and the third binary value is converted into a string through the ASCII table, which is the sixth XOR result.
[0188] Step (52) may specifically include the following steps: The terminal device can convert the string of the mobile phone number into binary through the ASCII table to obtain the fourth binary value, perform an XOR operation on the third binary value and the fourth binary value to obtain the fifth binary value, and convert the fifth binary value into a string through the ASCII table, which is the seventh XOR result.
[0189] Hash operations can use a hash function to convert the seventh XOR result (string) into a second hash result (string) of fixed length. A hash function is a function that can convert a string of arbitrary length into a string of a fixed length.
[0190] When the length of the string contained in the second hash result is M, and M is less than or N bytes, the rule can be to select (NM) characters from the second hash result according to a certain rule, and combine these (NM) characters with the string contained in the second hash result to form a string of N bytes.
[0191] When the length of the string contained in the second hash result is M, and M is greater than N bytes, the rule can be to select N characters from the second hash result according to certain rules to form an N-byte string. When the length M of the string contained in the second hash result is greater than N, since there are more possibilities to select N characters from M, the generated N-byte string is more difficult to crack, thereby increasing the difficulty of cracking the user's signature.
[0192] It should be noted that the configuration rules in the terminal device and the configuration rules in the server are the same. The hash calculations in the terminal device and the hash calculations in the server are the same.
[0193] In step (56), the terminal device selects a first string with the same string length as the mobile phone number based on the sixth XOR result, including:
[0194] The terminal device can select a first string with the same string length as the mobile phone number from the sixth XOR result according to the second set rule.
[0195] If the length of the string resulting from the sixth XOR operation is X and the length of the string for the mobile phone number is Y, and the length of the string resulting from the sixth XOR operation is less than the length of the string for the mobile phone number, the second setting rule can be to select (YX) characters from the string resulting from the sixth XOR operation according to a certain rule, and combine these (YX) characters with the string resulting from the sixth XOR operation to form a string of Y bytes.
[0196] For example, if the string length of the sixth XOR result is 8, and the string length of a mobile phone number is 12 (e.g., an Indian mobile phone number, 91XXXXXXXXXX), the first and last characters of the two sixth XOR results can be concatenated to form a 16-character string. The middle 12 characters of this 16-character string can then be selected as the first string. For instance, if the string of the sixth XOR result is "afh10233", then concatenating the first and last characters of the two sixth XOR results gives "afh10233afh10233". The middle 12 characters of this 16-character string, "h10233afh102", can then be selected as the first string.
[0197] When the length X of the sixth XOR result string is greater than the length Y of the phone number string, the second rule can be to select Y characters from the sixth XOR result string according to certain rules, resulting in a Y-byte string. Since the length X of the sixth XOR result string is greater than the length Y of the phone number string, there are more possibilities for selecting Y characters from X, making the generated Y-byte string more difficult to crack, thus increasing the difficulty of cracking the user's signature.
[0198] It should be noted that the second setting rule in the terminal device and the second setting rule in the server are the same rule.
[0199] Q can be equal to N or not equal to N. The specific implementation of steps (57) to (510) can be found in the relevant descriptions of steps (52) to (55), which will not be repeated here.
[0200] Optionally, the second hash result includes a string of M bytes, where M equals twice N; in step (54), the terminal device selects a string of N bytes from the second hash result according to a set rule, which may specifically include the following steps:
[0201] (541) The terminal device selects characters at even-numbered positions from the M-byte string in left-to-right order as the N-byte string; or,
[0202] (542) The terminal device selects characters at odd positions from the M-byte string in left-to-right order as the N-byte string; or,
[0203] (543) The terminal device selects characters at even-numbered positions from the M-byte string in right-to-left order as the N-byte string; or,
[0204] (544) The terminal device selects characters at odd positions from the M-byte string in a right-to-left order as the N-byte string.
[0205] This application provides a rule for selecting an N-byte string from an M-byte string.
[0206] For example, take M=32 and N=16.
[0207] The string of M bytes includes: EF90392389909ABC9009909090786543. Then, the character at the even position selected from the string of M bytes in left-to-right order is: F09390AC09000853, which is used as the string of N bytes.
[0208] Optionally, the integrated circuit card identification code includes a string of P bytes. In step (55), the terminal device generates a user feature code of N bytes based on the string of N bytes and the integrated circuit card identification code. Specifically, this may include the following steps:
[0209] (551) The terminal device converts each byte of the N-byte string into a number to obtain N numbers;
[0210] (552) The terminal device calculates the modulus of P for each of the N numbers and obtains N remainders;
[0211] (553) The terminal device selects N characters from the string of P bytes that correspond to the positions of the N remainders, and generates a user feature code of N bytes based on the N characters.
[0212] In this embodiment, the numbers are decimal numbers. P is an integer greater than or equal to 2.
[0213] Integrated circuit card identification codes typically consist of 20 characters. For example, with P=20 and N=16, the string of N bytes is F09390AC09000853. Each byte can be converted to a decimal value using the ASCII table. In the ASCII table, the character "F" corresponds to the value 70, the character "0" to 48, the character "9" to 57, the character "3" to 51, the character "A" to 65, the character "C" to 67, the character "8" to 56, and the character "5" to 53. Therefore, the N remainders are: 10, 8, 17, 11, 17, 8, 15, 7, 8, 17, 8, 8, 8, 16, 13, 11. Then, the 11th, 9th, 18th, 12th, 18th, 9th, 16th, 8th, 9th, 18th, 9th, 9th, 17th, 14th, and 12th bits of the P-byte string can be used to form an N-byte user signature.
[0214] If the string of P bytes is "X0X1X2X3X4X5X6X7X8X9X", 10 X 11 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X 19 Then the N-byte user signature code is "X". 10 X8X 17 X 11 X 17 X8X 15 X7X8X 17 X8X8X8X 16 X 13 X 11 "Among them, X0~X 19 These represent 20 strings from left to right within a string of P bytes.
[0215] Optionally, in step (59), the third hash result includes a string of R bytes, where R equals twice Q; the terminal device selects a string of Q bytes from the third hash result according to a set rule, which may include the following steps:
[0216] (591) The terminal device selects characters at even positions from the R-byte string in left-to-right order as the Q-byte string; or,
[0217] (592) The terminal device selects characters at odd positions from the R-byte string in left-to-right order as the Q-byte string; or,
[0218] (593) The terminal device selects characters at even positions from the R-byte string in a right-to-left order as the Q-byte string; or,
[0219] (594) The terminal device selects characters at odd positions from the R-byte string in a right-to-left order as the Q-byte string.
[0220] The specific implementation of steps (591) to (594) can be found in steps (541) to (544) above, and will not be repeated here.
[0221] Optionally, the integrated circuit card identification code includes a string of P bytes. In step (510), the terminal device generates a user feature code of Q bytes based on the string of Q bytes and the integrated circuit card identification code, which may include the following steps:
[0222] (5101) The terminal device converts each byte of the Q-byte string into a number to obtain Q numbers;
[0223] (5102) The terminal device calculates the modulus of P for each of the Q numbers to obtain Q remainders;
[0224] (5103) The terminal device selects Q characters from the string of P bytes that correspond to the positions of the Q remainders, and generates a Q-byte user feature code based on the Q characters.
[0225] The specific implementation of steps (5101) to (5103) can be found in steps (551) to (553) above, and will not be repeated here.
[0226] 502. The terminal device encrypts the payment data using the user's feature code to obtain the encrypted payment data.
[0227] 503, the terminal device transmits encrypted payment data to the server.
[0228] The specific implementation of steps 502 to 503 can be found in steps 302 to 303 above, and will not be repeated here.
[0229] Please see Figure 6 , Figure 6 This is a flowchart illustrating another payment processing method provided in an embodiment of this application. Figure 6 As shown, the payment processing method may also include the following steps.
[0230] 601. The terminal device generates a user feature code based on feature information, which includes: user identifier, fixed offset, mobile phone number, and integrated circuit card identification code.
[0231] 602. The terminal device encrypts the payment data using the user's feature code to obtain the encrypted payment data.
[0232] 603, The terminal device transmits encrypted payment data to the server.
[0233] For details on the implementation of steps 601 to 603, please refer to [link / reference]. Figure 5 Steps 501 to 503 shown are not repeated here.
[0234] 604, the server has received encrypted payment data from the terminal device.
[0235] Steps 603 and 604 can be the same step, the difference being the subject of execution.
[0236] 605. The server generates a user feature code based on feature information, which includes: user identifier, fixed offset, mobile phone number, and integrated circuit card identification code.
[0237] The feature information in step 605 can be encrypted and stored in the server's database. The database can store the correspondence between user identifiers and feature information, with different user identifiers corresponding to different feature information.
[0238] After the server receives the encrypted payment data from the terminal device, the server's key business interface is invoked, and the server finds the characteristic information corresponding to the user identifier logged in on the terminal device.
[0239] The server and terminal devices use the same method to generate user feature codes. In step 605, the server generates user feature codes based on feature information, which can be done in the same way as in step 601, and will not be repeated here.
[0240] 606, the server decrypts the encrypted payment data using the user's signature.
[0241] In this embodiment, the server and terminal device use the same key (user feature code) for encryption and decryption, ensuring that the encrypted payment data transmitted can be decrypted by the server. Since different users have different user identifiers, the generated user feature codes are also different, thereby increasing the difficulty of cracking the user feature codes and thus improving the security of payment data transmission.
[0242] Optionally, before executing 601, you can also perform the following steps:
[0243] (61) The terminal device obtains a fixed offset and reads the integrated circuit card identification code of the user's identity card;
[0244] (62) The terminal device performs an XOR operation on the user identifier and the fixed offset to obtain a second XOR result;
[0245] (63) The terminal device encrypts the second XOR result and the integrated circuit card identification code to obtain the second encryption result;
[0246] (64) The terminal device sends the second encryption result to the server via SMS.
[0247] In this embodiment of the application, the terminal device can initialize the dynamic library file when the client application is started. At this time, the offset of the target function corresponding to the SO file in the dynamic library file can be obtained, that is, the fixed offset.
[0248] A user identity card, also known as a subscriber identity module (SIM) card, is simply called a SIM card. The integrated circuit card identity (ICCID) is also simply called an ICCID. Terminal devices can read the ICCID of a SIM card. An ICCID typically consists of 20 characters.
[0249] The specific implementation of step (62) can be found in the detailed description of step (31), which will not be repeated here.
[0250] The terminal device can encrypt the second XOR result and the integrated circuit card identification code using a second encryption algorithm to obtain a second encrypted result. The second encryption algorithm may include an RSA encryption algorithm; for example, RSA2048 can be used to encrypt the second XOR result to obtain the second encrypted result.
[0251] The process of the terminal device sending the second encryption result to the server via SMS may include: the terminal device encoding the second encryption result to obtain encoded second data, and the terminal device sending the encoded second data to the server via SMS.
[0252] The terminal device does not directly encode the feature information (user identifier and fixed offset). Instead, it performs XOR processing, encryption, and encoding on the feature information before transmitting the encoded data to the server. There is no hard-coded information (information that directly encodes the feature information) on the terminal device (client) side. Even if malicious actors decompile the client code, they cannot see the feature information, thus improving the security of the feature information during transmission.
[0253] Optionally, before performing step 604, the following steps may also be performed:
[0254] (71) The server receives a text message from the terminal device, decrypts the text message to obtain the second XOR result and the integrated circuit card identification code;
[0255] (72) The server queries the user identifier corresponding to the mobile phone number of the terminal device based on the correspondence between the mobile phone number and the user identifier;
[0256] (73) The server performs an XOR operation between the user identifier corresponding to the mobile phone number and the fixed offset to obtain a fourth XOR result;
[0257] (74) If the second XOR result is the same as the fourth XOR result, the server will encrypt the feature information and store it in the database.
[0258] In step (71), "decrypting the SMS to obtain the second XOR result and the integrated circuit card identification code" can be performed before step (72), after step (72), or simultaneously. This application embodiment does not limit this.
[0259] In this embodiment of the application, after the server receives a text message from the terminal device, the server can know the mobile phone number based on the text message, and decrypt the second encryption result in the text message using the second encryption algorithm to obtain the second XOR result and the integrated circuit card identification code.
[0260] When a user registers for a mobile wallet platform or payment application on a terminal device using their mobile phone number, the server can generate a user identifier (user ID) and establish a correspondence between the mobile phone number and the user identifier, storing this correspondence on the server.
[0261] The server queries the user identifier corresponding to the mobile phone number of the terminal device based on the mapping relationship between mobile phone numbers and user identifiers. The server can determine the offset of the objective function corresponding to the SO file in the dynamic library file existing in the server's operating system, i.e., the fixed offset.
[0262] The server performs a fourth XOR operation on the user identifier corresponding to the mobile phone number and the fixed offset. If the second XOR result is the same as the fourth XOR result, it indicates that the feature information used by the terminal device (user identifier, fixed offset, mobile phone number, and integrated circuit card identification code) is the same as the feature information used by the server. The feature information can be encrypted and stored in the server's database.
[0263] This application embodiment can verify the integrity of the user's integrated circuit card identification code to ensure that the user is a genuine and legitimate user.
[0264] Optionally, if the second XOR result and the fourth XOR result are different, the server sends a prompt message to the terminal device, the prompt message being used to indicate that the user identifier verification failed.
[0265] In this embodiment, before transmitting encrypted payment data to the server, the terminal device encrypts the second XOR result obtained by XORing the user identifier and fixed offset with the integrated circuit card identification code and then transmits the encrypted data to the server. This allows the server to verify whether the terminal device's feature information (user identifier, fixed offset, mobile phone number, and integrated circuit card identification code) is the same as the server's feature information (user identifier, fixed offset, mobile phone number, and integrated circuit card identification code) before executing step 604, thereby verifying the user identifier and integrated circuit card identification code to ensure that the user is a genuine and legitimate user.
[0266] Optionally, after performing step 606, the following steps may also be performed:
[0267] If decryption is successful, the server generates payment result data based on the decrypted payment data and returns the payment result data to the terminal device.
[0268] In this embodiment of the application, upon successful decryption, the corresponding payment result data can be returned to the user for display. The payment result data may include at least one of the following: payment success notification data, payment recipient, payment amount, payment method, payment time, and description of the paid goods.
[0269] Optionally, after performing step 606, the following steps may also be performed:
[0270] If decryption fails, the server returns a payment failure result to the terminal device.
[0271] In this embodiment of the application, when decryption fails, a corresponding payment failure result can be returned to the user for display. The payment failure result may include at least one of the following: the reason for the failure and a solution after the failure.
[0272] The following provides a detailed process for a payment processing method.
[0273] The client is installed on the terminal device, and the server is installed on the server. The fixed offset can be the offset of the objective function corresponding to the SO file in the dynamic library file. Taking a mobile phone as an example, the terminal device is...
[0274] The client-side execution flow is as follows:
[0275] 1.1 When the client application is started, the dynamic library file is initialized. At this time, the fixed offset of the target function corresponding to the fixed SO file is obtained and set as A.
[0276] 1.2 Read the unique identifier ICCID (Integrated Circuit Card Identification Code) on the SIM card and set it to B;
[0277] 1.3. Perform an XOR operation between the user identifier UID and A, and set the result as C (the second XOR result);
[0278] 1.4. Concatenate B and C using the character "|", then encrypt them using an encryption function (e.g., RSA2048) to obtain the encryption result (second encryption result). Encode the encryption result (e.g., RSA("B|C")) using base64, and send the encoded result as the SMS content via SMS.
[0279] 2.1 In scenarios where encryption is required, such as during payment, payment data (e.g., recharge amount, recharge mobile phone number) needs to be encrypted. The user feature code USC is generated using four elements (mobile phone number, UID, ICCID, fixed offset), and the USC is used as the initial vector for AES encryption.
[0280] Steps 1.1 to 1.4 can be found in steps (61) to (64) above. Step 2.1 can be found in steps 601 to 602 above.
[0281] The server-side execution process is as follows:
[0282] 3.1 The server receives and decrypts the SMS message, then decodes the message content using base64 encoding to obtain "B|C";
[0283] 3.2 When the server receives an SMS message through the SMS service provider's interface, it obtains the sender's information, including the phone number. It then retrieves the user's UID from the phone number, performs an XOR operation between the UID and a fixed offset A, and compares the XOR result with C. If the comparison is correct, the process continues.
[0284] 3.3. The four elements (mobile phone number, UID, ICCID, and fixed offset) are encrypted and persisted to the database.
[0285] 3.4 When a critical business interface (such as a payment business interface) is called, a USC is generated using the four elements, and the USC is used as the AES initialization vector for decryption.
[0286] 3.5 If decryption fails, the client is considered to have been compromised or to be an abnormal user; if decryption succeeds, proceed to the next business process (e.g., return the corresponding result data to the user for display).
[0287] Steps 3.1 to 3.3 can be found in steps (71) to (74) above. Steps 3.4 to 3.5 can be found in steps 604 to 606 above.
[0288] The AES initialization vector generation in this embodiment can utilize USC to generate different initialization vectors for different users and services. This eliminates the need for manually entering function offsets for each version, enabling convenient management. Within a business process requiring security protection, the business state can be dynamically maintained through USC decryption, ensuring that the requests are legitimate business requests and not requests from tampered applications, thus improving the flexibility and security of business requests. Different services have different initialization vectors, and different users encrypt the same plaintext with different ciphertexts, ensuring the diversity of USC. The integrity of the user's SIM card can be verified to ensure that the user is a genuine and legitimate UPI user.
[0289] In this embodiment, no hard-coded vector information exists on the client side, and the vector values are not visible when the client code is decompiled. Different objective functions have different vector information (different objective functions have different fixed offsets), resulting in vector diversity. The encryption results for the same plaintext also differ between different users. Client integrity can be verified to ensure client security. If the client code is modified, the vector information (USC) will change, causing server-side decryption to fail, indicating client tampering. Verification of the user's legitimate SIM card is also possible.
[0290] The USC (User Identity Code) is used to bind a user's identity (e.g., phone number, UID, ICCID) to a fixed offset (the offset of the target function in the SO file). This is used to authenticate and encrypt the functionality of UPI used by legitimate users through official channels. The steps for generating the USC are as follows:
[0291] 4.1 When the SO file is loaded and the corresponding target function (e.g., reporting mobile phone number, phone bill recharge) is called, the called function will obtain the offset address of its own function, such as 0x0abdfc09;
[0292] 4.2. Convert the Offset address 0x0abdfc09 to a character, which is 0x12131444 (fixed offset). XOR this character with the UID: 90180902 to generate A: afh10233.
[0293] 4.3. The result of concatenating the first and last parts of A is: afh10233afh10233;
[0294] 4.4. XOR the 12 bytes in the middle of B: h10233afh102 with the mobile phone number, the result is: 90393ABFC901. Then perform a hash operation, the result is 32 bytes of C: EF90392389909ABC9009909090786543.
[0295] 4.5. Take the even-numbered positions of C from left to right to form a 16-byte D: F09390AC09000853;
[0296] 4.6. Convert each byte in position D to a number, and take the remainder modulo 20. This remainder represents the position of the ICCID. For example, a remainder of 1 means taking the byte at the second position of the ICCID. Extracting 16 bytes in this way yields the User Identity Code (USC).
[0297] Steps 4.1 to 4.5 can be found in steps (51), (56) to (510).
[0298] A USC (User ID) consists of four elements: ICCID, mobile phone number, UID, and a fixed offset (the offset of the objective function corresponding to the SO file). It is generated as a 16-character sequence using an algorithm. Different users generate different USCs, which are used to uniquely bind the user identifier to the genuine SO file. Therefore, the USC can uniquely represent the characteristic identifier of a user and an SO file.
[0299] The original SO file offset can only verify the file itself, but cannot verify the legitimacy of the SIM card, nor can it verify the consistency between the user, device, and mobile phone number. This application's embodiment generates an AES initialization vector (USC) using four elements: ICCID, mobile phone number, UID, and a fixed offset (the offset of the objective function corresponding to the SO file). This enhances AES encryption security and improves the protection logic of the service.
[0300] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the terminal device includes the corresponding hardware structure and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0301] This application embodiment can divide the terminal device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0302] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a payment processing device provided in an embodiment of this application. The payment processing device 700 can be applied to a terminal device. The payment processing device 700 may include a first generation unit 701, an encryption unit 702, and a transmission unit 703, wherein:
[0303] The first generation unit 701 is used to generate a user feature code based on feature information, wherein the feature information includes: user identifier and fixed offset;
[0304] The encryption unit 702 is used to encrypt the payment data using the user feature code to obtain the encrypted payment data;
[0305] The transmission unit 703 is used to transmit the encrypted payment data to the server.
[0306] Optionally, the feature information may also include a mobile phone number and an integrated circuit card identification code.
[0307] Optionally, the payment processing device 700 may further include an acquisition unit 704 and an XOR processing unit 705;
[0308] The acquisition unit 704 is used to acquire a fixed offset before the first generation unit 701 generates the user feature code based on the feature information;
[0309] The XOR processing unit 705 is used to perform XOR processing on the user identifier and the fixed offset to obtain a first XOR result.
[0310] The encryption unit 702 is used to encrypt the first XOR result to obtain a first encryption result;
[0311] The transmission unit 703 is also used to transmit the first encryption result to the server.
[0312] Optionally, the acquisition unit 704 is further configured to acquire a fixed offset and read the integrated circuit card identification code of the user identity card before the first generation unit 701 generates the user feature code based on the feature information.
[0313] The XOR processing unit 705 is further configured to perform XOR processing on the user identifier and the fixed offset to obtain a second XOR result;
[0314] The encryption unit 702 is further configured to encrypt the second XOR result and the integrated circuit card identification code to obtain a second encryption result;
[0315] The transmission unit 703 is also used to send the second encryption result to the server via SMS.
[0316] Optionally, the first generation unit 701 generates a user feature code based on feature information, including: performing an XOR operation on a fixed offset and a user identifier to obtain a fifth XOR result; performing a hash operation on the fifth XOR result to obtain a first hash result; and selecting a string of N bytes from the first hash result according to a set rule, wherein the user feature code includes the string of N bytes.
[0317] Optionally, the first generation unit 701 generates a user feature code based on feature information, including: performing an XOR operation on a fixed offset and a user identifier to obtain a sixth XOR result; if the sixth XOR result has the same string length as the mobile phone number, performing an XOR operation on the sixth XOR result and the mobile phone number to obtain a seventh XOR result; performing a hash operation on the seventh XOR result to obtain a second hash result; selecting an N-byte string from the second hash result according to a set rule; and generating an N-byte user feature code based on the N-byte string and the integrated circuit card identification code.
[0318] Optionally, the first generation unit 701 generates a user feature code based on feature information, including: performing an XOR operation on a fixed offset and a user identifier to obtain a sixth XOR result; if the sixth XOR result is not the same as the string length of the mobile phone number, selecting a first string with the same string length as the mobile phone number based on the sixth XOR result; performing an XOR operation on the first string and the mobile phone number to obtain an eighth XOR result; performing a hash operation on the eighth XOR result to obtain a third hash result; selecting a Q-byte string from the third hash result according to a set rule; and generating a Q-byte user feature code based on the Q-byte string and the integrated circuit card identification code.
[0319] Optionally, the second hash result includes a string of M bytes, where M equals twice N; the first generation unit 701 selects a string of N bytes from the second hash result according to a set rule, including:
[0320] From a string of M bytes, select characters at even-numbered positions from left to right to form the string of N bytes; or,
[0321] From a string of M bytes, select characters at odd-numbered positions in left-to-right order to form the string of N bytes; or,
[0322] From a string of M bytes, select characters at even-numbered positions in right-to-left order to form the string of N bytes; or,
[0323] From a string of M bytes, select characters at odd positions in order from right to left to form the string of N bytes.
[0324] Optionally, the integrated circuit card identification code includes a string of P bytes. The first generation unit 701 generates an N-byte user feature code based on the N-byte string and the integrated circuit card identification code, including: converting each byte in the N-byte string into a number to obtain N numbers; calculating the modulus of P for each of the N numbers to obtain N remainders; selecting N characters from the P-byte string at positions corresponding to the N remainders, and generating an N-byte user feature code based on the N characters.
[0325] Optionally, the first generation unit 701 selects a first string with the same string length as the mobile phone number based on the sixth XOR result, including:
[0326] According to the second set rule, select the first string with the same string length as the mobile phone number from the sixth XOR result.
[0327] Optionally, the third hash result includes a string of R bytes, where R equals twice Q; the first generation unit 701 selects a string of Q bytes from the third hash result according to a set rule, including:
[0328] From a string of R bytes, select characters at even positions from left to right as the string of Q bytes; or,
[0329] From a string of R bytes, select characters at odd positions in left-to-right order to form the string of Q bytes; or,
[0330] From a string of R bytes, select characters at even-numbered positions from right to left as the string of Q bytes; or,
[0331] From a string of R bytes, select characters at odd positions in order from right to left to form the string of Q bytes.
[0332] Optionally, the integrated circuit card identification code includes a string of P bytes. The first generation unit 701 generates a user feature code of Q bytes based on the string of Q bytes and the integrated circuit card identification code, including: converting each byte in the string of Q bytes into a number to obtain Q numbers; calculating the modulus of P for each of the Q numbers to obtain Q remainders; selecting Q characters from the string of P bytes that correspond to the positions of the Q remainders, and generating a user feature code of Q bytes based on the Q characters.
[0333] In this embodiment, the first generation unit 701, encryption unit 702, acquisition unit 704, and XOR processing unit 705 may be processors in a terminal device. The transmission unit 703 may be a communication module in the terminal device.
[0334] Figure 7 For a detailed implementation of the payment processing device 700 shown, please refer to [link / reference]. Figures 3 to 6 The implementation methods of the terminal device are not described in detail here.
[0335] In this embodiment, the user feature code is generated based on a fixed offset and a user identifier. Since the fixed offset does not change during version updates, there is no need for manual input of the new version's offset in the background for each version update, thereby improving the convenience of payment processing.
[0336] Please see Figure 8 , Figure 8This is a schematic diagram of another payment processing device provided in an embodiment of this application. The payment processing device 800 is applied to a server and may include a receiving unit 801, a second generating unit 802, and a decryption unit 803, wherein:
[0337] The receiving unit 801 is used to receive encrypted payment data from the terminal device;
[0338] The second generation unit 802 is used to generate a user feature code based on feature information, the feature information including: user identifier and fixed offset;
[0339] The decryption unit 803 is used to decrypt the encrypted payment data using the user feature code.
[0340] Optionally, the feature information may also include a mobile phone number and an integrated circuit card identification code.
[0341] The payment processing device 800 may also include a query unit 804, an XOR processing unit 805, and a storage unit 806;
[0342] Optionally, the receiving unit 801 is further configured to receive a first encryption result from the terminal device;
[0343] The decryption unit 803 is also used to decrypt the first encryption result to obtain the first XOR result;
[0344] The query unit 804 is used to query the user identifier corresponding to the device identifier of the terminal device according to the correspondence between the device identifier and the user identifier.
[0345] The XOR processing unit 805 is used to perform XOR processing on the user identifier corresponding to the device identifier and the fixed offset to obtain a third XOR result.
[0346] The storage unit 806 is used to encrypt the feature information and store it in the database when the first XOR result and the third XOR result are the same.
[0347] Optionally, the receiving unit 801 is further configured to receive a text message from a terminal device, decrypt the text message to obtain a second XOR result and an integrated circuit card identification code;
[0348] The query unit 804 is also used to query the user identifier corresponding to the mobile phone number of the terminal device according to the correspondence between the mobile phone number and the user identifier;
[0349] The XOR processing unit 805 is further configured to perform XOR processing on the user identifier corresponding to the mobile phone number and the fixed offset to obtain a fourth XOR result;
[0350] The storage unit 806 is further configured to encrypt and store the feature information in the database when the second XOR result is the same as the fourth XOR result.
[0351] Optionally, the second generation unit 802 generates a user feature code based on feature information, including: performing an XOR operation on a fixed offset and a user identifier to obtain a fifth XOR result; performing a hash operation on the fifth XOR result to obtain a first hash result; and selecting a string of N bytes from the first hash result according to a set rule, wherein the user feature code includes the string of N bytes.
[0352] Optionally, the second generation unit 802 generates a user feature code based on feature information, including: performing an XOR operation on a fixed offset and a user identifier to obtain a sixth XOR result; if the sixth XOR result has the same string length as the mobile phone number, performing an XOR operation on the sixth XOR result and the mobile phone number to obtain a seventh XOR result; performing a hash operation on the seventh XOR result to obtain a second hash result; selecting an N-byte string from the second hash result according to a set rule; and generating an N-byte user feature code based on the N-byte string and the integrated circuit card identification code.
[0353] Optionally, the second generation unit 802 generates a user feature code based on feature information, including: performing an XOR operation on a fixed offset and a user identifier to obtain a sixth XOR result; if the sixth XOR result is not the same as the string length of the mobile phone number, selecting a first string with the same string length as the mobile phone number based on the sixth XOR result; performing an XOR operation on the first string and the mobile phone number to obtain an eighth XOR result; performing a hash operation on the eighth XOR result to obtain a third hash result; selecting a Q-byte string from the third hash result according to a set rule; and generating a Q-byte user feature code based on the Q-byte string and the integrated circuit card identification code.
[0354] Optionally, the second hash result includes a string of M bytes, where M equals twice N; the second generation unit 802 selects a string of N bytes from the second hash result according to a set rule, including:
[0355] From a string of M bytes, select characters at even-numbered positions from left to right to form the string of N bytes; or,
[0356] From a string of M bytes, select characters at odd-numbered positions in left-to-right order to form the string of N bytes; or,
[0357] From a string of M bytes, select characters at even-numbered positions in right-to-left order to form the string of N bytes; or,
[0358] From a string of M bytes, select characters at odd positions in order from right to left to form the string of N bytes.
[0359] Optionally, the integrated circuit card identification code includes a string of P bytes. The second generation unit 802 generates an N-byte user feature code based on the N-byte string and the integrated circuit card identification code, including: converting each byte in the N-byte string into a number to obtain N numbers; calculating the modulus of P for each of the N numbers to obtain N remainders; selecting N characters from the P-byte string at positions corresponding to the N remainders, and generating an N-byte user feature code based on the N characters.
[0360] Optionally, the second generation unit 802 selects a first string with the same string length as the mobile phone number based on the sixth XOR result, including:
[0361] According to the second set rule, select the first string with the same string length as the mobile phone number from the sixth XOR result.
[0362] Optionally, the third hash result includes a string of R bytes, where R equals twice Q; the second generation unit 802 selects a string of Q bytes from the third hash result according to a set rule, including:
[0363] From a string of R bytes, select characters at even positions from left to right as the string of Q bytes; or,
[0364] From a string of R bytes, select characters at odd positions in left-to-right order to form the string of Q bytes; or,
[0365] From a string of R bytes, select characters at even-numbered positions from right to left as the string of Q bytes; or,
[0366] From a string of R bytes, select characters at odd positions in order from right to left to form the string of Q bytes.
[0367] Optionally, the integrated circuit card identification code includes a string of P bytes. The second generation unit 802 generates a user feature code of Q bytes based on the string of Q bytes and the integrated circuit card identification code, including: converting each byte in the string of Q bytes into a number to obtain Q numbers; calculating the modulus of P for each of the Q numbers to obtain Q remainders; selecting Q characters from the string of P bytes that correspond to the positions of the Q remainders, and generating a user feature code of Q bytes based on the Q characters.
[0368] In this embodiment, the second generation unit 802, decryption unit 803, query unit 804, XOR processing unit 805, and storage unit 806 can be processors in a server. The receiving unit 801 can be a communication module in a server.
[0369] Figure 8 For a detailed implementation of the payment processing device 800 shown, please refer to [link / reference]. Figures 3 to 6 The implementation method of the server is described in detail here.
[0370] In this embodiment, the server and terminal device use the same user feature code for encryption and decryption to ensure the reliability of encryption and decryption. The user feature code is generated based on a fixed offset and a user identifier. Since the fixed offset does not change during version updates, there is no need for manual input of the new version's offset in the background for each version update, thereby improving the convenience of payment processing.
[0371] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application, such as... Figure 9 As shown, the terminal device 900 includes a processor 901 and a memory 902, which can be interconnected via a communication bus 903. The communication bus 903 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 903 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 9 The code uses only a single thick line to represent a bus, but this does not indicate that there is only one bus or one type of bus. Memory 902 stores computer programs, which include program instructions. Processor 901 is configured to call these program instructions, which include instructions for execution. Figures 3 to 6 Some or all of the steps in the method executed by the terminal device.
[0372] The processor 901 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of programs in the above scheme.
[0373] The memory 902 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.
[0374] The terminal device 900 may include a display module, which may include a display screen and a backlight module.
[0375] In addition, the terminal device 900 may also include a communication module 904, which may be a communication module that supports SMS sending, and may also support wired or wireless communication with a server. The terminal device 900 may also include general components such as communication interfaces and antennas, which will not be described in detail here.
[0376] In this embodiment, the user feature code is generated based on a fixed offset and a user identifier. Since the fixed offset does not change during version updates, there is no need for manual input of the new version's offset in the background for each version update, thereby improving the convenience of payment processing.
[0377] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a server provided in an embodiment of this application, such as... Figure 10As shown, the server 1000 includes a processor 1001 and a memory 1002, which are interconnected via a communication bus 1003. The communication bus 1003 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 1003 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 10 The bus is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. Memory 1002 stores computer programs, which include program instructions. Processor 1001 is configured to invoke these program instructions, which include instructions for execution. Figures 3 to 6 Some or all of the steps in the method executed by the server.
[0378] The processor 1001 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the above-mentioned program.
[0379] The memory 1002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.
[0380] In addition, the server 1000 may also include a communication module 1004, which may be a communication module that supports SMS reception, and may also support wired or wireless communication with terminal devices. The server 1000 may also include general components such as communication interfaces and antennas, which will not be described in detail here.
[0381] In this embodiment, the server and terminal device use the same user feature code for encryption and decryption to ensure the reliability of encryption and decryption. The user feature code is generated based on a fixed offset and a user identifier. Since the fixed offset does not change during version updates, there is no need for manual input of the new version's offset in the background for each version update, thereby improving the convenience of payment processing.
[0382] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the payment processing methods described in the above method embodiments.
[0383] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0384] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0385] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0386] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0387] Furthermore, the functional units in the various embodiments of the application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software program module.
[0388] If the integrated unit is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0389] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory, a random access memory, a magnetic disk, or an optical disk, etc.
[0390] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A payment processing method, characterized in that, include: Obtain a fixed offset, and perform an XOR operation between the user identifier and the fixed offset to obtain a first XOR result; The first XOR result is encrypted to obtain the first encrypted result; The first encryption result is transmitted to the server, which is used to verify the terminal device based on the first encryption result and to store feature information after the server successfully verifies the device. A user feature code is generated based on the feature information, which includes: the user identifier and a fixed offset, wherein the fixed offset is the offset of the objective function corresponding to the SO file in the dynamic library file maintained by the terminal device; The payment data is encrypted using the user's feature code to obtain the encrypted payment data; The encrypted payment data is transmitted to the server, which generates the user feature code based on the feature information and decrypts the encrypted payment data based on the user feature code. The step of generating a user feature code based on the feature information includes: generating a user feature code by performing at least one XOR operation and at least one hash operation based on the feature information.
2. The method according to claim 1, characterized in that, The feature information also includes the mobile phone number and integrated circuit card identification code.
3. The method according to claim 2, characterized in that, Before generating a user feature code based on feature information, the method further includes: Obtain a fixed offset and read the integrated circuit card identification code of the user's identity card; The user identifier is XORed with the fixed offset to obtain a second XOR result. The second XOR result and the integrated circuit card identification code are encrypted to obtain the second encryption result; The terminal device sends the second encryption result to the server via SMS. The server is used to verify the terminal device based on the second encryption result and to store the feature information after the server successfully verifies the device.
4. A payment processing method, characterized in that, include: Receive a first encryption result from a terminal device, and decrypt the first encryption result to obtain a first XOR result; Based on the mapping relationship between device identifiers and user identifiers, query the user identifier corresponding to the device identifier of the terminal device; The user identifier corresponding to the device identifier is XORed with a fixed offset to obtain a third XOR result. If the first XOR result and the third XOR result are the same, the feature information is encrypted and stored in the database; Receive encrypted payment data from the terminal device; A user feature code is generated based on the feature information, which includes: user identifier and fixed offset, wherein the fixed offset is the offset of the objective function corresponding to the SO file in the dynamic library file maintained by the server. The encrypted payment data is decrypted using the user's signature. The step of generating a user feature code based on the feature information includes: generating a user feature code by performing at least one XOR operation and at least one hash operation based on the feature information.
5. The method according to claim 4, characterized in that, The feature information also includes the mobile phone number and integrated circuit card identification code.
6. The method according to claim 5, characterized in that, Before receiving encrypted payment data from the terminal device, the method further includes: Receive a text message from a terminal device, decrypt the text message to obtain a second XOR result and an integrated circuit card identification code; Query the user identifier corresponding to the mobile phone number of the terminal device based on the correspondence between mobile phone number and user identifier; The user identifier corresponding to the mobile phone number is XORed with the fixed offset to obtain the fourth XOR result; If the second XOR result is the same as the fourth XOR result, the feature information is encrypted and stored in the database.
7. The method according to claim 1 or 4, characterized in that, The process of generating a user feature code based on the feature information includes: The fixed offset is XORed with the user identifier to obtain the fifth XOR result. Perform a hash operation on the fifth XOR result to obtain the first hash result; According to the set rules, N bytes of string are selected from the first hash result, and the user feature code includes the N bytes of string.
8. The method according to claim 2 or 5, characterized in that, The process of generating a user feature code based on the feature information includes: The fixed offset is XORed with the user identifier to obtain the sixth XOR result. If the sixth XOR result has the same string length as the mobile phone number, perform an XOR operation between the sixth XOR result and the mobile phone number to obtain the seventh XOR result; Perform a hash operation on the seventh XOR result to obtain the second hash result; Select N bytes of string from the second hash result according to the set rules; An N-byte user feature code is generated based on the N-byte string and the integrated circuit card identification code.
9. The method according to claim 8, characterized in that, The method further includes: If the sixth XOR result is not the same as the string length of the mobile phone number, the first string with the same string length as the mobile phone number is selected based on the sixth XOR result; The first string is XORed with the mobile phone number to obtain the eighth XOR result; Perform a hash operation on the eighth XOR result to obtain the third hash result; Select a string of Q bytes from the third hash result according to the set rules; A Q-byte user feature code is generated based on the Q-byte string and the integrated circuit card identification code.
10. The method according to claim 8, characterized in that, The second hash result includes a string of M bytes, where M equals twice N; the step of selecting a string of N bytes from the second hash result according to a set rule includes: From a string of M bytes, select characters at even-numbered positions from left to right to form the string of N bytes; or, From a string of M bytes, select characters at odd-numbered positions in left-to-right order to form the string of N bytes; or, From a string of M bytes, select characters at even-numbered positions in right-to-left order to form the string of N bytes; or, From a string of M bytes, select characters at odd positions in order from right to left to form the string of N bytes.
11. The method according to claim 8, characterized in that, The integrated circuit card identification code includes a P-byte string. The step of generating an N-byte user feature code based on the N-byte string and the integrated circuit card identification code includes: Convert each byte of the N-byte string into a number to obtain N numbers; Calculate the modulus of P for each of the N numbers to obtain N remainders; Select N characters from the P-byte string that correspond to the positions of the N remainders, and generate an N-byte user feature code based on the N characters.
12. A payment processing device, characterized in that, include: The acquisition unit is used to acquire a fixed offset. An XOR processing unit is used to perform an XOR operation on the user identifier and the fixed offset to obtain a first XOR result. An encryption unit is used to encrypt the first XOR result to obtain a first encrypted result; A transmission unit is used to transmit the first encryption result to a server, and the server is used to verify the terminal device according to the first encryption result, and to store feature information after the server successfully verifies the device. The first generation unit is used to generate a user feature code based on the feature information, wherein the feature information includes: the user identifier and a fixed offset, wherein the fixed offset is the offset of the target function corresponding to the SO file in the dynamic library file of the operating system of the terminal device; The encryption unit is also used to encrypt the payment data using the user feature code to obtain encrypted payment data; The transmission unit is further configured to transmit the encrypted payment data to the server, and the server is configured to generate the user feature code based on the feature information, and to decrypt the encrypted payment data based on the user feature code. The first generation unit generates a user feature code based on the feature information, including: generating a user feature code by performing at least one XOR operation and at least one hash operation based on the feature information.
13. A payment processing device, characterized in that, include: A receiving unit is used to receive the first encryption result from the terminal device; A decryption unit is used to decrypt the first encryption result to obtain a first XOR result; The query unit is used to query the user identifier corresponding to the device identifier of the terminal device based on the correspondence between the device identifier and the user identifier; The XOR processing unit is used to perform an XOR operation on the user identifier corresponding to the device identifier and a fixed offset to obtain a third XOR result. A storage unit is used to encrypt and store the feature information in a database when the first XOR result and the third XOR result are the same. The receiving unit is also used to receive encrypted payment data from the terminal device; The second generation unit is used to generate a user feature code based on the feature information, the feature information including: user identifier and fixed offset, the fixed offset being the offset of the target function corresponding to the SO file in the dynamic library file of the server's operating system; The decryption unit is also used to decrypt the encrypted payment data using the user feature code; The second generation unit generates a user feature code based on the feature information, including: generating a user feature code by performing at least one XOR operation and at least one hash operation based on the feature information.
14. A payment processing device, characterized in that, It includes a processor and a memory, the memory being used to store computer programs or instructions, and the processor being configured to invoke the computer programs or instructions to perform the method as described in any one of claims 1 to 11.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
File encryption storage method, device, equipment and storage medium
CN110532129A
Vehicle data management method and device, terminal equipment, server and storage medium
CN111008394A
