CN112733205A - Data tampering rapid identification method, device, equipment and medium - Google Patents
Data tampering rapid identification method, device, equipment and medium Download PDFInfo
- Publication number
- CN112733205A CN112733205A CN202110073778.5A CN202110073778A CN112733205A CN 112733205 A CN112733205 A CN 112733205A CN 202110073778 A CN202110073778 A CN 202110073778A CN 112733205 A CN112733205 A CN 112733205A
- Authority
- CN
- China
- Prior art keywords
- data
- verification
- content
- stored
- key
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000012795 verification Methods 0.000 claims abstract description 101
- 238000012544 monitoring process Methods 0.000 claims abstract description 26
- 238000003860 storage Methods 0.000 claims abstract description 24
- 238000012545 processing Methods 0.000 claims abstract description 22
- 239000003245 coal Substances 0.000 claims abstract description 15
- 230000007246 mechanism Effects 0.000 claims abstract description 12
- 238000006243 chemical reaction Methods 0.000 claims description 36
- 238000004590 computer program Methods 0.000 claims description 6
- 230000004048 modification Effects 0.000 claims description 4
- 238000012986 modification Methods 0.000 claims description 4
- 238000013524 data verification Methods 0.000 claims description 2
- VNWKTOKETHGBQD-UHFFFAOYSA-N methane Chemical compound C VNWKTOKETHGBQD-UHFFFAOYSA-N 0.000 description 6
- 238000010586 diagram Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- CURLTUGMZLYLDI-UHFFFAOYSA-N Carbon dioxide Chemical compound O=C=O CURLTUGMZLYLDI-UHFFFAOYSA-N 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- UGFAIRIUMAVXCW-UHFFFAOYSA-N Carbon monoxide Chemical compound [O+]#[C-] UGFAIRIUMAVXCW-UHFFFAOYSA-N 0.000 description 1
- RWSOTUBLDIXVET-UHFFFAOYSA-N Dihydrogen sulfide Chemical compound S RWSOTUBLDIXVET-UHFFFAOYSA-N 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- QVGXLLKOCUKJST-UHFFFAOYSA-N atomic oxygen Chemical compound [O] QVGXLLKOCUKJST-UHFFFAOYSA-N 0.000 description 1
- 229910002092 carbon dioxide Inorganic materials 0.000 description 1
- 239000001569 carbon dioxide Substances 0.000 description 1
- 229910002091 carbon monoxide Inorganic materials 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 239000000428 dust Substances 0.000 description 1
- 229910000037 hydrogen sulfide Inorganic materials 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 229910052760 oxygen Inorganic materials 0.000 description 1
- 239000001301 oxygen Substances 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
The invention discloses a rapid identification method for data tampering, which can be applied to a coal mine safety monitoring system. Firstly, converting data content to be stored into a first verification field, simultaneously storing the data content to be stored and the first verification field into a database, starting an automatic verification mechanism when the content of the database is monitored to be modified, identifying illegal tampering if the modified content cannot pass verification, and performing data rollback processing. The invention can prevent the content of the database from being illegally tampered, and simultaneously, the storage and query efficiency of the original data of the coal mine safety monitoring system can not be influenced.
Description
Technical Field
The invention relates to the field of data processing, in particular to a data tampering identification method.
Background
The coal mine safety monitoring system is a system which is mainly used for monitoring methane concentration, carbon monoxide concentration, carbon dioxide concentration, oxygen concentration, hydrogen sulfide concentration, mine dust concentration, wind speed, wind pressure, humidity, temperature, feed state, air door state, air duct state, local ventilator on-off, main fan on-off and the like, and realizing functions of methane over-limit acousto-optic alarm, power failure, methane wind power locking control and the like.
In the daily application process of the coal mine safety monitoring system, historical data in a system database is an important basis for daily supervision of a superior law enforcement department and post-accident analysis of accidents, so that the safety and tamper resistance of the coal mine safety monitoring system database have important significance. At present, a common processing method for data security of an existing database in a coal mine security monitoring system mainly comprises the following steps: (1) the security of the database data is ensured by setting a complex database password and strictly keeping the database password secret. The disadvantage of this method is poor reliability and a great risk is faced once the database password is revealed. (2) And directly encrypting the original data, and storing the encrypted data. The method has the disadvantages that the original data needs to be encrypted before being stored and needs to be decrypted when being inquired, and the method has great influence on the efficiency of the storage and the inquiry of large data volume.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the technical problem to be solved by the present invention is to provide a method which is reliable and can quickly identify data tampering.
In a first aspect, the present invention provides the following technical solutions:
a data tampering rapid identification method is applied to a coal mine safety monitoring system and comprises the following steps:
s101: converting the data content to be stored into a first verification field;
s102: storing the data content to be stored and the first verification field into a database at the same time;
s103: when the content of the database is monitored to be modified, starting an automatic verification mechanism, if the modified content cannot pass verification, identifying the modified content as illegal tampering, and performing data rollback processing;
or inquiring and reading the data content stored in the database, converting the data content read by the Sovix search tree into a third verification field, comparing whether the first verification field is consistent with the third verification field, and identifying that the data content is tampered if the first verification field is inconsistent with the third verification field.
By adopting the method, the invention can prevent the contents of the database from being illegally tampered, does not influence the storage and query efficiency of the original data of the coal mine safety monitoring system, can quickly identify whether the queried contents are tampered or not, and can mark or remove the tampered data, thereby improving the authenticity of the data.
In an embodiment provided by the present invention, the step S101 includes:
s201: all fields of each data content to be stored are spliced to form a first character string;
s202: converting the first character string into a first byte array;
s203: creating a first key and a second key, encrypting even bytes in the first byte array by using the first key, and encrypting odd bytes in the first byte array by using the second key to obtain a second byte array;
s204: and converting the second byte array into a second character string, wherein the second character string is the first verification field.
By adopting the method, the originally stored data content can be reserved, the original data content is not encrypted, when a worker checks the original data content, decryption processing is not needed, the operation steps are simplified, and the time is saved.
In an embodiment of the present invention, the encryption processing in step S203 adopts an exclusive or operation encryption manner, and values of the first key and the second key are different.
By adopting different keys to carry out exclusive OR operation on the even bytes and the odd bytes in the first byte array respectively, on one hand, the speed of encryption processing can be improved, and on the other hand, the decryption rate of encryption can be reduced by adopting the odd and even numbers to carry out encryption respectively. The exclusive-or operation is adopted as an encryption method, so that the execution efficiency is very high, the reliability is good, and the occupancy rate of computer resources is small.
In an embodiment provided by the present invention, the automatic verification mechanism includes:
s301: creating a trigger in the database, and monitoring whether the data content is subjected to modification operation or not by using the trigger;
s302: scaling the modified content into a second authentication field;
s303: and comparing whether the second verification field is consistent with the first verification field, if not, determining that the operation is illegal tampering, and performing data rollback processing.
By adopting the method, the modified content can be automatically and quickly verified, and the program running efficiency is improved.
In a second aspect, the present invention further provides a device for quickly identifying data tampering, including:
the conversion unit is used for converting the data content to be stored into a first verification field;
the storage unit is connected with the conversion unit and is used for storing the data content to be stored and the first verification field into a database at the same time;
the verification identification unit is connected with the storage unit and used for data verification, when the content of the database is monitored to be modified, an automatic verification mechanism is started, if the modified content cannot pass verification, the modified content is identified as illegal tampering, and data rollback processing is carried out;
and the query identification unit is connected with the storage unit and is used for querying and reading the data content stored in the database, converting the read data content into a third verification field, comparing whether the first verification field is consistent with the third verification field or not, and identifying that the data content is tampered if the first verification field is inconsistent with the third verification field.
In an embodiment of the present invention, the verification identification unit includes a trigger, and the trigger is configured to monitor whether the data content is modified.
In an embodiment provided by the present invention, the conversion unit includes a splicing conversion unit and an encryption conversion unit, the encryption conversion unit is connected to the splicing conversion unit, the splicing conversion unit is configured to splice all fields of each to-be-stored data content to form a first character string, and convert the first character string into a first byte array, the encryption conversion unit is configured to create a first key and a second key, encrypt an even byte in the first byte array using the first key, encrypt an odd byte in the first byte array using the second key to obtain a second byte array, and convert the second byte array into a second character string, where the second character string is the first verification field.
In a third aspect, the present invention provides a computer device, including a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the method for quickly identifying data tampering as described above.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method for rapid identification of data tampering as described above.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for quickly identifying data tampering according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating scaling of a first verification field according to an embodiment of the present invention;
FIG. 3 is a flow chart of implementing an automatic verification mechanism according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data tampering rapid identification apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a scaling unit according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Reference numerals:
the rapid data tampering identification device 40, the conversion unit 41, the storage unit 42, the verification identification unit 43, the query identification unit 44, the splicing conversion unit 411, the encryption conversion unit 412 and the trigger 431;
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and the like are used in the orientations and positional relationships indicated in the drawings for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and are therefore not to be considered limiting of the invention. Furthermore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless otherwise specified.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Referring to fig. 1, the present invention provides a method for quickly identifying data tampering, which can be applied to a coal mine safety monitoring system. The invention comprises the following steps:
s101: and converting the data content to be stored into a first verification field.
It should be noted that, in this embodiment, the first verification field is used to verify whether the data content is tampered or is being tampered.
S102: and storing the data content to be stored and the first verification field into the database at the same time.
It should be noted that, in this embodiment, the data content and the corresponding verification fields are simultaneously stored in the database, for example, in a list, and the data content and the verification fields are in one-to-one correspondence, which is convenient for the staff to query and view.
S103: when the content of the database is monitored to be modified, starting an automatic verification mechanism, if the modified content cannot pass verification, identifying the modified content as illegal tampering, and performing data rollback processing;
or inquiring the data content stored in the read database, converting the read data content into a third verification field, comparing whether the first verification field is consistent with the third verification field, and if not, identifying that the data content is tampered.
It should be noted that in this embodiment, the data rollback means that the trigger may invoke a rollback operation after monitoring that the data content is illegally tampered, that is, the modified content is restored to the original data content before being modified, or when it is not monitored that the modified event causes the data content to be tampered, whether the queried data content is tampered or not may be quickly identified. If the queried data content is identified to be tampered, the data can be highlighted when the data is displayed, or the tampered data content is directly removed, that is, the tampered data is not displayed, and only the normal data is displayed.
The invention can prevent the content of the database from being illegally tampered by the steps, and meanwhile, the storage and query efficiency of the original data of the coal mine safety monitoring system can not be influenced. For example, taking 2 ten thousand data in the database as an example, the steps of conversion, storage and verification of the method can be completed within 2 seconds.
Referring to fig. 2, in the present embodiment, the step S101 of converting the content of the data content to be stored into the first verification field includes the following steps:
s201: splicing all fields of each data content to be stored to form a first character string;
s202: converting the first character string into a first byte array;
s203: creating a first key and a second key, encrypting even bytes in the first byte array by using the first key, and encrypting odd bytes in the first byte array by using the second key to obtain a second byte array;
s204: and converting the second byte array into a second character string, wherein the second character string is the first verification field.
In an embodiment, in the database of the coal mine safety monitoring system, the data content includes time, a monitoring value, and the like, for example, the stored time is 20211-1-1100:00:00, i.e., the stored monitoring value is 1.9, i.e., the stored monitoring value is the second field, and the first field and the second field are spliced to form the first character string of 20211-1-1100:00:001.9, although the stored content is not limited thereto, and may be other content, and the operation is performed according to the actual requirement of the database. In an embodiment, the step S202 converts the first character string into the first byte array by using an encoding method of "encoding. In one embodiment, the values of the first key and the second key are different, and the specific values of the first key and the second key can be transformed, but the keys need to be consistent when different storage contents are encrypted in the same database. For example, the first key is 28 for encrypting even bytes in the first byte array, and the second key is 15 for encrypting odd bytes in the first byte array. In an embodiment, the encryption process may specifically be encryption by using an exclusive-or operation, where the exclusive-or operation is performed by: if the two values of a and b are not the same, the XOR result is 1, and if the two values of a and b are the same, the XOR result is 0. For example, the first byte value in the first byte array is 3, the first byte value is converted into binary 00000011, the encryption key of the odd byte is 15, the first byte value is converted into binary 00001111, bitwise exclusive or operation is performed on the binary of the odd byte and the binary of the encryption key to obtain binary 00001100 after the first byte value is encrypted, and the result of conversion into decimal is 12, so that the second byte array is obtained. In an embodiment, the manner of converting the second byte array into the second string in step S204 is the same as that in step S202, for example, the conversion may also be performed by using an encoding manner of "encoding. According to the method, all fields of the data content are spliced to form the first character string, the first character string is encrypted to obtain the second character string, and the second character string is converted into the first verification field, so that the originally stored data content can be reserved, the original data content cannot be encrypted, when a worker checks the original data content, decryption processing is not needed, the operation steps are simplified, and time is saved. The method carries out XOR operation on the even bytes and the odd bytes in the first byte array respectively through different keys, on one hand, the speed of encryption processing can be improved, and on the other hand, the decryption rate of encryption can be reduced by adopting the odd and even numbers to carry out encryption respectively. The method adopts exclusive-or operation as an encryption method, not only has very high execution efficiency and good reliability, but also has small occupancy rate to computer resources.
Referring to fig. 3, in the present embodiment, the automatic verification mechanism in step S103 includes the following steps:
s301: creating a trigger in a database, and monitoring whether the data content is modified or not by using the trigger;
s302: scaling the modified content into a second authentication field;
s303: and comparing whether the second verification field is consistent with the first verification field, if not, determining that the operation is illegal tampering, and performing data rollback processing.
It should be noted that in the present embodiment, the trigger is a special stored procedure related to the table event, and its execution is triggered by the event, rather than by a procedure call or a manual initiation. For example, a table may be activated for execution when it is updated, modified, etc. In this embodiment, when the contents of the database are modified, a trigger execution routine is activated, and the trigger may disable or rollback operations to undo the attempted data modification. The second verification field in step S302 may be obtained by scaling the steps of S201-S204 described above. And putting the second verification field into a list of the database, comparing the second verification field with the first verification field at the corresponding position of the second verification field, if the second verification field is inconsistent with the first verification field, determining that the second verification field is illegal to be tampered, and restoring the modified content into the original content before being modified. The invention adopts an automatic verification mechanism to realize automatic and rapid verification of the modified content and improve the program operation efficiency.
Corresponding to the foregoing embodiments, referring to fig. 4, the present invention further provides a data tampering rapid identification apparatus 40. The device comprises a conversion unit 41, a storage unit 42, a verification identification unit 43 and a query identification unit 44, wherein the storage unit 42 is connected with the conversion unit 41, the verification identification unit 43 is connected with the storage unit 42, and the query identification unit 44 is connected with the storage unit 42. The conversion unit 41 is configured to convert the data content to be stored into a first verification field, the storage unit 42 is configured to store the data content to be stored and the first verification field in the database at the same time, and the verification identification unit 43 is configured to verify the data, start an automatic verification mechanism when it is monitored that the content of the database is modified, and identify the modified content as illegal tampering to perform data rollback processing if the modified content cannot pass verification. The query recognition unit 44 is configured to query the data content stored in the read database, convert the read data content into a third verification field, and compare whether the first verification field is consistent with the third verification field, and if not, recognize that the data content is tampered.
For example, the verification identification unit 43 may include a trigger 431, and the trigger 431 may monitor whether the data content is modified, if the modified content is monitored, the verification identification unit 43 converts the modified content into a second verification field, and compares whether the second verification field is consistent with the first verification field, and if not, the verification identification unit considers that the modified content is illegal, and the trigger 431 performs data rollback processing.
Referring to fig. 5, in an embodiment, the scaling unit 41 includes a concatenation conversion unit 411 and an encryption conversion unit 412, and the encryption conversion unit 412 is connected to the concatenation conversion unit 411. The concatenation conversion unit 411 is configured to concatenate all fields of each to-be-stored data content to form a first character string, and convert the first character string into a first byte array. The encryption conversion unit 412 is configured to create a first key and a second key, encrypt even bytes in the first byte array with the first key, encrypt odd bytes in the first byte array with the second key, obtain a second byte array, and convert the second byte array into a second character string, where the second character string is the first verification field.
For example, in a database of the coal mine safety monitoring system, the data content includes time, a monitoring value and the like, for example, the stored time is 20211-1-1100:00:00, i.e., the stored time is a first field, the stored monitoring value is 1.9, i.e., the stored monitoring value is a second field, and the first field and the second field are spliced to form a first character string of 20211-1-1100:00:001.9, although the stored content is not limited thereto, and may be other content, and the operation is performed according to the actual requirement of the database. For example, the first string to the first byte array in the concatenation conversion unit 411 may be converted by an encoding method of "encoding.
For example, the specific values of the first key and the second key may be transformed, but the keys need to be consistent when different storage contents are encrypted in the same database. For example, the first key is 28 for encrypting even bytes in the first byte array, and the second key is 15 for encrypting odd bytes in the first byte array. For example, the encryption process may specifically be encryption by using an exclusive-or operation, where the exclusive-or operation is performed by: if the two values of a and b are not the same, the XOR result is 1, and if the two values of a and b are the same, the XOR result is 0. For example, the first byte value in the first byte array is 3, the first byte value is converted into binary 00000011, the encryption key of the odd byte is 15, the first byte value is converted into binary 00001111, bitwise exclusive or operation is performed on the binary of the odd byte and the binary of the encryption key to obtain binary 00001100 after the first byte value is encrypted, and the result of conversion into decimal is 12, so that the second byte array is obtained. For example, the encryption conversion unit 412 converts the second byte array into the second character string in the same manner as that used in the concatenation conversion unit 411, and for example, the encoding method of "encoding. According to the device, all fields of the data content are spliced to form the first character string, the first character string is encrypted to obtain the second character string, and the second character string is converted into the first verification field, so that the originally stored data content can be reserved, the original data content cannot be encrypted, when the original data content is checked by a worker, decryption processing is not needed, the operation steps are simplified, and the time is saved. The device carries out XOR operation on even bytes and odd bytes in the first byte array respectively through different keys, on one hand, the speed of encryption processing can be improved, and on the other hand, the decryption rate of encryption can be reduced by adopting the odd numbers and the even numbers to carry out encryption respectively. The device adopts exclusive-or operation as an encryption method, not only has very high execution efficiency and good reliability, but also has small occupancy rate to computer resources.
Referring to fig. 6, the present invention further provides a computer device 50, which includes a memory 51 and a processor 52, wherein the memory 51 is connected to the processor 52 through a bus or other means, and the processor 52 is configured to control the overall operation of the computer device 50 to complete all or part of the steps of the above-mentioned method for quickly identifying data tampering. The Memory 51 is used for storing various types of data to support the operation of the computer device 50, and the Memory 501 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), an EPROM, a Programmable Read-Only Memory (PROM) or a ROM, a magnetic Memory, a flash Memory, a magnetic disk or an optical disk. The computer Device 50 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components, and is used for executing the above-mentioned data tampering rapid identification method.
For example, the present invention also provides a computer-readable storage medium including program instructions, which when executed by a processor, implement the steps of the above-described data tampering rapid identification method. For example, the computer readable storage medium may be the memory 51 described above comprising program instructions executable by the processor 52 of the computer device 50 to perform the data tampering rapid identification method described above.
For a description of a relevant part in the data tampering rapid identification device, the computer device, and the computer-readable storage medium provided in the embodiments of the present invention, reference is made to detailed descriptions of a corresponding part in the data tampering rapid identification method provided in the embodiments of the present invention, and details are not repeated here.
In summary, the present invention provides a method, an apparatus, a device, and a medium for quickly identifying data tampering, in which all fields of data content to be stored are spliced and converted into a first verification field, so that original data is not affected, and when a worker needs to check some original data, the worker does not need to perform a decryption operation, and can quickly invoke and check the original data. The even bytes and the odd bytes in the first byte array are subjected to exclusive-or operation through different keys, so that on one hand, the encryption processing speed can be improved, and on the other hand, the decryption rate of the encryption can be reduced by adopting the odd and even numbers for encryption respectively. Aiming at huge data volume in a database of the coal mine safety monitoring system, the XOR operation is adopted as an encryption method, so that the execution efficiency is very high, the reliability is good, and the occupancy rate of computer resources is small. According to the data tampering identification method provided by the invention, on one hand, the data content is prevented from being tampered, the data storage and query efficiency of a coal mine safety monitoring system is not influenced, on the other hand, the illegal tampering content can be quickly verified and identified, the illegal tampering data is marked or removed on a display interface, and the authenticity of the data is improved.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples" or the like mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims (9)
1. A data tampering rapid identification method is applied to a coal mine safety monitoring system and is characterized by comprising the following steps:
s101: converting the data content to be stored into a first verification field;
s102: storing the data content to be stored and the first verification field into a database at the same time;
s103: when the content of the database is monitored to be modified, starting an automatic verification mechanism, if the modified content cannot pass verification, identifying the modified content as illegal tampering, and performing data rollback processing;
or inquiring and reading the data content stored in the database, converting the read data content into a third verification field, comparing whether the first verification field is consistent with the third verification field, and identifying that the data content is tampered if the first verification field is inconsistent with the third verification field.
2. The method according to claim 1, wherein the step S101 includes:
s201: all fields of each data content to be stored are spliced to form a first character string;
s202: converting the first character string into a first byte array;
s203: creating a first key and a second key, encrypting even bytes in the first byte array by using the first key, and encrypting odd bytes in the first byte array by using the second key to obtain a second byte array;
s204: and converting the second byte array into a second character string, wherein the second character string is the first verification field.
3. The method according to claim 2, wherein the encryption processing in step S203 adopts an exclusive or operation encryption manner, and the values of the first key and the second key are different.
4. The method for rapidly identifying data tampering as claimed in claim 1, wherein the automatic verification mechanism comprises:
s301: creating a trigger in the database, and monitoring whether the data content is subjected to modification operation or not by using the trigger;
s302: scaling the modified content into a second authentication field;
s303: and comparing whether the second verification field is consistent with the first verification field, if not, determining that the operation is illegal tampering, and performing data rollback processing.
5. A data tampering rapid identification device used in the data tampering rapid identification method according to any one of claims 1 to 4, comprising:
a conversion unit (41) for converting the data content to be stored into a first verification field;
a storage unit (42), connected to the scaling unit (41), for storing the data content to be stored and the first verification field in a database at the same time;
the verification identification unit (43) is connected with the storage unit (42) and is used for data verification, when the fact that the content of the database is modified is monitored, an automatic verification mechanism is started, if the modified content cannot pass verification, the modified content is identified as illegal tampering, and data rollback processing is carried out;
the inquiry identification unit (44) is connected with the storage unit (42), and the inquiry identification unit (44) is used for inquiring and reading the data content stored in the database, converting the read data content into a third verification field, and comparing whether the first verification field is consistent with the third verification field, if not, the data content is identified to be tampered.
6. A rapid identification device of data tampering as claimed in claim 5, wherein said verification identification unit (43) comprises a trigger (431), said trigger (431) is used to monitor whether the data content is modified.
7. The device for rapidly identifying data tampering as claimed in claim 5, wherein the conversion unit (41) comprises a concatenation conversion unit (411) and an encryption conversion unit (412), the encryption conversion unit (412) is connected to the concatenation conversion unit (411), the concatenation conversion unit (411) is configured to concatenate all fields of each data content to be stored to form a first character string and convert the first character string into a first byte array, the encryption conversion unit (412) is configured to create a first key and a second key, encrypt even bytes in the first byte array using the first key, encrypt odd bytes in the first byte array using the second key to obtain a second byte array, and convert the second byte array into a second character string, the second string is the first verification field.
8. A computer device, comprising: a memory (51), a processor (52) and a computer program stored on the memory (51) and executable on the processor (52), the processor (52) implementing the method of rapid identification of data tampering as claimed in any one of claims 1 to 4 when executing the computer program.
9. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method for rapid identification of data tampering of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110073778.5A CN112733205A (en) | 2021-01-20 | 2021-01-20 | Data tampering rapid identification method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110073778.5A CN112733205A (en) | 2021-01-20 | 2021-01-20 | Data tampering rapid identification method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112733205A true CN112733205A (en) | 2021-04-30 |
Family
ID=75592629
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110073778.5A Pending CN112733205A (en) | 2021-01-20 | 2021-01-20 | Data tampering rapid identification method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112733205A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113507510A (en) * | 2021-06-25 | 2021-10-15 | 中标慧安信息技术股份有限公司 | Internet of things data illegal tampering monitoring method and system |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101482887A (en) * | 2009-02-18 | 2009-07-15 | 北京数码视讯科技股份有限公司 | Anti-tamper verification method for key data in database |
CN104331762A (en) * | 2014-10-22 | 2015-02-04 | 刘品新 | Food safety traceability system capable of preventing archive from being tampered |
CN104517073A (en) * | 2013-09-26 | 2015-04-15 | 江苏智软信息科技有限公司 | Method for realizing safe information preservation by combining, encrypting and preserving key field information |
CN106874794A (en) * | 2016-12-08 | 2017-06-20 | 环球智达科技(北京)有限公司 | A kind of file tamper resistant systems |
CN111125776A (en) * | 2019-12-12 | 2020-05-08 | 成都四方伟业软件股份有限公司 | Operation data tamper-proofing method based on block chain |
CN111523131A (en) * | 2020-04-16 | 2020-08-11 | 丝链(常州)控股有限公司 | Encrypted data storage method with high safety |
CN111967064A (en) * | 2020-09-05 | 2020-11-20 | 湖南西盈网络科技有限公司 | Webpage tamper-proofing method and system |
-
2021
- 2021-01-20 CN CN202110073778.5A patent/CN112733205A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101482887A (en) * | 2009-02-18 | 2009-07-15 | 北京数码视讯科技股份有限公司 | Anti-tamper verification method for key data in database |
CN104517073A (en) * | 2013-09-26 | 2015-04-15 | 江苏智软信息科技有限公司 | Method for realizing safe information preservation by combining, encrypting and preserving key field information |
CN104331762A (en) * | 2014-10-22 | 2015-02-04 | 刘品新 | Food safety traceability system capable of preventing archive from being tampered |
CN106874794A (en) * | 2016-12-08 | 2017-06-20 | 环球智达科技(北京)有限公司 | A kind of file tamper resistant systems |
CN111125776A (en) * | 2019-12-12 | 2020-05-08 | 成都四方伟业软件股份有限公司 | Operation data tamper-proofing method based on block chain |
CN111523131A (en) * | 2020-04-16 | 2020-08-11 | 丝链(常州)控股有限公司 | Encrypted data storage method with high safety |
CN111967064A (en) * | 2020-09-05 | 2020-11-20 | 湖南西盈网络科技有限公司 | Webpage tamper-proofing method and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113507510A (en) * | 2021-06-25 | 2021-10-15 | 中标慧安信息技术股份有限公司 | Internet of things data illegal tampering monitoring method and system |
CN113507510B (en) * | 2021-06-25 | 2022-07-15 | 中标慧安信息技术股份有限公司 | Internet of things data illegal tampering monitoring method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110826111B (en) | Test supervision method, device, equipment and storage medium | |
US8175268B2 (en) | Generating and securing archive keys | |
CN107145802A (en) | A kind of BIOS integrity measurement methods, baseboard management controller and system | |
US20030236992A1 (en) | Method and system for providing secure logging for intrusion detection | |
US20100185843A1 (en) | Hardware encrypting storage device with physically separable key storage device | |
US20070300031A1 (en) | Memory data shredder | |
CN107169379A (en) | A kind of method and server that integrity measurement is carried out based on BMC and TCM | |
EP2803011B1 (en) | Detection of invalid escrow keys | |
CN110795126A (en) | Firmware safety upgrading system | |
CN113688399A (en) | Firmware digital signature protection method and device, computer equipment and storage medium | |
CN104484628A (en) | Multi-application intelligent card with encryption and decryption functions | |
CN112733205A (en) | Data tampering rapid identification method, device, equipment and medium | |
CN110717770B (en) | Anti-counterfeiting detection method, device, equipment and storage medium for vehicle parts | |
CN115640591B (en) | Contract management system and method for supply chain | |
CN108376212B (en) | Execution code security protection method and device and electronic device | |
CN113868628B (en) | Signature verification method, signature verification device, computer equipment and storage medium | |
CN112883397B (en) | Data storage method, data reading method, device, equipment and storage medium | |
CN109583196B (en) | Key generation method | |
CN112800492A (en) | Control method and device for decrypting disk data | |
CN113496029A (en) | Updating method and device of vehicle-mounted application program, vehicle-mounted management equipment and vehicle | |
CN113468607A (en) | Generation and use method of encrypted tamper-resistant file | |
CN112306565B (en) | Encryption starting device and method for FPGA (field programmable gate array) product and related components | |
CN111049657A (en) | CAN bus network equipment node access authority management method and system | |
JP4710232B2 (en) | Electronic data storage system that stores electronic data while guaranteeing the evidence | |
CN109995700B (en) | Security protection method of application program, application client and ACR server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |