发明名称 |
FILE TYPE IDENTIFICATION METHOD AND FILE TYPE IDENTIFICATION DEVICE |
摘要 |
The present invention discloses a method for identifying a file type and an apparatus for identifying a file type, so as to solve a problem in the prior art that a file type cannot be effectively identified when a sender tampers with a file being transmitted. The method includes: acquiring, from a transmitted data packet, a file header of a file to be identified, and determining whether a magic number of the file to be identified can be obtained from the file header; if the magic number of the file to be identified can be obtained, searching first correspondence between a file type and the magic number for the file type that corresponds to the magic number in the file header; determining whether data of the file to be identified complies with a data structure feature of the file type; if the data of the file to be identified complies with the data structure feature of the file type, determining that a file type of the file to be identified is the file type that corresponds to the magic number in the file header; and if the data of the file to be identified does not comply with the data structure feature of the file type, determining that a file type of the file to be identified is an abnormal type, where the abnormal type is used to indicate that the file to be identified is a file whose type has been tampered with. |
申请公布号 |
EP2733892(A4) |
申请公布日期 |
2014.11.12 |
申请号 |
EP20120860856 |
申请日期 |
2012.10.19 |
申请人 |
HUAWEI TECHNOLOGIES CO., LTD. |
发明人 |
RUAN, LINGHONG;JIANG, WU;LI, SHIGUANG;WANG, ZHENHUI |
分类号 |
H04L12/26;G06F21/56;H04L29/06 |
主分类号 |
H04L12/26 |
代理机构 |
|
代理人 |
|
主权项 |
|
地址 |
|