CN103034815B - 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
CN103034815B
CN103034815B CN201110300156.8A CN201110300156A CN103034815B CN 103034815 B CN103034815 B CN 103034815B CN 201110300156 A CN201110300156 A CN 201110300156A CN 103034815 B CN103034815 B CN 103034815B
Authority
CN
China
Prior art keywords
pdf document
file
encryption
module
document
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.)
Expired - Fee Related
Application number
CN201110300156.8A
Other languages
Chinese (zh)
Other versions
CN103034815A (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

Landscapes

  • Storage Device Security (AREA)

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

For detection method and the device of pdf document
Technical field
The present invention relates to work flow before printing technical field, in particular to a kind of detection method for pdf document and device.
Background technology
In prior art, based in the work flow before printing of pdf document, for the consideration of security, the pdf document generated in processing procedure is often encrypted by modes such as encryption locks.Unavoidably in flow process also to be decrypted aftertreatment to encryption pdf document, as generated preview graph, the operation such as flying in advance.For tester, verify whether pdf document encryption is correctly a very important content measurement, and main content measurement comprises:
1 opens encryption pdf document by hand when not installing any Acrobat deciphering plug-in unit, if cannot open, then and file encryption success; If can open, then file encryption lost efficacy.
Whether generate JPG preview graph after 2 retrieval pdf document deciphering, judged the correctness of file encryption by JPG preview map generalization.
More than test prerequisite be the source file that uses in test process when without encryption lock, 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 adding density test of pdf document.
In an embodiment of the present invention, provide a kind of detection method for pdf document, comprising: the new pdf document produced in monitoring objective file; Judge whether the enciphered message field in pdf document meets encryption standard; If met, then obtain the declassified document corresponding to pdf document further; By judging that whether declassified document is correct, whether correct to determine the encryption of pdf document.
In an embodiment of the present invention, provide a kind of pick-up unit for pdf document, comprising: monitoring module, for the new pdf document produced in monitoring objective file; Field judge module, for judging whether the enciphered message field in pdf document meets encryption standard; Acquisition module, if for meeting, then obtains the declassified document corresponding to pdf document further; Deciphering judge module, for by judging that whether declassified document is correct, whether correct to determine the encryption of pdf document.
The detection method for pdf document of the above embodiment of the present invention and device, achieve the automatic test to pdf document encryption.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, and form a application's part, schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 shows the process flow diagram of the detection method for pdf document according to the embodiment of the present invention;
Fig. 2 shows according to the preferred embodiment of the invention for the process flow diagram of the detection method of pdf document;
Fig. 3 shows the schematic diagram of the pick-up unit for pdf document according to the embodiment of the present 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 of the detection method for pdf document according to the embodiment of the present invention, comprising:
Step S10, the new pdf document produced in monitoring objective file;
Step S20, judges whether the enciphered message field in pdf document meets encryption standard;
Step S30, if met, then obtains the declassified document corresponding to pdf document further;
Whether step S40 is by judging that whether declassified document is correct, correct to determine the encryption of pdf document.
Because the result of being encrypted by encryption lock is not identical to each pdf document, if will verify that whether encrypted result is accurate, need a large amount of file of test just can obtain metastable conclusion.When test file quantity is a lot, if tested by artificial method, the efficiency of test can become very low, and accuracy also can reduce.And in the present embodiment, provide a testing process, this testing process can be realized by computer programming, such as perform step S10 with monitoring function, step S20 is performed with regular expression, perform step S30 with Row control algorithm, with judging statement and documentation function etc. to perform step S40, thus automatically can realize pdf document in enormous quantities add density test.This can improve the efficiency that prepress treatment flow process file adds density test, and save manpower and time resource, increases the hit rate of defect.
Preferably, before step S20, also comprise:
Read tables of data;
Judge in tables of data, whether to record pdf document processed;
If record processed, then ignore pdf document;
Otherwise, continue to perform step S20.
Preferably, after step S20, also comprise:
If there is no enciphered message field, then determine pdf document unencryption, and be recorded in tables of data by determination result;
If the form of enciphered message field does not meet encryption standard, then determine pdf document encryption errors, and determination result is recorded in tables of data and (is processed);
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 needs manually to fill in certain test record, and the statistics of test result is very inconvenient.Above preferred embodiment adopts tables of data to record the disposition of pdf document, thus can history of forming record, can provide test report intuitively, be conducive to carrying out daily record and consult, help tester to carry out extensive compatibility test.Can also by attributes such as file name, size, times stored in tables of data, storage file does not carry out re-treatment.For tables of data, printing, preservation can be provided, send the functions such as mail.
Whether preferably, step S30 comprises: obtain the preview graph file with the filename corresponding with the filename of pdf document, such as, search the JPG file of the same name with pdf document and exist.While PDF interpreter generates PDF, the general JPG preview graph that all will generate is for inspection, generate JPG preview graph and first must be decrypted reading to the encryption pdf document generated, if when encrypting invalid or wrong, this preview graph can generate scarcely, therefore, utilize this characteristic, whether whether JPG preview graph generates can be encrypted correct important evidence as test file.By the detection to preview graph file, can determine that whether the encryption of pdf document is correct.The preferred embodiment is fairly simple, easily realizes.
Preferably, step S40 comprises:
If preview graph file exists, its creation-time is later than the creation-time of pdf document, and its file size is non-vanishing, then determine that pdf document encryption is correct;
If above-mentioned arbitrary condition does not meet, then determine pdf document encryption errors.
Above-mentioned condition judgment process can realize with some very simple documentation functions, thus is easy to carry out computer programming.
Fig. 2 shows according to the preferred embodiment of the invention for the process flow diagram of the detection method of pdf document, comprises the steps:
Step S202, monitoring scanning encryption pdf document generates catalogue;
Step S204, when monitoring folder content and changing, namely when new encryption pdf document produces, judge whether file is untreated new pdf document, when the pdf document got is processed, corresponding record can be got in tables of data, then no longer continue this file of process, continue scanning document catalogue;
Step S206, when the pdf document got is untreated, opens pdf document stream, obtains the enciphered message field recorded in pdf document;
Step S208, judges whether enciphered message field exists;
Step S210, the enciphered message field of pdf document if there is no, then no longer continues this file of process, directly in tables of data, records pdf document unencryption;
Step S212, if the enciphered message field of pdf document exists, then judges whether the form of enciphered message field meets encryption standard further;
Step S214, if do not meet, then determines file encryption mistake, and is recorded in tables of data by judged result;
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, as pdf document title [407_ZBA05705C_ps_p0001_b30.pdf], corresponding JPG preview graph file [407_ZBA05705C_ps_p0001_b30_Pre.jpg] [407_ZBA05705C_ps_p0001_b30_Tmb.jpg] of the same name;
Step S214, if JPG preview graph file does not exist, then log file encryption errors in tables of data.
Step S220, if JPG preview graph file exists, and size is not 0K, and in tables of data, log file encryption is correct.
Step S222, above test result is all recorded in tables of data, can print or send mail to dependence test personnel as annex.
Fig. 3 shows the schematic diagram of the pick-up unit for pdf document according to the embodiment of the present invention, comprising:
Monitoring module 10, for the new pdf document produced in monitoring objective file;
Field judge module 20, for judging whether the enciphered message field in pdf document meets encryption standard;
Acquisition module 30, if for meeting, then obtains the declassified document corresponding to pdf document further;
Deciphering judge module 40, for by judging that whether declassified document is correct, whether correct to determine the encryption of pdf document.
Preferably, this device also comprises:
Read module, for reading tables of data;
Process judge module, processed for judging whether record pdf document in tables of data;
Ignoring module, if processed for recording, then ignoring pdf document;
Calling module, for otherwise call field judge module.
Preferably, this device also comprises:
First module, for if there is no enciphered message field, then determines pdf document unencryption, and is recorded in tables of data by determination result;
Second module, if do not meet encryption standard for the form of enciphered message field, then determines pdf document encryption errors, and is recorded in tables of data by determination result;
3rd module, if meet encryption standard 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 the 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, then determine that pdf document encryption is correct; If above-mentioned arbitrary condition does not meet, then determine pdf document encryption errors.
As can be seen from the above description, invention increases the efficiency that PDF encrypts correctness test, and test report intuitively can be provided.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, 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 amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. for a detection method for pdf document, it is characterized in that, comprising:
The new pdf document produced in monitoring objective file;
Judge whether the enciphered message field in described pdf document meets encryption standard;
If met, then obtain the declassified document corresponding to described pdf document further;
By judging that whether described declassified document is correct, whether correct to determine the encryption of described pdf document.
2. method according to claim 1, is characterized in that, before judging whether the enciphered message field in described pdf document meets encryption standard, also comprises:
Read tables of data;
Judge in described tables of data, whether to record described pdf document processed;
If record processed, then ignore described pdf document;
Otherwise continuation execution is described judges the step whether the enciphered message field in described pdf document meets encryption standard.
3. method according to claim 2, is characterized in that, judges whether the enciphered message field in described pdf document meets encryption standard, comprising:
Judge whether to there is described enciphered message field;
If there is no described enciphered message field, then determine described pdf document unencryption, and determination result be recorded in described tables of data;
If there is described enciphered message field, then judge whether the form of described enciphered message field meets encryption standard;
If the form of described enciphered message field does not meet encryption standard, then determine described pdf document encryption errors, and determination result is recorded 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, the declassified document obtained corresponding to described pdf document comprises:
Obtain the preview graph file with the 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, then determine that the encryption of described pdf document is correct;
If above-mentioned arbitrary condition does not meet, then determine described pdf document encryption errors.
6. for a pick-up unit for pdf document, it is characterized in that, comprising:
Monitoring module, for the new pdf document produced in monitoring objective file;
Field judge module, for judging whether the enciphered message field in described pdf document meets encryption standard;
Acquisition module, if for meeting, then obtains the declassified document corresponding to described pdf document further;
Deciphering judge module, for by judging that whether described declassified document is correct, whether correct to determine the encryption of described pdf document.
7. device according to claim 6, is characterized in that, also comprises:
Read module, for reading tables of data;
Process judge module, processed for judging whether record described pdf document in described tables of data;
Ignoring module, if processed for recording, then ignoring described pdf document;
Calling module, for otherwise call described field judge module.
8. device according to claim 7, is characterized in that, also comprises:
First module, for if there is no described enciphered message field, then determines described pdf document unencryption, and determination result is recorded in described tables of data;
Second module, if do not meet encryption standard for the form of described enciphered message field, then determines described pdf document encryption errors, and determination result is recorded in described tables of data;
3rd module, if meet encryption standard 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 the 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, then determine that the encryption of described pdf document is correct; If above-mentioned arbitrary condition does not meet, then determine described pdf document encryption errors.
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 CN103034815A (en) 2013-04-10
CN103034815B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750675B (en) * 2015-04-01 2017-09-26 山东省计算中心(国家超级计算济南中心) A kind of unknown format encrypts the recognition methods of file
CN108038441B (en) * 2017-12-07 2021-03-16 潘晓梅 System and method based on image recognition
CN109767516B (en) * 2018-12-14 2021-06-11 汉海信息技术(上海)有限公司 Log setting and printing method, setting and printing apparatus, and log system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* 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

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
基于文件***过滤驱动的文件标识研究;龙飞宇等;《通信技术》;20081231;第41卷(第10期);第76-79页 *

Also Published As

Publication number Publication date
CN103034815A (en) 2013-04-10

Similar Documents

Publication Publication Date Title
CN101483514B (en) Evaluation method for WEB application
CN112217835B (en) Message data processing method and device, server and terminal equipment
KR100935684B1 (en) Apparatus for acquiring memory data of mobile terminal and method thereof
CN107977473B (en) Logback-based distributed system log retrieval method and system
JP2003091432A (en) Software evaluation system and software evaluation tool
CN109829304B (en) Virus detection method and device
CN102045268B (en) A kind of e-mail data restoration methods and device
CN112685436B (en) Tracing information processing method and device
CN111191246A (en) Spring annotation based security development verification method
CN103034815B (en) Detection method and device for portable document format (PDF) file
CN113704781A (en) File secure transmission method and device, electronic equipment and computer storage medium
WO2020087877A1 (en) Privacy information tracing and evidence collection method, apparatus, and system
CN111756697A (en) API (application program interface) security detection method and device, storage medium and computer equipment
Actoriano et al. Forensic Investigation on WhatsApp Web Using Framework Integrated Digital Forensic Investigation Framework Version 2
US20130246338A1 (en) System and method for indexing a capture system
Zhang et al. Android encryption database forensic analysis based on static analysis
Toldinas et al. Suitability of the digital forensic tools for investigation of cyber crime in the internet of things and services
CN114925337B (en) Data labeling method and device and electronic equipment
KR100986479B1 (en) System and method for digital evidence acquisition
CN108563396B (en) Safe cloud object storage method
CN115484070A (en) Security detection method and security detection device for encrypted file
Voisin et al. The metadata anonymization toolkit
CN108075932B (en) Data monitoring method and device
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

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150722

Termination date: 20190930