CN103034815A - Detection method and device for portable document format (PDF) file - Google Patents

Detection method and device for portable document format (PDF) file Download PDF

Info

Publication number
CN103034815A
CN103034815A CN2011103001568A CN201110300156A CN103034815A CN 103034815 A CN103034815 A CN 103034815A CN 2011103001568 A CN2011103001568 A CN 2011103001568A CN 201110300156 A CN201110300156 A CN 201110300156A CN 103034815 A CN103034815 A CN 103034815A
Authority
CN
China
Prior art keywords
pdf document
encryption
document
file
module
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.)
Granted
Application number
CN2011103001568A
Other languages
Chinese (zh)
Other versions
CN103034815B (en
Inventor
康怡暖
张立业
孙雯文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University Founder Group Co Ltd
Priority to CN201110300156.8A priority Critical patent/CN103034815B/en
Publication of CN103034815A publication Critical patent/CN103034815A/en
Application granted granted Critical
Publication of CN103034815B publication Critical patent/CN103034815B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a detection method for a portable document format (PDF) file. The detection method comprises the following steps of: monitoring a new PDF file created in a target folder; judging whether an encrypted information field in the PDF file is in line with an encryption standard or not; if the encrypted information field is in line with the encryption standard, further acquiring a decrypted file corresponding to the PDF file; and judging whether the decrypted file is correct or not to judge whether the PDF file is correctly encrypted or not. The invention provides a detection device for the PDF file. The detection device comprises a monitoring module, a field judgment module, an acquisition module and a decryption judgment module, wherein the monitoring module is used for monitoring the new PDF file created in the target folder; the field judgment module is used for judging whether the encrypted information field in the PDF file is in line with the encryption standard or not; the acquisition module is used for further acquiring the decrypted file corresponding to the PDF file if the encrypted information field is in line with the encryption standard; and the decryption judgment module is used for judging whether the decrypted file is correct or not to judge whether the PDF file is correctly encrypted or not. The encryption and the decryption of the PDF file are automatically tested.

Description

The detection method and the device that are used for pdf document
Technical field
The present invention relates to the work flow before printing technical field, in particular to a kind of detection method for pdf document and device.
Background technology
In the prior art, in the work flow before printing based on pdf document, for the consideration of security, the pdf document that generates in the processing procedure tends to be encrypted by modes such as encryption locks.Unavoidably also to be decrypted aftertreatment to encrypting pdf document in the flow process, as generating preview graph, the operation such as flying in advance.Whether the encryption of checking pdf document correctly is a very important content measurement for the tester, and main content measurement comprises:
1 in the situation that do not install that any Acrobat deciphering plug-in unit is manual opens the encryption pdf document, if can't open, and then file encryption success; If can open, then file encryption lost efficacy.
Whether generate the JPG preview graph after the 2 retrieval pdf document deciphering, judge the correctness of file encryption by JPG preview map generalization.
Above test prerequisite is the source file that uses in the test process in the situation that without encryption lock, and is correct by normalizer kernel explanation results.
Summary of the invention
The present invention aims to provide a kind of detection method for pdf document and device, to solve the problem that adds density test of pdf document.
In an embodiment of the present invention, provide a kind of detection method for pdf document, having comprised: the new pdf document that produces in the monitoring objective file; Judge whether the enciphered message field in the pdf document meets encryption standard; If meet, then further obtain the corresponding declassified document of pdf document; By judging whether declassified document is correct, whether correct with the encryption of determining pdf document.
In an embodiment of the present invention, provide a kind of pick-up unit for pdf document, having comprised: monitoring module is used for the new pdf document that the monitoring objective file produces; The field judge module is used for judging whether the enciphered message field of pdf document meets encryption standard; Acquisition module if be used for meeting, then further obtains the corresponding declassified document of pdf document; Whether the deciphering judge module is used for by judging whether declassified document is correct, correct with the encryption of determining pdf document.
The detection method and the device that are used for pdf document of the above embodiment of the present invention have been realized the automatic test that pdf document is encrypted.
Description of drawings
Accompanying drawing described herein is used to provide a further understanding of the present invention, consists of the application's a part, and illustrative examples of the present invention and explanation thereof are used for explaining the present invention, do not consist of improper restriction of the present invention.In the accompanying drawings:
Fig. 1 shows the process flow diagram according to the detection method that is used for pdf document of the embodiment of the invention;
Fig. 2 shows the process flow diagram that is used for according to the preferred embodiment of the invention the detection method of pdf document;
Fig. 3 shows the schematic diagram according to the pick-up unit that is used for pdf document of the embodiment of the invention.
Embodiment
Below with reference to the accompanying drawings and in conjunction with the embodiments, describe the present invention in detail.
Fig. 1 shows the process flow diagram according to the detection method that is used for pdf document of the embodiment of the invention, comprising:
Step S10, the new pdf document that produces in the monitoring objective file;
Step S20 judges whether the enciphered message field in the pdf document meets encryption standard;
Step S30 if meet, then further obtains the corresponding declassified document of pdf document;
Step S40, whether correct by judging declassified document, whether correct with the encryption of determining pdf document.
Because the result who encrypts by encryption lock is not identical to each pdf document, if whether the checking encrypted result is accurate, need a large amount of file of test just can obtain metastable conclusion.When test file quantity was a lot, if test with artificial method, it is very low that the efficient of test can become, and accuracy also can reduce.And in the present embodiment, a testing process is provided, can realize this testing process by computer programming, for example come execution in step S10 with the monitoring function, come execution in step S20 with regular expression, come execution in step S30 with the flow process control algolithm, come execution in step S40 with judgement statement and documentation function etc., thereby can automatically realize the density test that adds of pdf document in enormous quantities.This can improve the efficient that seal pre-treatment flow process File adds density test, the resource that saves manpower and time, the hit rate of increase defective.
Preferably, before step S20, also comprise:
The reading out data table;
Judge that whether putting down in writing pdf document in the tables of data processed;
If record was processed, then ignore pdf document;
Otherwise, continue execution in step S20.
Preferably, after the step S20, also comprise:
If there is no the enciphered message field is then determined the pdf document unencryption, and will be determined that outcome record is in tables of data;
If the form of enciphered message field does not meet encryption standard, then determine pdf document encryption mistake, and will determine that outcome record (is and processes) in tables of data;
If the form of enciphered message field meets encryption standard, then recording of encrypted character string and judged result in tables of data.
Prior art need to manually be filled in certain test record, and the statistics of test result is very inconvenient.Above preferred embodiment adopts tables of data to put down in writing the disposition of pdf document, thereby can the history of forming record, can provide intuitively test report, is conducive to carry out that daily record is consulted etc., helps the tester to carry out extensive compatibility test.Can also deposit the attributes such as file name, size, time in tables of data, storage file does not carry out re-treatment.For tables of data, can provide the functions such as printing, preservation, transmission mail.
Whether preferably, step S30 comprises: obtain the preview graph file with filename corresponding with the filename of pdf document, for example, search with pdf document JPG file of the same name and exist.When the PDF interpreter generates PDF, generally all to generate the JPG preview graph for checking, generation JPG preview graph must be decrypted the encryption pdf document that generates first and read, if encrypt when invalid or wrong, this preview graph can generate scarcely, therefore, utilize this characteristic, whether the JPG preview graph generates and can be used as test file and whether encrypt correct important evidence.By the detection to the preview graph file, can determine whether the encryption of pdf document is correct.The preferred embodiment is fairly simple, easily realizes.
Preferably, step S40 comprises:
If the preview graph file exists, its creation-time is later than the creation-time of pdf document, and its file size is non-vanishing, determines that then the pdf document encryption is correct;
If above-mentioned arbitrary condition does not satisfy, then determine pdf document encryption mistake.
Above-mentioned condition judgment process can realize with some very simple documentation functions, thereby be easy to carry out computer programming.
Fig. 2 shows the process flow diagram that is used for according to the preferred embodiment of the invention the detection method of pdf document, comprises the steps:
Step S202, monitoring scanning is encrypted pdf document and is generated catalogue;
Step S204, when the monitoring folder content changes, be that new encryption pdf document is when producing, judge whether file is untreated new pdf document, when the pdf document that gets access to processed out-of-date, in tables of data, can get access to corresponding record, then no longer continue to process this document, continue the scanning document catalogue;
Step S206 when the pdf document that gets access to is untreated, opens pdf document stream, obtains the enciphered message field that records in the pdf document;
Step S208 judges whether the enciphered message field exists;
Step S210, the enciphered message field of pdf document if there is no then no longer continues to process this document, directly record pdf document unencryption in tables of data;
Step S212 if the enciphered message field of pdf document exists, judges further then whether the form of enciphered message field meets encryption standard;
Step S214 if do not meet, then determines the file encryption mistake, and judged result is recorded in the tables of data;
Step S216, if pdf document enciphered message field meets standard, then log file encrypted characters sequence and judged result in tables of data;
Step S218, search the JPG file of the same name with pdf document, such as pdf document title [407_ZBA05705C_ps_p0001_b30.pdf], corresponding JPG preview graph file of the same name [407_ZBA05705C_ps_p0001_b30_Pre.jpg] [407_ZBA05705C_ps_p0001_b30_Tmb.jpg];
Step S214, if JPG preview graph file does not exist, then log file is encrypted mistake in tables of data.
Step S220, if JPG preview graph file exists, and size be not 0K, log file is encrypted correctly in tables of data.
Step S222, above test result all is recorded in the tables of data, can print or sends mail to the dependence test personnel as annex.
Fig. 3 shows the schematic diagram according to the pick-up unit that is used for pdf document of the embodiment of the invention, comprising:
Monitoring module 10 is used for the new pdf document that the monitoring objective file produces;
Field judge module 20 is used for judging whether the enciphered message field of pdf document meets encryption standard;
Acquisition module 30 if be used for meeting, then further obtains the corresponding declassified document of pdf document;
Whether deciphering judge module 40 is used for by judging whether declassified document is correct, correct with the encryption of determining pdf document.
Preferably, this device also comprises:
Read module is used for the reading out data table;
Process judge module, be used for judging whether tables of data is put down in writing pdf document and processed;
Ignore module, processed if be used for record, then ignore pdf document;
Calling module is used for otherwise calls the field judge module.
Preferably, this device also comprises:
The first module is used for if there is no enciphered message field, then determines the pdf document unencryption, and will determine that outcome record is in tables of data;
The second module does not meet encryption standard if be used for the form of enciphered message field, then determines pdf document encryption mistake, and will determine that outcome record is in tables of data;
The 3rd module meets encryption standard if be used for the form of enciphered message field, then recording of encrypted character string and judged result in tables of data.
Preferably, acquisition module obtains the preview graph file with filename corresponding with the filename of pdf document.
Preferably, if deciphering judge module preview graph file exists, its creation-time is later than the creation-time of pdf document, and its file size is non-vanishing, determines that then the pdf document encryption is correct; If above-mentioned arbitrary condition does not satisfy, then determine pdf document encryption mistake.
As can be seen from the above description, the present invention has improved PDF and has encrypted the efficient of correctness test, and can provide intuitively test report.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the memory storage and be carried out by calculation element, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a detection method that is used for pdf document is characterized in that, comprising:
The new pdf document that produces in the monitoring objective file;
Judge whether the enciphered message field in the described pdf document meets encryption standard;
If meet, then further obtain the corresponding declassified document of described pdf document;
By judging whether described declassified document is correct, whether correct with the encryption of determining described pdf document.
2. method according to claim 1 is characterized in that, the enciphered message field in judging described pdf document also comprises before whether meeting encryption standard:
The reading out data table;
Judge that whether putting down in writing described pdf document in the described tables of data processed;
If record was processed, then ignore described pdf document;
Otherwise the continuation execution is described judges whether the enciphered message field in the described pdf document meets the step of encryption standard.
3. method according to claim 2 is characterized in that, judges whether the enciphered message field in the described pdf document meets after the encryption standard, also comprises:
If there is no described enciphered message field is then determined described pdf document unencryption, and will be determined that outcome record is in described tables of data;
If the form of described enciphered message field does not meet encryption standard, then determine described pdf document encryption mistake, and will determine that outcome record is in described tables of data;
If the form of described enciphered message field meets encryption standard, then recording of encrypted information field and judged result in described tables of data.
4. method according to claim 3 is characterized in that, obtains the corresponding declassified document of described pdf document and comprises:
Obtain the preview graph file with filename corresponding with the filename of described pdf document.
5. method according to claim 4 is characterized in that, judges whether described declassified document correctly comprises:
If described preview graph file exists, its creation-time is later than the creation-time of described pdf document, and its file size is non-vanishing, determines that then described pdf document encryption is correct;
If above-mentioned arbitrary condition does not satisfy, then determine described pdf document encryption mistake.
6. a pick-up unit that is used for pdf document is characterized in that, comprising:
Monitoring module is used for the new pdf document that the monitoring objective file produces;
The field judge module is used for judging whether the enciphered message field of described pdf document meets encryption standard;
Acquisition module if be used for meeting, then further obtains the corresponding declassified document of described pdf document;
Whether the deciphering judge module is used for by judging whether described declassified document is correct, correct with the encryption of determining described pdf document.
7. device according to claim 6 is characterized in that, also comprises:
Read module is used for the reading out data table;
Process judge module, be used for judging whether described tables of data is put down in writing described pdf document and processed;
Ignore module, processed if be used for record, then ignore described pdf document;
Calling module is used for otherwise calls described field judge module.
8. device according to claim 7 is characterized in that, also comprises:
The first module is used for if there is no described enciphered message field, then determines described pdf document unencryption, and will determine that outcome record is in described tables of data;
The second module does not meet encryption standard if be used for the form of described enciphered message field, then determines described pdf document encryption mistake, and will determine that outcome record is in described tables of data;
The 3rd module meets encryption standard if be used for the form of described enciphered message field, then recording of encrypted information field and judged result in described tables of data.
9. device according to claim 8 is characterized in that, described acquisition module obtains the preview graph file with filename corresponding with the filename of described pdf document.
10. device according to claim 9 is characterized in that, if the described preview graph file of described deciphering judge module exists, its creation-time is later than the creation-time of described pdf document, and its file size is non-vanishing, determines that then described pdf document encryption is correct; If above-mentioned arbitrary condition does not satisfy, then determine described pdf document encryption mistake.
CN201110300156.8A 2011-09-30 2011-09-30 Detection method and device for portable document format (PDF) file Expired - Fee Related CN103034815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110300156.8A CN103034815B (en) 2011-09-30 2011-09-30 Detection method and device for portable document format (PDF) file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110300156.8A CN103034815B (en) 2011-09-30 2011-09-30 Detection method and device for portable document format (PDF) file

Publications (2)

Publication Number Publication Date
CN103034815A true CN103034815A (en) 2013-04-10
CN103034815B CN103034815B (en) 2015-07-22

Family

ID=48021701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110300156.8A Expired - Fee Related CN103034815B (en) 2011-09-30 2011-09-30 Detection method and device for portable document format (PDF) file

Country Status (1)

Country Link
CN (1) CN103034815B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750675A (en) * 2015-04-01 2015-07-01 山东省计算中心(国家超级计算济南中心) Identification method for encrypted file of unknown format
CN108038441A (en) * 2017-12-07 2018-05-15 庞军良 A kind of System and method for based on image recognition
CN109767516A (en) * 2018-12-14 2019-05-17 北京摩拜科技有限公司 Log setting and Method of printing, setting and printing device and log system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050289639A1 (en) * 2004-06-23 2005-12-29 Leung Wai K System and method of securing the management of documentation
CN1770051A (en) * 2004-11-04 2006-05-10 华为技术有限公司 File safety detection method
CN101051339A (en) * 2007-05-24 2007-10-10 炬力集成电路设计有限公司 File protection method and its device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050289639A1 (en) * 2004-06-23 2005-12-29 Leung Wai K System and method of securing the management of documentation
CN1770051A (en) * 2004-11-04 2006-05-10 华为技术有限公司 File safety detection method
CN101051339A (en) * 2007-05-24 2007-10-10 炬力集成电路设计有限公司 File protection method and its device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
龙飞宇等: "基于文件系统过滤驱动的文件标识研究", 《通信技术》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750675A (en) * 2015-04-01 2015-07-01 山东省计算中心(国家超级计算济南中心) Identification method for encrypted file of unknown format
CN104750675B (en) * 2015-04-01 2017-09-26 山东省计算中心(国家超级计算济南中心) A kind of unknown format encrypts the recognition methods of file
CN108038441A (en) * 2017-12-07 2018-05-15 庞军良 A kind of System and method for based on image recognition
CN108038441B (en) * 2017-12-07 2021-03-16 潘晓梅 System and method based on image recognition
CN109767516A (en) * 2018-12-14 2019-05-17 北京摩拜科技有限公司 Log setting and Method of printing, setting and printing device and log system

Also Published As

Publication number Publication date
CN103034815B (en) 2015-07-22

Similar Documents

Publication Publication Date Title
US8166313B2 (en) Method and apparatus for dump and log anonymization (DALA)
CN112217835B (en) Message data processing method and device, server and terminal equipment
US8874932B2 (en) Method for order invariant correlated encrypting of data and SQL queries for maintaining data privacy and securely resolving customer defects
CN106874461A (en) A kind of workflow engine supports multi-data source configuration security access system and method
CN109522328B (en) Data processing method and device, medium and terminal thereof
CN114444033A (en) Data security protection system and method based on Internet of things
CN103647636B (en) The method and device of security access data
CN109376133A (en) File access method and file access system
CN112685436B (en) Tracing information processing method and device
CN112329042A (en) Big data secure storage system and method
CN103745166A (en) Method and device for inspecting file attribute value
Actoriano et al. Forensic Investigation on WhatsApp Web Using Framework Integrated Digital Forensic Investigation Framework Version 2
CN110378134A (en) A kind of mixed cloud information protection and stream compression tracking based on label
CN103034815B (en) Detection method and device for portable document format (PDF) file
CN107423583A (en) A kind of software protecting device remapping method and device
CN113987581A (en) Method for data security protection and traceability check of intelligent security community platform
CN109088872A (en) Application method, device, electronic equipment and the medium of cloud platform with service life
CN110493011B (en) Block chain-based certificate issuing management method and device
CN114925337B (en) Data labeling method and device and electronic equipment
CN106612283A (en) Method and device for identifying source of downloaded file
CN115033900A (en) Block chain-based electronic data evidence obtaining method and system
CN111949476A (en) Lightweight method and system for monitoring business health degree in APP in real time
CN111934949A (en) Safety test system based on database injection test
CN108075932A (en) A kind of data monitoring method and device
Degitz et al. Access Pattern Confidentiality-Preserving Relational Databases: Deployment Concept and Efficiency Evaluation.

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150722

Termination date: 20190930

CF01 Termination of patent right due to non-payment of annual fee