Data obfuscation method and device based on pseudo-random algorithm
By adopting data confusion methods based on pseudo -random algorithms in data transmission, the problem of secret leakage and data transmission security in existing technologies is solved, and efficient and secure data transmission is achieved.
Patent Information
- Application Number
- CN202411889116.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-01-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing data encryption methods, secret keys are prone to leakage, data desensitization cannot be restored, and data sharding increases system complexity and affects performance, resulting in data transmission security and efficiency problems.
Adopt data confusion methods based on pseudo -random algorithms, confuse the data through a dynamic static combination, and use the constructed random algorithm factor (including base parameters, index parameters, and offset parameters) Target data.
The security of data transmission is greatly improved, the secret leakage problem is avoided, and the privacy and reliability of the data is improved by dynamic processing.
Smart Images

Figure CN119382886A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of data obfuscation, and more particularly to a data obfuscation method, apparatus, device, and computer-readable storage medium based on a pseudo-random algorithm. Background Art
[0002] Data obfuscation technology is often used in the process of data transmission to prevent data from being easily obtained or understood by malicious users. It is an important means to protect sensitive data and system security. Common data obfuscation technologies include data encryption, data desensitization, data segmentation, access control, etc., and transmit data through common symmetric encryption and asymmetric encryption or transmit data in segments to achieve the purpose of protecting data.
[0003] In client-server data transmission scenarios, encrypted transmission is used, and the secret key usually needs to be built into the configuration file. Therefore, the secret key is easily leaked, leading to security issues. Data desensitization cannot restore the data, and there are limitations in the application scenarios. Data sharding requires multiple interactions, which increases the complexity of the system and has a certain impact on system performance.
[0004] In summary, how to build an efficient and secure data encryption method is a problem that needs to be solved urgently. Summary of the invention
[0005] According to the embodiments of the present application, a data obfuscation scheme based on a pseudo-random algorithm is provided, which uses a combination of dynamic and static methods to obfuscate data, solves the problem that the secret key is built into the configuration in the current mainstream algorithm and is easy to be obtained, and greatly improves the security of data transmission.
[0006] In a first aspect of the present application, a data obfuscation method based on a pseudo-random algorithm is provided. The method comprises: Obtain the original data to be obfuscated; Converting and segmenting the original data to obtain initial data; The constructed random algorithm factor and the initial data are used as input, and obfuscation is performed using the following formula to obtain obfuscated target data; the random algorithm factor includes a base parameter, an exponent parameter, and an offset parameter; ; in, is the index parameter; is the cardinality parameter; is the offset parameter; n is the algorithm length; Num is the initial data; M is a prime number; is a prime number sequence.
[0007] Furthermore, it also includes: The cardinality parameter can be calculated as follows: ; Among them, g(x) is an auxiliary function.
[0008] Furthermore, it also includes: The exponential parameter is calculated by performing multiple recursions using the following formula: ; Where n is the algorithm length; i is the current recursion number; e is a natural constant.
[0009] Furthermore, it also includes: The offset parameter can be calculated as follows: ; Where Cn is the generated offset parameter; α is the offset amplitude; φ is the offset angle; n is the algorithm length; β is the initial value of attenuation; Xn-1 is the value of the n-1th item.
[0010] Furthermore, it also includes: The obfuscated data can be restored in the following ways: ; Among them, D is the original data.
[0011] In a second aspect of the present application, a data obfuscation device based on a pseudo-random algorithm is provided. The device comprises: An acquisition module, used to obtain the original data to be obfuscated; A processing module, used for converting and segmenting the original data to obtain initial data; An obfuscation module is used to use the constructed random algorithm factor and the initial data as input, and perform obfuscation according to the following formula to obtain obfuscated target data; the random algorithm factor includes a base parameter, an exponent parameter, and an offset parameter; ; in, is the index parameter; is the cardinality parameter; is the offset parameter; n is the algorithm length; Num is the initial data; M is a prime number; is a prime number sequence.
[0012] In a third aspect of the present application, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0013] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present application is implemented.
[0014] The data obfuscation method based on a pseudo-random algorithm provided in the embodiment of the present application obtains the original data to be obfuscated; converts and divides the original data to obtain initial data; uses the constructed random algorithm factor and the initial data as input, and obfuscates the data through a self-developed algorithm to obtain obfuscated target data; the random algorithm factor includes a base parameter, an exponent parameter, and an offset parameter, which solves the problem that the current mainstream algorithm has a secret key built into the configuration and is easy to obtain, thereby greatly improving the security of data transmission.
[0015] It should be understood that the contents described in the Summary of the Invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein: Figure 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied; Figure 2 is a flow chart of a data obfuscation method based on a pseudo-random algorithm according to an embodiment of the present application; Figure 3 is a block diagram of a data obfuscation device based on a pseudo-random algorithm according to an embodiment of the present application; Figure 4 It is a schematic diagram of the structure of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0018] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0019] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of a data obfuscation method based on a pseudo-random algorithm or a data obfuscation device based on a pseudo-random algorithm of the present application can be applied.
[0020] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0021] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as model training applications, video recognition applications, web browser applications, social platform software, etc.
[0022] The terminal device 101 can be hardware or software. When the terminal device 101 is hardware, it can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) players, laptop computers and desktop computers, etc. When the terminal device 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0023] When the terminal device 101 is hardware, a video acquisition device may be installed thereon. The video acquisition device may be any device capable of acquiring video, such as a camera, a sensor, etc. A user may use the video acquisition device on the terminal device 101 to acquire video.
[0024] The server 103 may be a server that provides various services, such as a background server that processes data displayed on the terminal device 101. The background server may analyze the received data and feed back the processing result (such as obfuscated data) to the terminal device.
[0025] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, multiple software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0026] It should be understood that Figure 1 The number of terminal devices, networks and servers in the above is only illustrative. According to the implementation requirements, there may be any number of terminal devices, networks and servers. In particular, when the target data does not need to be acquired remotely, the above system architecture may not include a network, but only include terminal devices or servers.
[0027] like Figure 2 , which is a flow chart of a data obfuscation method based on a pseudo-random algorithm according to an embodiment of the present application. Figure 2 It can be seen from the figure that the data obfuscation method based on the pseudo-random algorithm of this embodiment includes the following steps: S210, obtaining original data to be obfuscated.
[0028] In this embodiment, the execution subject (eg Figure 1 The server shown in the figure) can obtain the original data to be obfuscated through a wired or wireless connection.
[0029] Furthermore, the execution subject may obtain an electronic device (such as Figure 1 The original data to be obfuscated may be sent by the terminal device as shown in the figure, or may be the original data to be obfuscated pre-stored locally.
[0030] S220, converting and segmenting the original data to obtain initial data.
[0031] In some embodiments, the original data data is converted, the character strings are grouped, converted into ASCII one by one, and then concatenated into binary, and finally the converted initial value Num, that is, the initial data, is obtained.
[0032] S230, taking the constructed random algorithm factor and the initial data as input, obfuscating them through a self-developed algorithm to obtain obfuscated target data.
[0033] In some embodiments, the random algorithm factor includes a random base (base parameter) , index parameters , offset parameters ; Specifically, the cardinality parameter , can be calculated as follows: ; Among them, g(x) is an auxiliary function used to calculate the cumulative count of the cardinality, that is: g(x)=f(1)+f(2)+…+f(x); Where f(x) is an exponential function. If X is a prime number, f(x) takes the value of 1; otherwise, it takes the value of 0. n is the algorithm length generated according to the algorithm complexity; the algorithm complexity is mainly used to determine the number of iterations of each parameter, usually 256, 512, 1024, that is, the value of n; Indicates that the internal value is rounded down; Index parameters , calculated by multiple recursions using the following formula: ; Where n is the algorithm length; i is the current recursion number; e is a natural constant; As can be seen from the above formula, in the present disclosure, an exponential function, a derivative, a binomial coefficient, and a factorial can be combined to generate a complex exponential. It can be calculated by summing the contributions of different K values.
[0034] The offset can be generated by using the sine and cosine functions, by randomly generating angles and amplitudes, and combining them with the offset formula. That is, the offset parameters , can be calculated as follows: ; Where Cn is the generated offset parameter; α is the offset amplitude; φ is the offset angle; n is the algorithm length; β is the initial value of attenuation; Xn-1 is the value of the n-1th item.
[0035] It can be seen from the above formula that in the present disclosure, a complex offset sequence is generated by combining periodic changes (sine waves), exponential decay and random noise. They are all obtained by superimposing the above three parts.
[0036] In some embodiments, the pseudo-random algorithm is mainly used to confuse data to effectively avoid data leakage and tampering during the data transmission process. To increase the difficulty of data identification, different coefficients, moduli and conversion methods may be used in each iteration.
[0037] Specifically, the calculated random algorithm factor and initial data are used as input, and obfuscation is performed using the following formula to obtain the obfuscated target data: ; in, is the index parameter; is the cardinality parameter; is the offset parameter; n is the algorithm length; Num is the initial data; M is a prime number as agreed; is a sequence of agreed prime numbers; M and Ai are agreed to be prime numbers. When introducing the above algorithm, the client and the server can agree on them and then build them into the algorithm to distinguish different introducing parties and further improve security.
[0038] Furthermore, transmission may be performed based on the obfuscated data.
[0039] Furthermore, it also includes: The algorithm factor initial value B1, offset amplitude α, offset angle φ, and timestamp t can be concatenated with a colon (:) to form an obfuscated signature sign, and any of them can be transmitted as parameters in sequence.
[0040] Furthermore, it also includes: The client (server) receiving the obfuscated data can restore the obfuscated data in the following manner, that is, verify the integrity and timeliness of the transmitted data and the process of extracting the real data: First, perform data integrity check to determine whether the obfuscation factor and obfuscated data conform to the specified format; If the requirements are met, a timeliness check can be performed to extract the timestamp information in the confusion factor to determine whether the timestamp is within the agreed time. If the timestamp is exceeded, the task data will become invalid. If it is effective, the hash collision algorithm can be used to identify data replay. That is, a hash ring can be built in, the data can be hashed, and the data can be placed in the ring. When a data collision occurs, the data is considered to be duplicated, thus avoiding data replay attacks; After the identification is completed, the confusion factor chain and the link symbol are extracted, and the initial value of the operator is parsed according to the connector. The real data is identified through the decryption algorithm. The decryption algorithm is as follows: ; Among them, D is the original data.
[0041] According to the embodiments of the present disclosure, the following technical effects are achieved: When transmitting data between the client and the server, the use of pseudo-random algorithm obfuscation technology can effectively increase the complexity of the data, reduce the risk of data being maliciously intercepted or tampered with, and effectively prevent hotlinking. It greatly improves the privacy, effectiveness and reliability of the data.
[0042] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0043] The above is an introduction to the method embodiment. The following is a further explanation of the scheme described in this application through an apparatus embodiment.
[0044] Figure 3 FIG. 4 shows a block diagram of a data obfuscation device based on a pseudo-random algorithm according to an embodiment of the present application, as shown in FIG. Figure 3 Shown include: An acquisition module 310, used to acquire original data to be obfuscated; The processing module 320 is used to convert and segment the original data to obtain initial data; The obfuscation module 330 is used to use the constructed random algorithm factor and the initial data as inputs, and perform obfuscation according to the following formula to obtain obfuscated target data; the random algorithm factor includes a base parameter, an exponent parameter, and an offset parameter; ; in, is the index parameter; is the cardinality parameter; is the offset parameter; n is the algorithm length; Num is the initial data; M is a prime number; is a prime number sequence.
[0045] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0046] Figure 4 A schematic diagram of the structure of a terminal device or a server suitable for implementing an embodiment of the present application is shown.
[0047] like Figure 4 As shown, the terminal device or server includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 408 to the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the terminal device or server are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0048] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
[0049] In particular, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, the above-mentioned functions defined in the system of the present application are executed.
[0050] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0051] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the aforementioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0052] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0053] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application.
[0054] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.
Claims
1. A data obfuscation method based on a pseudo-random algorithm, characterized in that: include: Obtain the original data to be obfuscated; Converting and segmenting the original data to obtain initial data; The constructed random algorithm factor and the initial data are used as input, and obfuscation is performed using the following formula to obtain obfuscated target data; the random algorithm factor includes a base parameter, an exponent parameter, and an offset parameter; ; in, is the index parameter; is the cardinality parameter; is the offset parameter; n is the algorithm length; Num is the initial data; M is a prime number; is a prime number sequence.
2. The method according to claim 1, characterized in that Also includes: The cardinality parameter can be calculated as follows: ; Among them, g(x) is an auxiliary function.
3. The method according to claim 2, characterized in that Also includes: The exponential parameter is calculated by performing multiple recursions using the following formula: ; Where n is the algorithm length; i is the current recursion number; e is a natural constant.
4. The method according to claim 3, characterized in that Also includes: The offset parameter can be calculated as follows: ; Where Cn is the generated offset parameter; α is the offset amplitude; φ is the offset angle; n is the length of the algorithm; β is the initial value of attenuation; Xn-1 is the value of the n-1th item.
5. The method according to claim 1, characterized in that Also includes: The obfuscated data can be restored in the following ways: ; Among them, D is the original data.
6. A data obfuscation device based on a pseudo-random algorithm, characterized in that: include: An acquisition module, used to obtain the original data to be obfuscated; A processing module, used for converting and segmenting the original data to obtain initial data; An obfuscation module is used to use the constructed random algorithm factor and the initial data as input, and perform obfuscation according to the following formula to obtain obfuscated target data; the random algorithm factor includes a base parameter, an exponent parameter, and an offset parameter; ; in, is the index parameter; is the cardinality parameter; is the offset parameter; n is the length of the algorithm; Num is the initial data; M is a prime number; is a prime number sequence.
7. The device according to claim 6, characterized in that Also includes: The cardinality parameter can be calculated as follows: ; Among them, g(x) is an auxiliary function.
8. The device according to claim 7, characterized in that Also includes: The exponential parameter is calculated by performing multiple recursions using the following formula: ; Where n is the algorithm length; i is the current recursion number; e is a natural constant.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Data processing method
CN113343283A
File transmission method and device, equipment and storage medium
CN115277684A
Data processing method and device, equipment, storage medium and program product
CN116663043A
Data processing method and device, electronic equipment and storage medium
CN117156061A
Encryption method and device, decryption method and device, electronic equipment and computer readable medium
CN117294430A