Contract data protection method and device based on SM4 algorithm
The contract data is fragmented and encrypted through the SM4 algorithm to generate contract protection data, which solves the problem of a single and simple contract document encryption process in the existing technology, improves the security of the document, and prevents rapid cracking.
Patent Information
- Application Number
- CN202410867730.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The contract document encryption and processing process in the existing technology is too single and simple, and can only prevent the content from being obtained when it is obtained. However, once the private key is obtained, the document can be quickly cracked, reducing security.
Using the SM4 algorithm, the original contract data and SM4 preset operators are collected, scattered and encrypted to generate the first and second data sets, and then encrypted calculations and interpolation fitting are performed to generate contract protection data and enhance documents. security.
It effectively enhances the security of contract documents, prevents rapid cracking, ensures that the content of the document cannot be easily obtained when obtained, and improves overall security.
Smart Images

Figure CN118709233A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of contract data encryption, and in particular to a contract data protection method and device based on an SM4 algorithm. Background Art
[0002] With the continuous development of intelligent technology, people are using more and more intelligent devices in their lives, work and study. The use of intelligent technology has improved the quality of people's lives and increased the efficiency of their study and work.
[0003] At present, in order to protect contract data, users usually manually process and save the content or image information of the contract, or use encryption algorithms to directly encrypt the electronic document of the entire contract file to obtain an encrypted document. However, the contract document encryption process in the prior art is too single and simple. Through the overall encryption calculation of the entire document, it can only ensure that the content of the document cannot be obtained immediately when it is obtained. Once the private key is obtained, the contract document can be quickly cracked, which reduces the security of the contract document.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiment of the present invention provides a contract data protection method and device based on the SM4 algorithm, so as to at least solve the technical problem that the contract document encryption disposal process in the prior art is too single and simple. By performing overall encryption calculation on the entire document, it can only ensure that the content therein cannot be obtained immediately when the document is obtained. Once the private key is obtained, the contract document can be quickly cracked, which reduces the security of the contract document.
[0006] According to one aspect of an embodiment of the present invention, a contract data protection method based on the SM4 algorithm is provided, including: collecting original contract data and an SM4 preset operator; breaking up the original contract data to obtain a first data set and a second data set; encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain first encrypted data and second encrypted data; and performing mixed interpolation fitting processing on the first encrypted data and the second encrypted data to obtain contract protection data.
[0007] Optionally, the SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α=[Level(sm4)*(aes)]
[0008] Among them, α represents the SM4 preset operator, Level(sm4) represents the SM4 algorithm encryption level based on the application scenario, and aes represents the SM4 encryption parameter.
[0009] Optionally, the process of breaking up the original contract data to obtain the first data set and the second data set includes: extracting text data and key information data from the original contract data; splitting the text data into N segments according to the key information data, where N is a positive integer; randomly breaking up the split text data, and converging and merging them with N / 2 as the data set unit to generate the first data set and the second data set.
[0010] Optionally, encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain the first encrypted data and the second encrypted data includes: according to the formula
[0011] [M1, M2] = [α*(D1), α*(D2)]
[0012] The first data set and the second data set are encrypted and calculated to obtain the first encrypted data and the second encrypted data, wherein M1 and M2 represent the first data set and the second data set respectively, D1 and D2 represent the first encrypted data and the second encrypted data respectively, and * represents an encryption operator.
[0013] According to another aspect of an embodiment of the present invention, a contract data protection device based on the SM4 algorithm is also provided, including: an acquisition module, used to acquire original contract data and an SM4 preset operator; a scattering module, used to scatter the original contract data to obtain a first data set and a second data set; an encryption module, used to encrypt the data in the first data set and the second data set according to the SM4 preset operator to obtain first encrypted data and second encrypted data; and a mixing module, used to mix and fit the first encrypted data and the second encrypted data to obtain contract protection data.
[0014] Optionally, the SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α=[Level(sm4)*(aes)]
[0015] Among them, α represents the SM4 preset operator, Level(sm4) represents the SM4 algorithm encryption level based on the application scenario, and aes represents the SM4 encryption parameter.
[0016] Optionally, the scattering module includes: an extraction unit, used to extract the text data and key information data of the original contract data; a splitting unit, used to split the text data into N segments according to the key information data, where N is a positive integer; a scattering unit, used to randomly scatter the split text data, and converge and merge them with N / 2 as a data set unit to generate the first data set and the second data set.
[0017] Optionally, the encryption module includes: an encryption unit for
[0018] [M1, M2] = [α*(D1), α*(D2)]
[0019] The first data set and the second data set are encrypted and calculated to obtain the first encrypted data and the second encrypted data, wherein M1 and M2 represent the first data set and the second data set respectively, D1 and D2 represent the first encrypted data and the second encrypted data respectively, and * represents an encryption operator.
[0020] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is also provided, wherein the non-volatile storage medium includes a stored program, wherein when the program is run, the device where the non-volatile storage medium is located is controlled to execute a contract data protection method based on the SM4 algorithm.
[0021] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising a processor and a memory; the memory stores computer-readable instructions, and the processor is used to run the computer-readable instructions, wherein the computer-readable instructions execute a contract data protection method based on the SM4 algorithm when running.
[0022] In an embodiment of the present invention, the original contract data and the SM4 preset operator are collected; the original contract data is scattered to obtain a first data set and a second data set; the data in the first data set and the second data set are encrypted according to the SM4 preset operator to obtain first encrypted data and second encrypted data; the first encrypted data and the second encrypted data are mixed and fitted to obtain contract protection data. This solves the problem that the contract document encryption process in the prior art is too single and simple. By performing overall encryption calculation on the entire document, it can only be guaranteed that the content therein cannot be obtained at the first time when the document is obtained. Once the private key is obtained, the contract document can be quickly cracked, which reduces the technical problem of the security of the contract document. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0024] Figure 1 is a flow chart of a contract data protection method based on the SM4 algorithm according to an embodiment of the present invention;
[0025] Figure 2 is a structural block diagram of a contract data protection device based on the SM4 algorithm according to an embodiment of the present invention;
[0026] Figure 3 is a block diagram of a terminal device for executing a method according to an embodiment of the present invention;
[0027] Figure 4 It is a storage unit for holding or carrying a program code for implementing a method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] According to an embodiment of the present invention, a method embodiment of a contract data protection method based on the SM4 algorithm is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] Embodiment 1
[0032] Figure 1 is a flow chart of a contract data protection method based on the SM4 algorithm according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0033] Step S102, collecting original contract data and SM4 preset operators.
[0034] Step S104, breaking up the original contract data to obtain a first data set and a second data set.
[0035] Step S106, encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain first encrypted data and second encrypted data.
[0036] Step S108: performing a mixed insertion and fitting process on the first encrypted data and the second encrypted data to obtain contract protection data.
[0037] Optionally, the SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α=[Level(sm4)*(aes)]
[0038] Among them, α represents the SM4 preset operator, Level(sm4) represents the SM4 algorithm encryption level based on the application scenario, and aes represents the SM4 encryption parameter.
[0039] Optionally, the process of breaking up the original contract data to obtain the first data set and the second data set includes: extracting text data and key information data from the original contract data; splitting the text data into N segments according to the key information data, where N is a positive integer; randomly breaking up the split text data, and converging and merging them with N / 2 as the data set unit to generate the first data set and the second data set.
[0040] Optionally, encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain the first encrypted data and the second encrypted data includes: according to the formula
[0041] [M1, M2] = [α*(D1), α*(D2)]
[0042] The first data set and the second data set are encrypted and calculated to obtain the first encrypted data and the second encrypted data, wherein M1 and M2 represent the first data set and the second data set respectively, D1 and D2 represent the first encrypted data and the second encrypted data respectively, and * represents an encryption operator.
[0043] Through the above-mentioned embodiments, the problem that the encryption processing process of contract documents in the prior art is too single and simple is solved. By performing overall encryption calculation on the entire document, it can only be ensured that the content therein cannot be obtained immediately when the document is obtained. Once the private key is obtained, the contract document can be quickly cracked, which reduces the technical problem of the security of the contract document.
[0044] Embodiment 2
[0045] Figure 2 is a structural block diagram of a contract data protection device based on the SM4 algorithm according to an embodiment of the present invention, such as Figure 2 As shown, the device comprises:
[0046] The collection module 20 is used to collect original contract data and SM4 preset operators.
[0047] The breaking up module 22 is used to break up the original contract data to obtain a first data set and a second data set.
[0048] The encryption module 24 is used to encrypt the data in the first data set and the second data set according to the SM4 preset operator to obtain first encrypted data and second encrypted data.
[0049] The intermixing module 26 is used to perform intermixing fitting processing on the first encrypted data and the second encrypted data to obtain contract protection data.
[0050] Optionally, the SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α=[Level(sm4)*(aes)]
[0051] Among them, α represents the SM4 preset operator, Level(sm4) represents the SM4 algorithm encryption level based on the application scenario, and aes represents the SM4 encryption parameter.
[0052] Optionally, the SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α=[Level(sm4)*(aes)]
[0053] Among them, α represents the SM4 preset operator, Level(sm4) represents the SM4 algorithm encryption level based on the application scenario, and aes represents the SM4 encryption parameter.
[0054] Optionally, the scattering module includes: an extraction unit, used to extract the text data and key information data of the original contract data; a splitting unit, used to split the text data into N segments according to the key information data, where N is a positive integer; a scattering unit, used to randomly scatter the split text data, and converge and merge them with N / 2 as a data set unit to generate the first data set and the second data set.
[0055] Optionally, the encryption module includes: an encryption unit for
[0056] [M1, M2] = [α*(D1), α*(D2)]
[0057] The first data set and the second data set are encrypted and calculated to obtain the first encrypted data and the second encrypted data, wherein M1 and M2 represent the first data set and the second data set respectively, D1 and D2 represent the first encrypted data and the second encrypted data respectively, and * represents an encryption operator.
[0058] Through the above-mentioned embodiments, the problem that the encryption processing process of contract documents in the prior art is too single and simple is solved. By performing overall encryption calculation on the entire document, it can only be ensured that the content therein cannot be obtained immediately when the document is obtained. Once the private key is obtained, the contract document can be quickly cracked, which reduces the technical problem of the security of the contract document.
[0059] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is also provided, wherein the non-volatile storage medium includes a stored program, wherein when the program is run, the device where the non-volatile storage medium is located is controlled to execute a contract data protection method based on the SM4 algorithm.
[0060] Specifically, the above method includes: collecting original contract data and SM4 preset operators; breaking up the original contract data to obtain a first data set and a second data set; encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain first encrypted data and second encrypted data; performing mixed insertion and fitting processing on the first encrypted data and the second encrypted data to obtain contract protection data. Optionally, the SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α = [Level (sm4) * (aes)] wherein α represents the SM4 preset operator, Level (sm4) represents the encryption level of the SM4 algorithm based on the application scenario, and aes represents the SM4 encryption parameter. Optionally, the scattering of the original contract data to obtain the first data set and the second data set includes: extracting the text data and key information data of the original contract data; splitting the text data into N segments according to the key information data, wherein N is a positive integer; randomly scattering the split text data, and performing convergence merging with N / 2 as the data set unit to generate the first data set and the second data set. Optionally, the encryption of the data in the first data set and the second data set according to the SM4 preset operator to obtain the first encrypted data and the second encrypted data includes: performing encryption calculation on the first data set and the second data set according to the formula [M1, M2] = [α*(D1), α*(D2)] to obtain the first encrypted data and the second encrypted data, wherein M1 and M2 represent the first data set and the second data set respectively, D1 and D2 represent the first encrypted data and the second encrypted data respectively, and * represents the encryption calculation operator.
[0061] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising a processor and a memory; the memory stores computer-readable instructions, and the processor is used to run the computer-readable instructions, wherein the computer-readable instructions execute a contract data protection method based on the SM4 algorithm when running.
[0062] Specifically, the above method includes: collecting original contract data and SM4 preset operators; breaking up the original contract data to obtain a first data set and a second data set; encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain first encrypted data and second encrypted data; performing mixed insertion and fitting processing on the first encrypted data and the second encrypted data to obtain contract protection data. Optionally, the SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α = [Level (sm4) * (aes)] wherein α represents the SM4 preset operator, Level (sm4) represents the encryption level of the SM4 algorithm based on the application scenario, and aes represents the SM4 encryption parameter. Optionally, the scattering of the original contract data to obtain the first data set and the second data set includes: extracting the text data and key information data of the original contract data; splitting the text data into N segments according to the key information data, wherein N is a positive integer; randomly scattering the split text data, and performing convergence merging with N / 2 as the data set unit to generate the first data set and the second data set. Optionally, the encryption of the data in the first data set and the second data set according to the SM4 preset operator to obtain the first encrypted data and the second encrypted data includes: performing encryption calculation on the first data set and the second data set according to the formula [M1, M2] = [α*(D1), α*(D2)] to obtain the first encrypted data and the second encrypted data, wherein M1 and M2 represent the first data set and the second data set respectively, D1 and D2 represent the first encrypted data and the second encrypted data respectively, and * represents the encryption calculation operator.
[0063] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0064] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0065] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0066] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0067] in addition, Figure 3 This is a schematic diagram of the hardware structure of a terminal device provided in one embodiment of the present application. Figure 3 As shown, the terminal device may include an input device 30, a processor 31, an output device 32, a memory 33 and at least one communication bus 34. The communication bus 34 is used to realize the communication connection between the components. The memory 33 may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory. Various programs can be stored in the memory 33 to complete various processing functions and implement the method steps of this embodiment.
[0068] Optionally, the processor 31 may be implemented as a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components, and the processor 31 is coupled to the input device 30 and the output device 32 via a wired or wireless connection.
[0069] Optionally, the input device 30 may include multiple input devices, for example, it may include at least one of a user interface for users, a device interface for devices, a programmable interface for software, a camera, and a sensor. Optionally, the device interface for devices may be a wired interface for data transmission between devices, or a hardware insertion interface for data transmission between devices (such as a USB interface, a serial port, etc.); Optionally, the user interface for users may be, for example, a control button for users, a voice input device for receiving voice input, and a touch sensing device for users to receive user touch input (such as a touch screen with a touch sensing function, a touch pad, etc.); Optionally, the programmable interface for the software may be, for example, an entry for users to edit or modify programs, such as an input pin interface or an input interface of a chip; Optionally, the transceiver may be a radio frequency transceiver chip with communication function, a baseband processing chip, and a transceiver antenna, etc. Audio input devices such as microphones may receive voice data. The output device 32 may include output devices such as displays and speakers.
[0070] In this embodiment, the processor of the terminal device includes functions for executing each module of the data processing device in each device. The specific functions and technical effects can be referred to the above embodiments and will not be repeated here.
[0071] Figure 4 A schematic diagram of the hardware structure of a terminal device provided in another embodiment of the present application. Figure 4 Yes Figure 3 A specific embodiment in the implementation process. Figure 4 As shown, the terminal device of this embodiment includes a processor 41 and a memory 42.
[0072] The processor 41 executes the computer program code stored in the memory 42 to implement the method in the above embodiment.
[0073] The memory 42 is configured to store various types of data to support operations on the terminal device. Examples of such data include instructions for any application or method used to operate on the terminal device, such as messages, pictures, videos, etc. The memory 42 may include a random access memory (RAM) and may also include a non-volatile memory, such as at least one disk storage.
[0074] Optionally, the processor 41 is provided in the processing component 40. The terminal device may further include: a communication component 43, a power component 44, a multimedia component 45, an audio component 46, an input / output interface 47 and / or a sensor component 48. The specific components included in the terminal device are set according to actual needs, and this embodiment does not limit this.
[0075] The processing component 40 generally controls the overall operation of the terminal device. The processing component 40 may include one or more processors 41 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 40 may include one or more modules to facilitate the interaction between the processing component 40 and other components. For example, the processing component 40 may include a multimedia module to facilitate the interaction between the multimedia component 45 and the processing component 40.
[0076] The power supply component 44 provides power to various components of the terminal device. The power supply component 44 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the terminal device.
[0077] The multimedia component 45 includes a display screen that provides an output interface between the terminal device and the user. In some embodiments, the display screen may include a liquid crystal display (LCD) and a touch panel (TP). If the display screen includes a touch panel, the display screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0078] The audio component 46 is configured to output and / or input audio signals. For example, the audio component 46 includes a microphone (MIC), and when the terminal device is in an operating mode, such as a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 42 or sent via the communication component 43. In some embodiments, the audio component 46 also includes a speaker for outputting audio signals.
[0079] The input / output interface 47 provides an interface between the processing component 40 and the peripheral interface modules, which may be click wheels, buttons, etc. These buttons may include but are not limited to: volume buttons, start buttons, and lock buttons.
[0080] The sensor assembly 48 includes one or more sensors for providing various aspects of status assessment for the terminal device. For example, the sensor assembly 48 can detect the open / closed state of the terminal device, the relative positioning of the components, and the presence or absence of contact between the user and the terminal device. The sensor assembly 48 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact, including detecting the distance between the user and the terminal device. In some embodiments, the sensor assembly 48 may also include a camera, etc.
[0081] The communication component 43 is configured to facilitate wired or wireless communication between the terminal device and other devices. The terminal device can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In one embodiment, the terminal device may include a SIM card slot for inserting a SIM card, so that the terminal device can log in to the GPRS network and establish communication with the service end through the Internet.
[0082] From the above, we can see that Figure 4 The communication component 43, the audio component 46, the input / output interface 47, and the sensor component 48 involved in the embodiment can all be used as Figure 3 Implementation method of the input device in the embodiment.
[0083] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0084] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0085] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0086] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0087] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A contract data protection method based on SM4 algorithm, characterized in that: include: Collect original contract data and SM4 preset operators; Scattering the original contract data to obtain a first data set and a second data set; Encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain first encrypted data and second encrypted data; The first encrypted data and the second encrypted data are mixed and fitted to obtain contract protection data.
2. The method according to claim 1, characterized in that The SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α=[Level(sm4)*(aes)] Among them, α represents the SM4 preset operator, Level(sm4) represents the SM4 algorithm encryption level based on the application scenario, and aes represents the SM4 encryption parameter.
3. The method according to claim 1, characterized in that The breaking up the original contract data to obtain the first data set and the second data set comprises: Extracting text data and key information data of the original contract data; Splitting the text data into N segments according to the key information data, where N is a positive integer; The split text data is randomly scattered, and converged and merged with N / 2 as a data set unit to generate the first data set and the second data set.
4. The method according to claim 2, characterized in that: The step of encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain the first encrypted data and the second encrypted data includes: According to the formula [M1, M2] = [α*(D1), α*(D2)] The first data set and the second data set are encrypted and calculated to obtain the first encrypted data and the second encrypted data, wherein M1 and M2 represent the first data set and the second data set respectively, D1 and D2 represent the first encrypted data and the second encrypted data respectively, and * represents an encryption operator.
5. A contract data protection device based on SM4 algorithm, characterized in that: include: The collection module is used to collect original contract data and SM4 preset operators; A breaking up module, used for breaking up the original contract data to obtain a first data set and a second data set; An encryption module, used for encrypting the data in the first data set and the second data set according to the SM4 preset operator to obtain first encrypted data and second encrypted data; The intermixing module is used to perform intermixing fitting processing on the first encrypted data and the second encrypted data to obtain contract protection data.
6. The device according to claim 5, characterized in that The SM4 preset operator is calculated by collecting the encryption level and encryption parameters of the SM4 algorithm, wherein the formula for calculating the SM4 preset operator is: α=[Level(sm4)*(aes)] Among them, α represents the SM4 preset operator, Level(sm4) represents the SM4 algorithm encryption level based on the application scenario, and aes represents the SM4 encryption parameter.
7. The device according to claim 5, characterized in that The breaking up module comprises: An extraction unit, used to extract text data and key information data of the original contract data; A splitting unit, used to split the text data into N segments according to the key information data, where N is a positive integer; The scattering unit is used to randomly scatter the split text data, and converge and merge them in units of N / 2 data sets to generate the first data set and the second data set.
8. The device according to claim 6, characterized in that The encryption module comprises: Encryption unit for [M1, M2] = [α*(D1), α*(D2)] The first data set and the second data set are encrypted and calculated to obtain the first encrypted data and the second encrypted data, wherein M1 and M2 represent the first data set and the second data set respectively, D1 and D2 represent the first encrypted data and the second encrypted data respectively, and * represents an encryption operator.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein the program controls the device where the non-volatile storage medium is located to execute the method according to any one of claims 1 to 4 when the program is executed.
10. An electronic device, characterized in that: It comprises a processor and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the computer-readable instructions execute the method described in any one of claims 1 to 4 when executed.
Citation Information
Patent Citations
Camera image encryption method and device
CN116320202A
Image data storage method and device based on SM encryption algorithm
CN116418566A
Data encryption method, device and equipment
CN116455572A
Text security transmission system and text security encryption and decryption method
CN117978519A
Data transmission method and apparatus, terminal device and medium
WO2020164211A1
Cited By
Encryption method and system for realizing SATA-PCIe mixed insertion data based on double-fish algorithm
CN119788441A
An Encryption Method and System for SATA-PCIe Mixed Insertion Data Based on the Pisces Algorithm
CN119788441B
