CN108846298A - A kind of altering detecting method and relevant device of file content - Google Patents
A kind of altering detecting method and relevant device of file content Download PDFInfo
- Publication number
- CN108846298A CN108846298A CN201810500880.7A CN201810500880A CN108846298A CN 108846298 A CN108846298 A CN 108846298A CN 201810500880 A CN201810500880 A CN 201810500880A CN 108846298 A CN108846298 A CN 108846298A
- Authority
- CN
- China
- Prior art keywords
- file
- hashed value
- file destination
- content
- destination
- 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 59
- RTZKZFJDLAIYFH-UHFFFAOYSA-N Diethyl ether Chemical compound CCOCC RTZKZFJDLAIYFH-UHFFFAOYSA-N 0.000 claims abstract description 68
- 238000001514 detection method Methods 0.000 claims description 24
- 238000004422 calculation algorithm Methods 0.000 claims description 23
- 238000004590 computer program Methods 0.000 claims description 18
- 238000003860 storage Methods 0.000 claims description 15
- 230000008859 change Effects 0.000 claims description 6
- 239000004744 fabric Substances 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 241000609666 Tuber aestivum Species 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000005266 casting Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
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
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2107—File encryption
Abstract
The embodiment of the invention discloses a kind of altering detecting methods of file content, can detecte whether file content is tampered.This method includes:Obtain the file name and file content of file destination;The first hashed value of the file destination is inquired according to the file name of the file destination, first hashed value is the file content of the file destination in the first moment corresponding hashed value, and first hashed value is the hashed value in the target contract being distributed in ether mill;The second hashed value of the file destination is calculated according to the file content of the file destination, second hashed value is the corresponding hashed value of file content of file destination described in the second moment, and second moment is any time for being later than first moment;First hashed value is matched with second hashed value, whether is tampered with the file content of the determination file destination.
Description
Technical field
The present invention relates to file detection field more particularly to the altering detecting methods and relevant device of a kind of file content.
Background technique
With the development of the society, the method for technology, more and more people begin to use personal intelligent terminal to carry out at file
Reason.Opposite, with the development of network, internet worm is also more and more rampant, and the file stored on personal intelligent terminal may
By internet worm attack and file content is distorted, in turn result in massive losses.
There is no the effective methods of special efficacy for target to detect whether file content is tampered, therefore whether detect file content
Being tampered is a urgent problem to be solved.
Summary of the invention
In view of the above technical problems, the embodiment of the invention provides a kind of altering detecting methods of file content and correlation to set
It is standby, it can quickly detect whether file content is tampered.
The first aspect of the embodiment of the present invention provides a kind of altering detecting method of file content, specifically includes:
The file name and file content of file destination are obtained, the file destination is file to be detected;
The first hashed value of the file destination, first hashed value are inquired according to the file name of the file destination
For the file destination file content in the first moment corresponding hashed value, and first hashed value is to be distributed to ether mill
In target contract in hashed value;
The second hashed value of the file destination, second hashed value are calculated according to the file content of the file destination
For the corresponding hashed value of file content of file destination described in the second moment, second moment is to be later than first moment
Any time;
First hashed value is matched with second hashed value, with the file content of the determination file destination
Whether it is tampered.
Optionally, the file name according to the file destination inquire the file destination the first hashed value it
Before, the method includes:
Calculate corresponding first hashed value of file content of the file destination at first moment;
The corresponding contract code of the target contract is write based on first hashed value;
The contract code is distributed to the ether mill, and generates the object invocation parameter of the target contract:
The first hashed value that the file name according to the file destination inquires the file destination includes:
First hashed value is called according to the object invocation parameter.
Optionally, described to match first hashed value with second hashed value, with the determination target text
The file content of part whether be tampered including:
Judge whether first hashed value matches with second hashed value;
When first hashed value and second Hash value matches, it is determined that the file content of the file destination is not
It is tampered.
Optionally, when first hashed value does not match with second hashed value, the method also includes:
Determine that the file content of the file destination is tampered.
Optionally, after the file content of the determination file destination is tampered, the method also includes:
First hashed value is calculated by inverse algorithms, to obtain the file destination at first moment
File content.
The embodiment of the present invention the and aspect provides a kind of tampering detection apparatus of file content, being applied to wisdom shops is
System, specifically includes:
Acquiring unit, for obtaining the file name and file content of file destination, the file destination is to be detected
File;
Query unit, for inquiring the first hashed value of the file destination according to the file name of the file destination,
First hashed value is the file content of the file destination in the first moment corresponding hashed value, and first hashed value
For the hashed value in the target contract that is distributed in ether mill;
First computing unit, for calculating the second hash of the file destination according to the file content of the file destination
Value, second hashed value are the corresponding hashed value of file content of file destination described in the second moment, and second moment is
It is later than any time at first moment;
Matching unit, for matching first hashed value with second hashed value, with the determination target
Whether the file content of file is tampered.
Optionally, described device further includes:
Second computing unit, for calculating the file content of the file destination at first moment corresponding described
One hashed value;
Coding unit, for writing the corresponding contract code of the target contract based on first hashed value;
Generation unit for the contract code to be distributed to the ether mill, and generates the target of the target contract
Call parameters:
The query unit is specifically used for:
First hashed value is called according to the object invocation parameter.
Optionally, the matching unit is specifically used for:
Judge whether first hashed value matches with second hashed value;
When first hashed value and second Hash value matches, it is determined that the file content of the file destination is not
It is tampered.
Optionally, the matching unit is also particularly useful for when first hashed value does not match with second hashed value
When, determine that the file content of the file destination is tampered.
Optionally, second computing unit also particularly useful for:
First hashed value is calculated by inverse algorithms, to obtain the file destination at first moment
File content.
The third aspect of the embodiment of the present invention provides a kind of processor, and the processor is for running computer program, institute
The step of stating the altering detecting method that the file content as described in above-mentioned any one is executed when computer program operation.
Fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, is stored thereon with computer journey
Sequence, it is characterised in that:The computer program realizes usurping for file content described in above-mentioned any one when being executed by processor
The step of changing detection method.
In view of the foregoing it is apparent that since the file content of file destination at the first moment is to have passed through hashing algorithm
The first hashed value is calculated, and target contract is obtained according to the first hashed value, and be distributed on ether mill, then detection target
Whether the file content of file is tampered at the second moment, both can calculate file destination by hashing algorithm at the second moment
Second hashed value of the file content at the second moment, by comparing whether two hashed values match the text to determine file destination
Whether part content is tampered.Since the quantum algorithm of target can not crack hashing algorithm, and due to the characteristic in ether mill,
Preferably file content can be prevented to be tampered, while more quickly whether detection file destination is tampered.
Detailed description of the invention
Fig. 1 is one embodiment schematic diagram of the altering detecting method of file content provided in an embodiment of the present invention;
Fig. 2 is one embodiment schematic diagram of the tampering detection apparatus of file content provided in an embodiment of the present invention;
Another embodiment schematic diagram of the tampering detection apparatus of the position Fig. 3 file content provided in an embodiment of the present invention;
Fig. 4 is the hardware structural diagram of the tampering detection apparatus of file content provided in an embodiment of the present invention.
Specific embodiment
The present invention provides a kind of altering detecting method of file content, device and storage mediums, can preferably detect
Whether file content is tampered out.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.
Description and claims of this specification and term " first " in above-mentioned attached drawing, " second " etc. are for distinguishing
Similar object, without being used to describe a particular order or precedence order.It should be understood that the data used in this way are in appropriate feelings
It can be interchanged under condition, so that the embodiments described herein can be real with the sequence other than the content for illustrating or describing herein
It applies.In addition, term " includes " and " having " and their any deformation, it is intended that cover it is non-exclusive include, for example, packet
The process, method, system, product or equipment for having contained series of steps or module those of be not necessarily limited to be clearly listed step or
Module, but may include other steps being not clearly listed or intrinsic for these process, methods, product or equipment or
Module, the division of module appeared in the present invention, only a kind of division in logic can have when realizing in practical application
Other division mode, such as multiple modules can be combined into or are integrated in another system, or some features can be ignored,
Or do not execute, in addition, shown or discussion mutual coupling, direct-coupling or communication connection can be by one
A little interfaces, the indirect coupling or communication connection between module can be electrical or other similar form, do not make in the present invention
It limits.Also, module or submodule can be the separation that may not be physically as illustrated by the separation member, can be
It can not be physical module, or can be distributed in multiple circuit modules, portion therein can be selected according to the actual needs
Point or whole module realize the purpose of the present invention program.
The present invention wants the support of truffle running environment, solidity program and ether mill.Wherein, Truffle is mesh
Preceding most popular ether mill Development Framework supports compiling, deployment and the test of intelligent contract using written in JavaScript,
Solidity is a kind of intelligent contract high-level language, writes a file data library with solidity, is used for what is finished writing
The solidity intelligence contract for recording the hash of file content is published to ether mill node." hash " is done in Hash, general translation,
Having direct transliteration is " Hash ", and exactly the input of random length (is called and does preliminary mapping, pre-image), is calculated by hash
Method is transformed into the output of regular length, which is exactly hashed value, and calls access solidity to write by truffle
Contract-defined interface.
The altering detecting method of file content is illustrated from the angle of the tampering detection apparatus of file content below, it should
The tampering detection apparatus of file content can be server, or the functional unit of server does not limit specifically.
Referring to Fig. 1, one embodiment of the altering detecting method of file content includes in the embodiment of the present invention:
101, the file name and file content of file destination are obtained.
In the present embodiment, the tampering detection apparatus of file content can obtain the file name and text of file destination first
Part content does not specifically limit specific acquisition modes herein, as long as can get in the file name and file of file destination
Appearance, wherein the file destination is the file to be detected whether being tampered.
102, the first hashed value of file destination is inquired according to the file name of file destination.
In the present embodiment, the tampering detection apparatus of file content can inquire target text according to the file name of file destination
First hashed value of part, wherein the first hashed value is the file content of file destination in the first moment corresponding hashed value, and should
First hashed value is the hashed value in the target contract being distributed in ether mill, which is the corresponding conjunction of file destination
About.
It should be noted that the corresponding contract of the file destination is to be deployed on ether mill in advance, wherein specific deployment side
Formula for example can be:
Step 1:Corresponding first hashed value of file content of the file destination at the first moment is calculated, wherein specific calculate
Mode without limitation, such as by file content of the hashing algorithm to file destination carries out that the first hashed value is calculated;
Step 2:Write the corresponding contract code of target contract based on the first hashed value, below a specific contract code
For exemplary illustration:
Step 3:Contract code is distributed to ether mill, and generates the corresponding object invocation parameter of target contract, such as transport
Row treffle order contract:truffle migrate.Wherein, the corresponding object invocation parameter of target contract is generated, such as can
The hashed value of file can be calculated to pass through order line sha256sum filepath under linux, hashed value is corresponding
File name oneself can specify.
It should be noted that since the file content that first hashed value is file destination is calculated by hashing algorithm,
And the corresponding contract code of target contract is write according to first hashed value, and the contract code is distributed in ether mill, and
Object invocation function is generated, therefore, inquires the first hashed value of file destination in step 102 according to the file name of file destination
It can be corresponding first hashed value of file content for inquiring file destination from ether mill by object invocation parameter.Tool
Body, according to the characteristic of ether mill contract, a request can be issued, and according to the file content of the request call file destination
Corresponding first hashed value, and call result is returned, specific code realization is illustrated for following:
Wherein, input order truffle console enters truffle console, and calling, which is such as issued orders, carries out rpc calling
Corresponding first hashed value of the file content of file destination;
File.deployed().then(function(instance){return instance.register("
File1 ", " 0xdd6440c14971730ddfb8683c7b34aacd0279dc297102a1a825d4c5 24ccbc3b1b ");
})。
The example returned the result can be as follows:
It should be noted that above-mentioned calling and returning the result is merely illustrative, do not represent to of the invention
It limits.
103, the second hashed value of file destination is calculated according to the file content of file destination.
In the present embodiment, the altering detecting method of file content can calculate target text according to the file content of file destination
Second hashed value of part, second hashed value are the corresponding hashed value of file content of the second moment file destination, the second moment
For any time for being later than for the first moment.Such as the file content of the second moment file destination can be converted by hashing algorithm
For hashed value.
104, the first hashed value is matched with the second hashed value, to determine whether the file content of file destination is usurped
Change.
In the present embodiment, after the tampering detection apparatus of file content gets the first hashed value and the second hashed value,
First hashed value can be matched with the second hashed value, to determine whether the file content of file destination is tampered.Specifically
, since the first hashed value in the target contract in ether mill is the file content according to the file destination at the first moment by dissipating
Column algorithm is calculated, and by due to the characteristic of contract intelligent in ether mill, protecting in the target contract in the ether mill of storage
Having demonstrate,proved the first hashed value will not be tampered, and also just have the benchmark of comparison, and the second moment was later than for the first moment, may be second
The file content of moment file destination has been tampered with, therefore file content and second moment of the file destination at the first moment
File content be possible to be different, therefore can by the file content to file destination the first moment first hash
Second hashed value of the file content of value and file destination at the second moment compares, to determine the file of file destination
Whether content is tampered, and specific step is as follows:
Step 1:Judge whether the first hashed value matches with the second hashed value, if so, 2 are thened follow the steps, if it is not, then executing
Step 3.
Step 2:When the first hashed value and the second Hash value matches, it is determined that the file content of file destination is not usurped
Change.
Step 3:When the first hashed value and the second hashed value mismatch, it is determined that the file content of file destination is usurped
Change.
It should be noted that file content distorts inspection after the file content for determining file destination has been tampered with
Device is surveyed, the first hashed value can be calculated by inverse algorithms, to obtain file destination in the file at the first moment
Hold.
In view of the foregoing it is apparent that since the file content of file destination at the first moment is to have passed through hashing algorithm
The first hashed value is calculated, and target contract is obtained according to the first hashed value, and be distributed on ether mill, then detection target
Whether the file content of file is tampered at the second moment, both can calculate file destination by hashing algorithm at the second moment
Second hashed value of the file content at the second moment, by comparing whether two hashed values match the text to determine file destination
Whether part content is tampered.Since the quantum algorithm of target can not crack hashing algorithm, and due to the characteristic in ether mill,
Preferably file content can be prevented to be tampered, while whether the detection file destination for more accelerating to calculate is tampered.
The altering detecting method of the file content in the embodiment of the present invention is described above, below to of the invention real
The tampering detection apparatus for applying the file content in example is described.
Referring to Fig. 2, one embodiment that Fig. 2 is the tampering detection apparatus of file content provided in an embodiment of the present invention is shown
It is intended to, specifically includes:
Acquiring unit 201, for obtaining the file name and file content of file destination, the file destination is to be checked
The file of survey;
Query unit 202, for inquiring the first hash of the file destination according to the file name of the file destination
Value, first hashed value is the file content of the file destination in the first moment corresponding hashed value, and described first dissipates
Train value is the hashed value in the target contract being distributed in ether mill;
First computing unit 203, for calculating the second of the file destination according to the file content of the file destination
Hashed value, second hashed value is the corresponding hashed value of file content of file destination described in the second moment, when described second
Carving is any time for being later than first moment;
Matching unit 204, for matching first hashed value with second hashed value, with the determination mesh
Whether the file content of mark file is tampered.
In order to make it easy to understand, being described in detail below with reference to Fig. 3.
Referring to Fig. 3, another implementation that Fig. 3 is the tampering detection apparatus of file content provided in an embodiment of the present invention illustrates
It is intended to, specifically includes:
Acquiring unit 301, for obtaining the file name and file content of file destination, the file destination is to be checked
The file of survey;
Query unit 302, for inquiring the first hash of the file destination according to the file name of the file destination
Value, first hashed value is the file content of the file destination in the first moment corresponding hashed value, and described first dissipates
Train value is the hashed value in the target contract being distributed in ether mill;
First computing unit 303, for calculating the second of the file destination according to the file content of the file destination
Hashed value, second hashed value is the corresponding hashed value of file content of file destination described in the second moment, when described second
Carving is any time for being later than first moment;
Matching unit 304, for matching first hashed value with second hashed value, with the determination mesh
Whether the file content of mark file is tampered;
Second computing unit 305, for calculating the corresponding institute of the file content of the file destination at first moment
State the first hashed value;
Coding unit 306, for writing the corresponding contract code of the target contract based on first hashed value;
Generation unit 307 for the contract code to be distributed to the ether mill, and generates the mesh of the target contract
Mark call parameters.
Wherein, the query unit 302 is specifically used for:
First hashed value is called according to the object invocation parameter.
The matching unit 304 is specifically used for:
Judge whether first hashed value matches with second hashed value;
When first hashed value and second Hash value matches, it is determined that the file content of the file destination is not
It is tampered;
The matching unit 304, also particularly useful for when first hashed value and second hashed value mismatch, really
The file content of the fixed file destination is tampered.
The matching unit 304 calculates first hashed value also particularly useful for by inverse algorithms, to obtain
File content of the file destination at first moment.
It should be noted that the tampering detection apparatus of file content is similar with embodiment shown in FIG. 1 in the present embodiment, on
It states and detailed description has been carried out, specific details are not described herein again.
In view of the foregoing it is apparent that since the file content of file destination at the first moment is to have passed through hashing algorithm
The first hashed value is calculated, and target contract is obtained according to the first hashed value, and be distributed on ether mill, then detection target
Whether the file content of file is tampered at the second moment, both can calculate file destination by hashing algorithm at the second moment
Second hashed value of the file content at the second moment, by comparing whether two hashed values match the text to determine file destination
Whether part content is tampered.Since the quantum algorithm of target can not crack hashing algorithm, and due to the characteristic in ether mill,
Preferably file content can be prevented to be tampered, while whether the detection file destination for more accelerating to calculate is tampered.
It should be noted that in the above-described embodiments, all emphasizing particularly on different fields to the description of each embodiment, in some embodiment
The part being not described in may refer to the associated description of other embodiments.
Referring to Fig. 4, the embodiment of the invention also provides a kind of tampering detection apparatus of file content, the file content
Tampering detection apparatus include processor 401 and memory 402, above-mentioned acquiring unit, transmission unit, receiving unit and casting are single
Member etc. stores in memory as program unit, executes above procedure unit stored in memory by processor Lai real
Now corresponding function.
Include kernel in processor 401, is gone in memory to transfer corresponding program unit by kernel.Kernel can be set one
It is a or more, user data is updated by adjusting kernel parameter.
Memory 402 may include the non-volatile memory in computer-readable medium, random access memory (RAM)
And/or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one
Storage chip.
The embodiment of the invention provides a kind of storage mediums, are stored thereon with program, real when which is executed by processor
The altering detecting method of the existing file content.
The embodiment of the invention provides a kind of processor, the processor is for running program, wherein described program operation
The altering detecting method of file content described in Shi Zhihang.
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just
The program of beginningization there are as below methods step:
The file name and file content of file destination are obtained, the file destination is file to be detected;
The first hashed value of the file destination, first hashed value are inquired according to the file name of the file destination
For the file destination file content in the first moment corresponding hashed value, and first hashed value is to be distributed to ether mill
In target contract in hashed value;
The second hashed value of the file destination, second hashed value are calculated according to the file content of the file destination
For the corresponding hashed value of file content of file destination described in the second moment, second moment is to be later than first moment
Any time;
First hashed value is matched with second hashed value, with the file content of the determination file destination
Whether it is tampered.
Optionally, the file name according to the file destination inquire the file destination the first hashed value it
Before, the method includes:
Calculate corresponding first hashed value of file content of the file destination at first moment;
The corresponding contract code of the target contract is write based on first hashed value;
The contract code is distributed to the ether mill, and generates the object invocation parameter of the target contract:
The first hashed value that the file name according to the file destination inquires the file destination includes:
First hashed value is called according to the object invocation parameter.
Optionally, described to match first hashed value with second hashed value, with the determination target text
The file content of part whether be tampered including:
Judge whether first hashed value matches with second hashed value;
When first hashed value and second Hash value matches, it is determined that the file content of the file destination is not
It is tampered.
Optionally, when first hashed value does not match with second hashed value, the method also includes:
Determine that the file content of the file destination is tampered.
Optionally, after the file content of the determination file destination is tampered, the method also includes:
First hashed value is calculated by inverse algorithms, to obtain the file destination at first moment
File content.
Present invention also provides a kind of computer program products, when executing on data processing equipment, are further adapted for executing
The program of initialization there are as below methods step:
The file name and file content of file destination are obtained, the file destination is file to be detected;
The first hashed value of the file destination, first hashed value are inquired according to the file name of the file destination
For the file destination file content in the first moment corresponding hashed value, and first hashed value is to be distributed to ether mill
In target contract in hashed value;
The second hashed value of the file destination, second hashed value are calculated according to the file content of the file destination
For the corresponding hashed value of file content of file destination described in the second moment, second moment is to be later than first moment
Any time;
First hashed value is matched with second hashed value, with the file content of the determination file destination
Whether it is tampered.
Optionally, the file name according to the file destination inquire the file destination the first hashed value it
Before, the method includes:
Calculate corresponding first hashed value of file content of the file destination at first moment;
The corresponding contract code of the target contract is write based on first hashed value;
The contract code is distributed to the ether mill, and generates the object invocation parameter of the target contract:
The first hashed value that the file name according to the file destination inquires the file destination includes:
First hashed value is called according to the object invocation parameter.
Optionally, described to match first hashed value with second hashed value, with the determination target text
The file content of part whether be tampered including:
Judge whether first hashed value matches with second hashed value;
When first hashed value and second Hash value matches, it is determined that the file content of the file destination is not
It is tampered.
Optionally, when first hashed value does not match with second hashed value, the method also includes:
Determine that the file content of the file destination is tampered.
Optionally, after the file content of the determination file destination is tampered, the method also includes:
First hashed value is calculated by inverse algorithms, to obtain the file destination at first moment
File content.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application be referring to the method for the embodiment of the present application, equipment (system) and computer program product flow chart and/
Or block diagram describes.It should be understood that each process that can be realized by computer program instructions in flowchart and/or the block diagram and/
Or the combination of the process and/or box in box and flowchart and/or the block diagram.It can provide these computer program instructions
To general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor to generate one
A machine so that by the instruction that the processor of computer or other programmable data processing devices executes generate for realizing
The device for the function of being specified in one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie
The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or
Any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, computer
Readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element
There is also other identical elements in process, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to the foregoing embodiments
Invention is explained in detail, those skilled in the art should understand that:It still can be to aforementioned each implementation
Technical solution documented by example is modified or equivalent replacement of some of the technical features;And these modification or
Replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.
Claims (10)
1. a kind of altering detecting method of file content, which is characterized in that including:
The file name and file content of file destination are obtained, the file destination is file to be detected;
The first hashed value of the file destination is inquired according to the file name of the file destination, first hashed value is institute
The file content of file destination is stated in the first moment corresponding hashed value, and first hashed value is to be distributed in ether mill
Hashed value in target contract;
Calculate the second hashed value of the file destination according to the file content of the file destination, second hashed value is the
The corresponding hashed value of the file content of file destination described in two moment, second moment are be later than first moment any
Moment;
First hashed value is matched with second hashed value, with the file content of the determination file destination whether
It is tampered.
2. the method according to claim 1, wherein described inquire institute according to the file name of the file destination
Before the first hashed value for stating file destination, the method includes:
Calculate corresponding first hashed value of file content of the file destination at first moment;
The corresponding contract code of the target contract is write based on first hashed value;
The contract code is distributed to the ether mill, and generates the object invocation parameter of the target contract:
The first hashed value that the file name according to the file destination inquires the file destination includes:
First hashed value is called according to the object invocation parameter.
3. the method according to claim 1, wherein described by first hashed value and second hashed value
Matched, with the file content of the determination file destination whether be tampered including:
Judge whether first hashed value matches with second hashed value;
When first hashed value and second Hash value matches, it is determined that the file content of the file destination is not usurped
Change.
4. according to the method described in claim 3, it is characterized in that, when first hashed value and second hashed value not
Timing, the method also includes:
Determine that the file content of the file destination is tampered.
5. according to the method described in claim 4, it is characterized in that, the file content of the determination file destination is tampered
Later, the method also includes:
First hashed value is calculated by inverse algorithms, to obtain the file destination in the text at first moment
Part content.
6. a kind of tampering detection apparatus of file content, which is characterized in that including:
Acquiring unit, for obtaining the file name and file content of file destination, the file destination is text to be detected
Part;
Query unit, it is described for inquiring the first hashed value of the file destination according to the file name of the file destination
First hashed value is the file content of the file destination in the first moment corresponding hashed value, and first hashed value is hair
Hashed value of the cloth in the target contract into ether mill;
First computing unit, for calculating the second hashed value of the file destination according to the file content of the file destination,
Second hashed value is the corresponding hashed value of file content of file destination described in the second moment, and second moment is to be later than
Any time at first moment;
Matching unit, for matching first hashed value with second hashed value, with the determination file destination
File content whether be tampered.
7. device according to claim 6, which is characterized in that described device further includes:
Second computing unit is dissipated for calculating the file content of the file destination at first moment corresponding described first
Train value;
Coding unit, for writing the corresponding contract code of the target contract based on first hashed value;
Generation unit for the contract code to be distributed to the ether mill, and generates the object invocation of the target contract
Parameter:
The query unit is specifically used for:
First hashed value is called according to the object invocation parameter.
8. device according to claim 6, which is characterized in that the matching unit is specifically used for:
Judge whether first hashed value matches with second hashed value;
When first hashed value and second Hash value matches, it is determined that the file content of the file destination is not usurped
Change.
9. a kind of processor, which is characterized in that the processor is for running computer program, when the computer program is run
The step of executing the altering detecting method of the file content as described in any one of claim 1 to 5.
10. a kind of computer readable storage medium, is stored thereon with computer program, it is characterised in that:The computer program
The step of altering detecting method of the file content as described in any one of claim 1 to 5 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810500880.7A CN108846298A (en) | 2018-05-23 | 2018-05-23 | A kind of altering detecting method and relevant device of file content |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810500880.7A CN108846298A (en) | 2018-05-23 | 2018-05-23 | A kind of altering detecting method and relevant device of file content |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108846298A true CN108846298A (en) | 2018-11-20 |
Family
ID=64213265
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810500880.7A Pending CN108846298A (en) | 2018-05-23 | 2018-05-23 | A kind of altering detecting method and relevant device of file content |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108846298A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113515486A (en) * | 2020-04-10 | 2021-10-19 | 华晨宝马汽车有限公司 | Method, system and computer readable medium for event double check |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101809566A (en) * | 2007-10-01 | 2010-08-18 | 微软公司 | File hash identifier calculates efficiently |
US20130066901A1 (en) * | 2011-09-13 | 2013-03-14 | Microsoft Corporation | Hash-based file comparison |
WO2013100320A1 (en) * | 2011-12-29 | 2013-07-04 | 주식회사 안랩 | System, user terminal, method, and apparatus for protecting and recovering system file. |
CN104184818A (en) * | 2014-08-29 | 2014-12-03 | 中国科学院合肥物质科学研究院 | Electronic document tamper-proof method |
CN106650495A (en) * | 2016-12-16 | 2017-05-10 | 杭州嘉楠耘智信息科技有限公司 | File verification method and device |
CN106952660A (en) * | 2015-10-26 | 2017-07-14 | 奥林巴斯株式会社 | The tamper resistant method of information record carrier and information record carrier |
CN107820690A (en) * | 2017-08-21 | 2018-03-20 | 达闼科技成都有限公司 | Information choosing method, device, electronic equipment and computer-readable recording medium |
-
2018
- 2018-05-23 CN CN201810500880.7A patent/CN108846298A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101809566A (en) * | 2007-10-01 | 2010-08-18 | 微软公司 | File hash identifier calculates efficiently |
US20130066901A1 (en) * | 2011-09-13 | 2013-03-14 | Microsoft Corporation | Hash-based file comparison |
WO2013100320A1 (en) * | 2011-12-29 | 2013-07-04 | 주식회사 안랩 | System, user terminal, method, and apparatus for protecting and recovering system file. |
CN104184818A (en) * | 2014-08-29 | 2014-12-03 | 中国科学院合肥物质科学研究院 | Electronic document tamper-proof method |
CN106952660A (en) * | 2015-10-26 | 2017-07-14 | 奥林巴斯株式会社 | The tamper resistant method of information record carrier and information record carrier |
CN106650495A (en) * | 2016-12-16 | 2017-05-10 | 杭州嘉楠耘智信息科技有限公司 | File verification method and device |
CN107820690A (en) * | 2017-08-21 | 2018-03-20 | 达闼科技成都有限公司 | Information choosing method, device, electronic equipment and computer-readable recording medium |
Non-Patent Citations (1)
Title |
---|
(美)法沃尔著: "《RS-80微计算机驻机解释程序 LevelⅡ ROM剖析》", pages: 70 - 72 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113515486A (en) * | 2020-04-10 | 2021-10-19 | 华晨宝马汽车有限公司 | Method, system and computer readable medium for event double check |
CN113515486B (en) * | 2020-04-10 | 2024-03-08 | 华晨宝马汽车有限公司 | Method, system and computer readable medium for event duplication |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6914333B2 (en) | Blockchain-based product tracking methods and equipment | |
JP6963006B2 (en) | Data storage, data checking, and data concatenation methods and equipment | |
WO2018121319A1 (en) | Block data check method and apparatus | |
TW202002569A (en) | Blockchain-based data verification method and apparatus, and electronic device | |
CN107688899A (en) | Business process monitoring method and device | |
EP3652885B1 (en) | Secure token passing via blockchains | |
KR102085483B1 (en) | System, method and program for distributing food | |
Shibuya et al. | Privacy preserving visual SLAM | |
CN110704418A (en) | Block chain information query method, device and equipment | |
CN107218887A (en) | A kind of method and apparatus for being used to measure dimension of object | |
KR20170086497A (en) | Method and apparatus for identity information verification | |
CN108241795A (en) | A kind of method for identifying ID and device | |
CN112214518A (en) | Block chain-based geospatial basic data sharing method and system | |
US20200193430A1 (en) | Determining generation time for blockchain data | |
CN105825084B (en) | Method for carrying out matching detection to the object with image | |
CN109194483A (en) | Data verification method based on block chain | |
CN109979157A (en) | The rare tree monitoring of forest and early warning system | |
CN108846298A (en) | A kind of altering detecting method and relevant device of file content | |
CN110309669A (en) | A kind of data mask method, device and equipment | |
CN108399175A (en) | A kind of storage of data, querying method and its device | |
CN109508791A (en) | Vehicle damage management method | |
CN109582188A (en) | A kind of method, apparatus and relevant device for realizing the positioning of pop-up interior element | |
CN109639672A (en) | The method and system for preventing Replay Attack based on JWT data | |
CN107247279B (en) | There are the time difference system positioning correction methods under station site error | |
JP6755539B2 (en) | Methods and equipment for publishing copyrighted works on networks |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181120 |