CN107579829A - The endorsement method and device of compressed file bag - Google Patents
The endorsement method and device of compressed file bag Download PDFInfo
- Publication number
- CN107579829A CN107579829A CN201710637628.6A CN201710637628A CN107579829A CN 107579829 A CN107579829 A CN 107579829A CN 201710637628 A CN201710637628 A CN 201710637628A CN 107579829 A CN107579829 A CN 107579829A
- Authority
- CN
- China
- Prior art keywords
- compressed file
- file bag
- bag
- file
- change
- 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
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of endorsement method and device of compressed file bag.This method includes:The subfile that the subfile and the second compressed file bag included according to the first compressed file bag includes, determine that the first compressed file bag compares the change file of the second compressed file bag, the first compressed file bag obtains to be changed on the basis of the second compressed file bag;According to change file, the MF Summary files of the second compressed file bag are modified, obtain the MF Summary files of the first compressed file bag;According to the MF Summary files of the first compressed file bag, the SF certificate files of the first compressed file bag of generation, according to the RSA signature file of the SF certificate files of the first compressed file bag the first compressed file bag of generation.By avoiding the extraction to the summary of all subfiles in compressed file bag, the amount of calculation that is consumed when being signed so as to reduce to compressed file bag solves the problems, such as that compressed file packet signature process is longer.
Description
Technical field
The present invention relates to digital signature technology, more particularly to a kind of endorsement method and device of compressed file bag.
Background technology
Compressed file bag reduces the byte number of original, has saved memory space, facilitate by the way that original is compressed
File transmits.To ensure the security and integrality of compressed file bag, transmitting terminal is generally signed to compressed file bag, user
When receiving compressed file bag, the signature file of compressed file bag is also obtained.User can be determined by the checking to signature file
Compressed file bag is not tampered with.
In the prior art, the process signed to compressed file bag (or may be simply referred to as compressed package) mainly includes:First,
Each subfile in compressed file bag is traveled through, corresponding summary is calculated for each subfile, according to the text of each subfile
Part name and corresponding summarization generation Summary file Menifest.MF (being referred to as MF Summary files);Then, for Menifest.MF
In every record calculate its summary again, certificate file CERT.SF corresponding to generation (be referred to as SF certificate files);Finally, will
After record in CERT.SF is by private key encryption, obtain CERT.SF signature, will signature and public key together as RSA signature
File.Therefore, when any subfile in compressed file bag changes, corresponding to RSA signature file and SF certificate files
Also change.During applied software development, it is frequently present of according to business demand, original version compressed file bag is carried out
Minor modifications generate different editions compressed file bag to meet the situation of the needs of different user, or need to be directed to different download canals
Channel compressed package corresponding to road generation, and the situation for the subfile changed in compressed file bag.
It can be seen that, it is necessary to amended compression text after some or a few individual subfiles in compressed file bag is changed
Part bag is signed again, is obtained new RSA signature file, is caused signature process longer, add amount of calculation.
The content of the invention
The present invention provides a kind of endorsement method and device of compressed file bag, and compressed file bag is signed for reducing
When the amount of calculation that is consumed, while solve the problems, such as that signature process is longer.
On the one hand the embodiment of the present invention provides a kind of endorsement method of compressed file bag, the compressed file bag includes some
Individual subfile, this method include:
The subfile that the subfile and the second compressed file bag included according to the first compressed file bag includes, determines the first pressure
Contracting file bag compares the change file of the second compressed file bag, and the first compressed file bag is in the second compressed file bag
On the basis of change and obtain;
According to the change file, the MF Summary files of the second compressed file bag are modified, obtain described
The MF Summary files of one compressed file bag;
According to the MF Summary files of the first compressed file bag, the SF certificates for generating the first compressed file bag are literary
Part, the RSA signature file of the first compressed file bag is generated according to the SF certificate files of the first compressed file bag.
The endorsement method of compressed file bag as described above, it is described according to the MF of the first compressed file bag summary texts
Part, the SF certificate files of the first compressed file bag are generated, including:
According to the change file, the SF certificate files of the second compressed file bag are modified, after obtaining modification
The second compressed file bag SF certificate files;
According to the summary of the MF Summary files of the first compressed file bag, to the amended second compressed file bag
SF certificate files modify, obtain the SF certificate files of the first compressed file bag.
The endorsement method of compressed file bag as described above, it is described if the change type of the change file is newly-increased
The SF certificate files of the second compressed file bag are modified, obtain the SF certificates text of amended second compressed file bag
Part, including:
Increase the summary of the change file in the SF certificate files of the second compressed file bag, obtain amended
The SF certificate files of second compressed file bag;
If the change type of the change file is modification, the SF certificate files to the second compressed file bag
Modify, obtain the SF certificate files of amended second compressed file bag, including:
Using the summary of the change file, SF certificate text of the change file in the second compressed file bag is replaced
Corresponding summary in part, obtain the SF certificate files of amended second compressed file bag;
If the change type of the change file is deletes, the SF certificate files to the second compressed file bag
Modify, obtain the SF certificate files of amended second compressed file bag, including:
The change file corresponding summary in the SF certificate files of the second compressed file bag is deleted, is changed
The SF certificate files of the second compressed file bag afterwards.
The endorsement method of compressed file bag as described above, the SF certificate files according to the first compressed file bag
The RSA signature file of the first compressed file bag is generated, including:
The summary of the SF certificate files of the first compressed file bag is encrypted using default private key, generation described the
The RSA signature file of one compressed file bag.
The embodiment of the present invention also provides a kind of signature apparatus of compressed file bag, to perform above-mentioned compressed file bag
Endorsement method, has identical technical characteristic and technique effect, and the present invention repeats no more to this.
On the other hand the embodiment of the present invention provides a kind of signature apparatus of compressed file bag, if the compressed file bag includes
Dry subfile, the device include:
Change file determining module, for the subfile included according to the first compressed file bag and the second compressed file bag
The subfile included, determine that the first compressed file bag compares the change file of the second compressed file bag, the first compressed file bag
Obtained to be changed on the basis of the second compressed file bag;
Summary file modified module, for according to the change file, text of being made a summary to the MF of the second compressed file bag
Part is modified, and obtains the MF Summary files of the first compressed file bag;
Signature file generation module, for the MF Summary files according to the first compressed file bag, generation described first
The SF certificate files of compressed file bag, first compressed file is generated according to the SF certificate files of the first compressed file bag
The RSA signature file of bag.
The signature apparatus of compressed file bag as described above, the Summary file modified module are specifically used for,
According to the change file, the SF certificate files of the second compressed file bag are modified, after obtaining modification
The second compressed file bag SF certificate files;
According to the summary of the MF Summary files of the first compressed file bag, to the amended second compressed file bag
SF certificate files modify, obtain the SF certificate files of the first compressed file bag.
The signature apparatus of compressed file bag as described above, the Summary file modified module is specifically used for, if the change
The change type of more file is newly-increased, then increases the change file in the SF certificate files of the second compressed file bag
Summary, obtains the SF certificate files of amended second compressed file bag;
If the change type of the change file is modification, using the summary of the change file, the change is replaced
File corresponding summary in the SF certificate files of the second compressed file bag, obtains amended second compressed file bag
SF certificate files;
If the change type of the change file deletes the change file in the second compressed file bag to delete
SF certificate files in corresponding summary, obtain the SF certificate files of amended second compressed file bag.
The signature apparatus of compressed file bag as described above, the signature file generation module are specifically used for,
The summary of the SF certificate files of the first compressed file bag is encrypted using default private key, generation described the
The RSA signature file of one compressed file bag.
The embodiment of the present invention provides a kind of endorsement method of compressed file bag, and this method is included according to the first compressed file bag
Including the subfile that includes of subfile and the second compressed file bag, determine that the first compressed file bag compares the second compressed file bag
Change file, the first compressed file bag obtained to be changed on the basis of the second compressed file bag;According to change file, to
The MF Summary files of two compressed file bags are modified, and obtain the MF Summary files of the first compressed file bag;According to the first compression
The summary of the MF Summary files of file bag, the SF certificate files of the first compressed file bag are generated, according to first compressed file
The SF certificate files of bag generate the RSA signature file of the first compressed file bag.By according to the first compressed file bag and
The contrast of subfile in two compressed file bags obtains change file, in multiple subfiles that compressed file bag includes, to MF
The summary of change file carries out the modification of adaptability in Summary file, reduces the calculating time to the summary of non-change file,
The extraction to the summary of all subfiles in compressed file bag is avoided, so as to reduce when institute of being signed to compressed file bag
The amount of calculation of consumption, solve the problems, such as that compressed file packet signature process is longer, improve the efficiency of compressed file packet signature.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs
Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of the endorsement method for the compressed file bag that one embodiment of the invention provides;
Fig. 2 is the structural representation for the compressed file bag that one embodiment of the invention provides;
Fig. 3 is the schematic flow sheet of the endorsement method for the compressed file bag that another embodiment of the present invention provides;
Fig. 4 is the structural representation of the file in the endorsement method for the compressed file bag that one embodiment of the invention provides;
Fig. 5 is the structural representation of the signature apparatus for the compressed file bag that one embodiment of the invention provides.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
The endorsement method of compressed file bag provided by the invention is described in detail with reference to specific embodiment.
Fig. 1 is the schematic flow sheet of the endorsement method for the compressed file bag that one embodiment of the invention provides.This method is held
Row main body is the signature apparatus of compressed file bag, and the device can be realized by way of software or hardware, exemplary, the dress
It can be the terminal devices such as mobile phone, tablet personal computer, intelligent television to put, and the present invention is not limited this.As shown in figure 1, compression text
The endorsement method of part bag includes:
The subfile that S101, the subfile included according to the first compressed file bag and the second compressed file bag include, it is determined that
First compressed file bag compares the change file of the second compressed file bag.
Wherein, the first compressed file bag obtains to be changed on the basis of the second compressed file bag.
Exemplary, include several subfiles in the first compressed file and the second packet compression file bag.Second compression
File bag is original compression file bag, when user according to the actual requirements, such as version updating, the reason such as channel change, have modified pressure
During part subfile in contracting file bag, amended compressed file bag is referred to as the first compressed file bag.Show in compressed file bag
Example property generally includes software document and configuration file etc., and those file examples can be binary file.Compare first
The subfile that the subfile and the second compressed file bag that compressed file bag includes include, it is determined that the compression text modified
Part steamed stuffed bun file, referred to as change file.The optional change type that can also further determine that change file.
Optionally, the change type of change file is to increase, modify or delete.It is exemplary, change file can be
The increased subfile only included in the first compressed file bag on the basis of second compressed file bag.Change file can be
The subfile not included in the first compressed file bag deleted on the basis of second compressed file bag.Change file can be
After being modified on the basis of a certain subfile that second compressed file bag includes, obtain in the first compressed file bag
Comprising subfile, i.e. the subfile is included in the first compressed file bag and the second compressed file bag, but subfile content is sent out
Raw change.
Exemplary, Fig. 2 is the structural representation for the compressed file bag that one embodiment of the invention provides.As shown in Fig. 2 not
The second preceding compressed file bag of change includes subfile 1 to subfile 6.Exemplary, by the son in the second compressed file bag
File 1 is deleted, and the content in subfile 3 is modified, and adds subfile 7, has obtained the first compressed file bag.Cause
This, change file includes subfile 1, subfile 3 and subfile 7, and corresponding change type is respectively to delete, change and increase newly.
Exemplary, change file can be one or more.
Optionally, can be according to each Ziwen when determining change file according to the first compressed file bag and the second compressed file bag
Part identifies, and whether identical, be defined as change file if different, and change type is if comparing the content of mark identical subfile
Modification.It is newly-increased to be then defined as change file and change type for subfile present in only the first compressed file bag.For
Subfile present in only the second compressed file bag is then defined as change file and change type is deletion.Optionally, can also be straight
Connect using modes such as existing subfile/file comparison algorithms to determine change file and change type.
S102, according to change file, the MF Summary files of the second compressed file bag are modified, obtain the first compression text
The MF Summary files of part bag.
Exemplary, digest algorithm is a very important branch in cryptographic algorithm, is extracted from data source
Finger print information for distinguishing different data sources is designated as the summary of a data source.Data summarization algorithm is also referred to as Hash calculation
Method, hashing algorithm.It is exemplary, can use Message Digest Algorithm 5 (Message Digest Algorithm, MD5),
The various variants of SHA (Secure Hash Algorithm, SHA) and above-mentioned algorithm, from compressed file bag
Summary is extracted in each subfile.Exemplary, summary has the characteristics that:1) size regardless of source data, gets
The length of summary is to be fixed to.Such as the summary got using MD5 algorithms there are 128 bits, obtained using SHA-1 algorithms
The summary arrived has 160 bits;2) under normal circumstances, different data source, summary is different, identical data source, phase of making a summary
Together;3) digest calculations have irreversibility, i.e., can only be obtained and made a summary according to data source, and data can not be recovered from summary
Source.
It is as characterized above due to making a summary, therefore the MF Summary files of the first compressed file bag can be obtained, by the first compression
The MF Summary files of file bag and the first compressed file bag are supplied to the receiving terminal of compressed file bag.Receiving terminal is plucked using same
Algorithm is wanted to recalculate the summary of the first compressed file bag, whether compare the summary being calculated consistent with the summary received,
The compressed file Bao Wei that receives can be explained if consistent by malicious modification, have detected the integrality of compressed file bag.
Specifically, recorded in the MF Summary files of the second compressed file bag corresponding to each subfile in compressed file bag
Summary.Because the first compressed file bag is changed compared to the second compressed file bag only part subfile, therefore, the first compression
The MF Summary files of file bag equally only exist part change compared to the MF Summary files of the second compressed file bag.Can be by only counting
The summary mode for calculating change file reduces the mode of the summary for the All Files for recalculating the first compressed file bag, so as to save
Make an appointment consumption.
S103, the MF Summary files according to the first compressed file bag, generate the SF certificate files of the first compressed file bag, root
The RSA signature file of the first compressed file bag is generated according to the SF certificate files of the first compressed file bag.
Exemplary, can be according to the first compressed file bag after the MF Summary files of the first compressed file bag are got
MF Summary files, generate the first compressed file bag SF certificate files.The summary of MF Summary files is included in SF certificate files
And the summary of each subfile in MF Summary files.
If directly transmit SF certificate files corresponding to the first compressed file bag and the first compressed file bag, it is understood that there may be malice
User also have modified the situation of SF certificate files corresponding to the first compressed file bag while the first compressed file bag is changed.
Therefore, SF certificate files corresponding to the first compressed file bag can be signed.Optionally, can be corresponding to the first compressed file bag
The summaries of SF certificate files be encrypted.
Exemplary, cipher mode can be symmetric cryptography.The feed end of compressed file bag is provided and receives compression text
The receiving terminal of part bag is encrypted and decrypted the summary of SF certificate files corresponding to the first compressed file bag using the key of agreement.It is optional
, can be by the way of asymmetric encryption to reduce Signalling exchange:Signature and certificate.
The principle of asymmetric encryption it is exemplary be, there is provided the feed end of compressed file bag first has to generate a pair of public and private keys
It is right, there is provided the feed end of compressed file bag preserves private key, and the receiving terminal of compressed file bag receives public key.In feed end to receiving terminal
When sending compressed file bag, RSA signature file is also included in addition to compressed file bag.The generating mode bag of RSA signature file
Include:The summary of SF certificate files corresponding to the first compressed file bag is obtained, to SF certificate files corresponding to the first compressed file bag
Summary use private key encryption, obtain RSA signature file.And for the receiving terminal of compressed file bag, the packet received contains
Compressed file bag and RSA signature file to be verified.Receiving terminal can use and obtain pressure to be verified with transmitting terminal identical algorithm
The summary of the SF certificate files of contracting file bag, and the digital signature received is decrypted using the public key received, obtain
Decrypted result, the summary for comparing decrypted result and receiving terminal oneself extraction is compared, if unanimously, showing that compressed file bag is true
It is the compressed file bag that transmitting terminal is sent in fact, and content was not tampered with;On the contrary, if it is inconsistent, show compressed file
Gone wrong during bag transmission, compressed file bag is insincere.
Optionally, when the first compressed file bag has change file compared to the second compressed file bag, the first pressure can be obtained
RSA signature file corresponding to contracting file bag, the first compressed file bag, RSA signature file and public key are sent jointly into receiving terminal.
The embodiment of the present invention provides a kind of endorsement method of compressed file bag, and this method is included according to the first compressed file bag
Including the subfile that includes of subfile and the second compressed file bag, determine that the first compressed file bag compares the second compressed file bag
Change file, the first compressed file bag obtained to be changed on the basis of the second compressed file bag;According to change file, to
The MF Summary files of two compressed file bags are modified, and obtain the MF Summary files of the first compressed file bag;According to the first compression
The summary of the MF Summary files of file bag, the SF certificate files of the first compressed file bag are generated, according to first compressed file
The SF certificate files of bag generate the RSA signature file of the first compressed file bag.By according to the first compressed file bag and
The contrast of subfile in two compressed file bags obtains change file, in multiple subfiles that compressed file bag includes, to MF
The summary of change file carries out the modification of adaptability in Summary file, reduces the calculating time to the summary of non-change file,
The extraction to the summary of all subfiles in compressed file bag is avoided, so as to reduce when institute of being signed to compressed file bag
The amount of calculation of consumption, solve the problems, such as that compressed file packet signature process is longer, improve the efficiency of compressed file packet signature.
Optionally, on the basis of embodiment illustrated in fig. 1, the embodiment of the present application also provides a kind of signature of compressed file bag
Method, the acquisition process of the endorsement method of the compressed file bag in the present embodiment to the SF certificate files in embodiment illustrated in fig. 1
It is described in detail.Fig. 3 is the schematic flow sheet of the endorsement method for the compressed file bag that another embodiment of the present invention provides, and is such as schemed
Shown in 3, the endorsement method of the compressed file bag, including:
The subfile that S301, the subfile included according to the first compressed file bag and the second compressed file bag include, it is determined that
First compressed file bag compares the change file of the second compressed file bag.
Wherein, the first compressed file bag obtains to be changed on the basis of the second compressed file bag.
S302, according to change file, the MF Summary files of the second compressed file bag are modified, obtain the first compression text
The MF Summary files of part bag.
Corresponding, S101, S102 in S301, S302 and embodiment illustrated in fig. 1 are same or similar, the application to this no longer
Repeat.
S303, according to change file, the SF certificate files of the second compressed file bag are modified, obtain amended
The SF certificate files of two compressed file bags.
Exemplary, Fig. 4 is the structure of the file in the endorsement method for the compressed file bag that one embodiment of the invention provides
Schematic diagram.Reference picture 4, when being compressed file packet signature, the summary of each subfile in compressed file bag, such as son are obtained first
File 1 to subfile 6 summary.Again by the summary record of subfile 1 to subfile 6 in MF and SF.Also including MF in SF
Summary.Finally, then SF summary is obtained, and the private key provided according to the transmitting terminal of compressed file bag adds to SF summary
It is close, the signature of SF summary is obtained, by signature and public key together as RSA signature file.Compressed file bag receiving terminal is receiving
During compressed file bag, while receive compressed file bag, MF, SF and RSA.
Exemplary, when obtaining the first compressed file bag on the basis of the second compressed file bag, according to change file, obtain
Take the new summary of newly-increased and modification change file.On the MF and SF of the second compressed file bag, based on new summary and need
The summary to be deleted is modified, and obtains the MF of the first compressed file bag and the SF of amended second compressed file bag.Pass through
Change file is determined in the All Files of compressed file bag, avoids the digest calculations of the file to not changing, is saved
Time.
S304, the summary according to the MF Summary files of the first compressed file bag, to amended second compressed file bag
SF certificate files are modified, and obtain the SF certificate files of the first compressed file bag.
Exemplary, when obtaining the SF certificate files of the first compressed file bag, the MF of the first compressed file bag can be obtained
Summary, the MF of the first compressed file bag summary is replaced to the second old pressure in the SF of amended second compressed file bag
The MF of contracting file bag summary, and then obtain the SF of the first compressed file bag.The summary of MF in SF is usually located at MF files
Stem.
S305, the RSA signature file according to the SF certificate files of the first compressed file bag the first compressed file bag of generation.
Corresponding, S305 and the S103 in embodiment illustrated in fig. 1 are same or similar.
Exemplary, when compressed file bag receiving terminal installs compressed file bag, receiving terminal can be according to RSA signature file school
Whether correct test SF, after SF is verified successfully, verify MF further according to SF, the file in compressed file bag is finally verified according to MF,
Only all verifications by when, be just compressed file bag installation.
Exemplary, it is above-mentioned according to the difference of the change type of change file on the basis of embodiment illustrated in fig. 3
The SF certificate files to the second compressed file bag in S303 are modified, and obtain the SF cards of amended second compressed file bag
Written matter, including following possible implementation:
In a kind of feasible implementation, if the change type of change file is newly-increased, in the second compressed file bag
Increase the summary of change file in SF certificate files, obtain the SF certificate files of amended second compressed file bag.
Exemplary, reference picture 3 and Fig. 4, if the change type of change file is newly-increased, in the second compressed file bag
Increase the summary of change file in SF, obtain the SF of amended second compressed file bag.If file 7 is that change type is newly-increased
Change file, then directly in the SF of the second compressed file bag increase file 7 summary.
In another feasible implementation, if the change type of change file is modification, using plucking for change file
Will, change file corresponding summary in the SF certificate files of the second compressed file bag is replaced, obtains amended second
The SF certificate files of compressed file bag.
Exemplary, reference picture 3 and Fig. 4, if the change type of change file is modification, using plucking for change file
Will, change file corresponding summary in the SF of the second compressed file bag is replaced, obtains amended second compressed file bag
SF.If it is the change file changed that the ' of file 3, which is change type, original second directly can be replaced using the ' of file 3 summary and compressed
Record of the summary of file 3 in file bag in the SF of the second compressed file bag.
In another feasible implementation, if the change type of change file deletes change file the to delete
Corresponding summary in the SF certificate files of two compressed file bags, obtain the SF certificate files of amended second compressed file bag.
Exemplary, reference picture 3 and Fig. 4, if the change type of change file deletes change file second to delete
Corresponding summary in the SF files of compressed file bag, obtain the SF files of amended second compressed file bag.If file 1 is change
More type is the change file deleted, then directly in the SF files of the second compressed file bag, can directly delete the summary of file 1
Record.
Exemplary, on the basis of any of the above-described embodiment, generating the RSA signature file of the first compressed file bag
When, specifically it can use default private key that the summary of the MF Summary files of the first compressed file bag is encrypted, the compression of generation first
The RSA signature file of file bag.
The embodiment of the present invention also provides a kind of signature apparatus of compressed file bag, to perform above-mentioned compressed file bag
Endorsement method, has identical technical characteristic and technique effect, and the present invention repeats no more to this.
On the other hand the embodiment of the present invention provides a kind of signature apparatus of compressed file bag, Fig. 5 is one embodiment of the invention
The structural representation of the signature apparatus of the compressed file bag of offer.As shown in figure 5, the signature apparatus of compressed file bag includes:
Change file determining module 501, for the subfile included according to the first compressed file bag and the second compressed file
The subfile included, determine that the first compressed file bag compares the change file of the second compressed file bag, the first compressed file bag
Obtained to be changed on the basis of the second compressed file bag;
Summary file modified module 502, for according to change file, being carried out to the MF Summary files of the second compressed file bag
Modification, obtains the MF Summary files of the first compressed file bag;
Signature file generation module 503, for the MF Summary files according to the first compressed file bag, the compression text of generation first
The SF certificate files of part bag, the RSA signature text of the first compressed file bag is generated according to the SF certificate files of the first compressed file bag
Part.
Optionally, Summary file modified module 502 is specifically used for,
According to change file, the SF certificate files of the second compressed file bag are modified, obtain amended second pressure
The SF certificate files of contracting file bag;
According to the summary of the MF Summary files of the first compressed file bag, to the SF certificates of amended second compressed file bag
File is modified, and obtains the SF certificate files of the first compressed file bag.
Optionally, the change type of change file is to increase, modify or delete.
Optionally, if the change type of change file is newly-increased, increase in the SF certificate files of the second compressed file bag
Add the summary of change file, obtain the SF certificate files of amended second compressed file bag;
If the change type of change file is modification, using the summary of change file, change file is replaced in the second pressure
Corresponding summary in the SF certificate files of contracting file bag, obtain the SF certificate files of amended second compressed file bag;
If the change type of change file deletes SF certificate file of the change file in the second compressed file bag to delete
In corresponding summary, obtain the SF certificate files of amended second compressed file bag.
Optionally, signature file generation module 503 is specifically used for, and the SF of the first compressed file bag is demonstrate,proved using default private key
The summary of written matter is encrypted, and generates the RSA signature file of the first compressed file bag.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, execution the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, either which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.
Claims (8)
1. a kind of endorsement method of compressed file bag, the compressed file bag include several subfiles, it is characterised in that the party
Method includes:
The subfile that the subfile and the second compressed file bag included according to the first compressed file bag includes, determine the first compression text
Part bag compares the change file of the second compressed file bag, and the first compressed file bag is the base in the second compressed file bag
Change obtains on plinth;
According to the change file, the MF Summary files of the second compressed file bag are modified, obtain first pressure
The MF Summary files of contracting file bag;
According to the MF Summary files of the first compressed file bag, the SF certificate files of generation the first compressed file bag, root
The RSA signature file of the first compressed file bag is generated according to the SF certificate files of the first compressed file bag.
2. according to the method for claim 1, it is characterised in that described according to the MF of the first compressed file bag summary texts
Part, the SF certificate files of the first compressed file bag are generated, including:
According to the change file, the SF certificate files of the second compressed file bag are modified, obtain amended
The SF certificate files of two compressed file bags;
According to the summary of the MF Summary files of the first compressed file bag, to the SF of the amended second compressed file bag
Certificate file is modified, and obtains the SF certificate files of the first compressed file bag.
3. according to the method for claim 2, it is characterised in that if the change type of the change file is newly-increased, institute
State and the SF certificate files of the second compressed file bag are modified, obtain the SF certificates of amended second compressed file bag
File, including:
Increase the summary of the change file in the SF certificate files of the second compressed file bag, obtain described amended
The SF certificate files of second compressed file bag;
If the change type of the change file is modification, the SF certificate files to the second compressed file bag are carried out
Modification, obtains the SF certificate files of amended second compressed file bag, including:
Using the summary of the change file, the change file is replaced in the SF certificate files of the second compressed file bag
Corresponding summary, obtain the SF certificate files of the amended second compressed file bag;
If the change type of the change file is deletes, the SF certificate files to the second compressed file bag are carried out
Modification, obtains the SF certificate files of amended second compressed file bag, including:
The change file corresponding summary in the SF certificate files of the second compressed file bag is deleted, obtains the modification
The SF certificate files of the second compressed file bag afterwards.
4. according to the method described in any one of claims 1 to 3, it is characterised in that described according to the first compressed file bag
SF certificate files generate the RSA signature file of the first compressed file bag, including:
The summary of the SF certificate files of the first compressed file bag is encrypted using default private key, generation first pressure
The RSA signature file of contracting file bag.
5. a kind of signature apparatus of compressed file bag, the compressed file bag include several subfiles, it is characterised in that bag
Include:
Change file determining module, include for the subfile included according to the first compressed file bag and the second compressed file bag
Subfile, determine the first compressed file bag compare the second compressed file bag change file, the first compressed file bag be
Change and obtain on the basis of the second compressed file bag;
Summary file modified module, for according to the change file, entering to the MF Summary files of the second compressed file bag
Row modification, obtains the MF Summary files of the first compressed file bag;
Signature file generation module, for the MF Summary files according to the first compressed file bag, generation first compression
The SF certificate files of file bag, the first compressed file bag is generated according to the SF certificate files of the first compressed file bag
RSA signature file.
6. device according to claim 5, it is characterised in that the Summary file modified module is specifically used for,
According to the change file, the SF certificate files of the second compressed file bag are modified, obtain amended
The SF certificate files of two compressed file bags;
According to the summary of the MF Summary files of the first compressed file bag, to the SF of the amended second compressed file bag
Certificate file is modified, and obtains the SF certificate files of the first compressed file bag.
7. device according to claim 6, it is characterised in that the Summary file modified module is specifically used for, if described
The change type of change file is newly-increased, then increases the change file in the SF certificate files of the second compressed file bag
Summary, obtain the SF certificate files of the amended second compressed file bag;
If the change type of the change file is modification, using the summary of the change file, the change file is replaced
The corresponding summary in the SF certificate files of the second compressed file bag, obtain the amended second compressed file bag
SF certificate files;
If the change type of the change file deletes SF of the change file in the second compressed file bag to delete
Corresponding summary in certificate file, obtain the SF certificate files of amended second compressed file bag.
8. according to the device described in any one of claim 5 to 7, it is characterised in that the signature file generation module is specifically used
In,
The summary of the SF certificate files of the first compressed file bag is encrypted using default private key, generation first pressure
The RSA signature file of contracting file bag.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710637628.6A CN107579829A (en) | 2017-07-31 | 2017-07-31 | The endorsement method and device of compressed file bag |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710637628.6A CN107579829A (en) | 2017-07-31 | 2017-07-31 | The endorsement method and device of compressed file bag |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107579829A true CN107579829A (en) | 2018-01-12 |
Family
ID=61035331
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710637628.6A Pending CN107579829A (en) | 2017-07-31 | 2017-07-31 | The endorsement method and device of compressed file bag |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107579829A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140032927A1 (en) * | 2008-05-30 | 2014-01-30 | Adobe Systems Incorporated | Archiving electronic content having digital signatures |
CN105574369A (en) * | 2015-12-14 | 2016-05-11 | 网易(杭州)网络有限公司 | Method, device and system for re-signing application program |
CN106126205A (en) * | 2016-06-14 | 2016-11-16 | 武汉斗鱼网络科技有限公司 | The rapid batch of a kind of Android program installation kit generates method and system |
CN106843843A (en) * | 2016-12-23 | 2017-06-13 | 光锐恒宇(北京)科技有限公司 | Installation kit Mass production method and device |
CN106843939A (en) * | 2016-12-30 | 2017-06-13 | 百度在线网络技术(北京)有限公司 | The generation method and device of the channel bag of application |
-
2017
- 2017-07-31 CN CN201710637628.6A patent/CN107579829A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140032927A1 (en) * | 2008-05-30 | 2014-01-30 | Adobe Systems Incorporated | Archiving electronic content having digital signatures |
CN105574369A (en) * | 2015-12-14 | 2016-05-11 | 网易(杭州)网络有限公司 | Method, device and system for re-signing application program |
CN106126205A (en) * | 2016-06-14 | 2016-11-16 | 武汉斗鱼网络科技有限公司 | The rapid batch of a kind of Android program installation kit generates method and system |
CN106843843A (en) * | 2016-12-23 | 2017-06-13 | 光锐恒宇(北京)科技有限公司 | Installation kit Mass production method and device |
CN106843939A (en) * | 2016-12-30 | 2017-06-13 | 百度在线网络技术(北京)有限公司 | The generation method and device of the channel bag of application |
Non-Patent Citations (1)
Title |
---|
西青年: "Android签名与认证详细分析之一(CERT.RSA剖析)", 《CSDN》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107194242B (en) | Firmware upgrade method and device | |
CN111382463B (en) | Block chain system and method based on stream data | |
US9537657B1 (en) | Multipart authenticated encryption | |
CN111131278B (en) | Data processing method and device, computer storage medium and electronic equipment | |
CN106067874B (en) | It is a kind of by the method for data record to server end, terminal and server | |
CN105391717A (en) | APK signature authentication method and APK signature authentication system | |
CN101626293B (en) | Method for encryption protection and decryption of data | |
CN108830096B (en) | Data processing method and device, electronic equipment and storage medium | |
CN108710500A (en) | Resource issuing method, update method and device | |
CN102083055A (en) | IMEI (International Mobile Equipment Identity) authentication method, IMEI-protecting mobile communication terminal and initializing device thereof | |
US7962765B2 (en) | Methods and systems for tamper resistant files | |
CN109214146A (en) | The endorsement method of application software, sign test method and apparatus | |
CN112202779B (en) | Block chain based information encryption method, device, equipment and medium | |
CN110601848A (en) | Appointment information processing method, device and system based on block chain and electronic equipment | |
CN114900304A (en) | Digital signature method and apparatus, electronic device, and computer-readable storage medium | |
CN101174941B (en) | Off-line digital copyright protection method and device for mobile terminal document | |
CN109657497A (en) | Secure file system and its method | |
CN117044160A (en) | Partial authentication mark aggregation supporting interleaved encryption and authentication operations over multiple data records | |
CN113326525A (en) | Data processing method and device based on intelligent contract | |
WO2007109373A2 (en) | Recording over the key in otp encryption | |
JP2003143139A (en) | Program and method for storing and verifying digital data | |
WO2020259056A1 (en) | Bill management method and system and computer readable storage medium | |
CN109657502A (en) | A kind of SATA bridge based on domestic cryptographic algorithm connects real-time Transmission encryption system and method | |
CN107579829A (en) | The endorsement method and device of compressed file bag | |
CN114844716A (en) | Digital signature message processing method, device, equipment and computer medium |
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 |
Application publication date: 20180112 |
|
RJ01 | Rejection of invention patent application after publication |