CN100462995C - A method for verifying and using an image file - Google Patents
A method for verifying and using an image file Download PDFInfo
- Publication number
- CN100462995C CN100462995C CNB200510120652XA CN200510120652A CN100462995C CN 100462995 C CN100462995 C CN 100462995C CN B200510120652X A CNB200510120652X A CN B200510120652XA CN 200510120652 A CN200510120652 A CN 200510120652A CN 100462995 C CN100462995 C CN 100462995C
- Authority
- CN
- China
- Prior art keywords
- image file
- file
- eigenwert
- hash value
- client
- 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 - Lifetime
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Bioethics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Storage Device Security (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域 technical field
本发明是关于图像数据处理技术,尤其是关于一种图像文件的验证及使用方法,以防止图像文件被随意更改。The invention relates to image data processing technology, in particular to a method for verifying and using image files to prevent the image files from being changed arbitrarily.
背景技术 Background technique
随着社会及科技的发展,图像处理技术在计算机领域得到越来越多的应用,使得人们的工作、学习和日常生活日益丰富多彩。With the development of society and technology, image processing technology has been more and more applied in the computer field, making people's work, study and daily life more and more colorful.
现有技术中,通常采用Flash动画的方式来表现一些所需的动作,例如运行在用户电脑桌面的虚拟宠物游戏。其具体可以采用计算机程序的方式来实现,程序通过对每个Flash动画播放的控制,实现对整个宠物生活生命的描述,给用户一个有生命力的虚拟宠物体验。宠物的Flash动画经过透明化处理后,可以显示在用户桌面的任何位置。In the prior art, Flash animation is usually used to express some required actions, such as a virtual pet game running on a user's computer desktop. Specifically, it can be implemented in the form of a computer program. The program realizes the description of the entire life of the pet by controlling the playback of each Flash animation, and gives the user a virtual pet experience with vitality. After the pet's Flash animation is transparentized, it can be displayed anywhere on the user's desktop.
另外,为了增加虚拟宠物游戏的个性化效果,玩家可以购买相应的图像文件(道具),如玩具、气泡背景等供宠物玩耍及装饰宠物,以增加领养宠物的趣味性。现有技术中,首先用户需使用虚拟货币下载图像文件,图像文件文件以GIF图片或其他文件形式存储在客户端,用户点击相应的项目即可启动客户端的图像文件,使宠物做玩球的动作或显示出更为漂亮的背景等。In addition, in order to increase the personalization effect of the virtual pet game, players can purchase corresponding image files (props), such as toys, bubble backgrounds, etc. for pets to play with and decorate pets to increase the fun of adopting pets. In the prior art, first the user needs to use virtual currency to download the image file, the image file is stored in the client in the form of a GIF picture or other files, and the user clicks on the corresponding item to start the image file on the client, making the pet play with a ball Or display a more beautiful background, etc.
所有图像文件均需要下载到客户端才能使用,这样用户可以在客户端随意更改图片或其他文件,致使宠物的个性化展现的效果不佳,且在不需要使用虚拟货币购买的情况下即可享受多种个性化服务,也会损害虚拟宠物开发商的利益。All image files need to be downloaded to the client before they can be used, so that users can change pictures or other files at will on the client, resulting in poor personalized display of pets, and can enjoy without using virtual currency to purchase A variety of personalized services will also harm the interests of virtual pet developers.
发明内容 Contents of the invention
本发明的主要目的在于解决上述现有技术中图像文件可被随意更改的问题,提供了一种使用图像文件的方法。The main purpose of the present invention is to solve the above-mentioned problem in the prior art that image files can be changed at will, and provide a method for using image files.
为达到上述主要目的,本发明在下载时图像文件时将其压缩成一个文件包存储在客户端,该文件包内包含有该图像文件内所有文件的特征值列表,使用的步骤包括如下:客户端检测图像文件是否已经下载;若已经下载则需要对该图像文件进行验证,通过特征值列表对图像文件进行验证;图像文件验证通过则可使用该图像文件;若验证不通过则重新下载图像文件。In order to achieve the above-mentioned main purpose, the present invention compresses it into a file package and stores it in the client when downloading the image file. The feature value list of all files in the image file is included in the file package. The steps used include the following: The terminal detects whether the image file has been downloaded; if it has been downloaded, the image file needs to be verified, and the image file is verified through the list of feature values; the image file can be used if the image file is verified; if the verification is not passed, the image file is re-downloaded .
本发明的另一主要目的是提供一种在使用图像文件时验证图像文件的方法。Another main object of the present invention is to provide a method of authenticating an image file when using the image file.
为达到上述另一主要目的,本发明的图像文件被压缩成一个文件包存储在客户端,该文件包内包含有该图像文件内所有文件的特征值列表;该验证方法包括如下步骤:读入各特征值列表;从上述特征值列表中依次取出一条记录;计算出当前客户端图像文件中与该条记录相对应的文件的特征值;比较该条记录所记载的特征值与由对应的文件计算出的特征值是否相同。In order to achieve the above-mentioned another main purpose, the image file of the present invention is compressed into a file package and stored on the client, and the file package contains a list of feature values of all files in the image file; the verification method includes the following steps: Each feature value list; take out a record in turn from the above feature value list; calculate the feature value of the file corresponding to the record in the current client image file; compare the feature value recorded in the record with the corresponding file Whether the calculated eigenvalues are the same.
较佳的,该特征值是通过MD5加密算法计算出来的HASH值。读入特征值列表之前还包括设置验证目录的步骤,然后要对特征值列表进行解密。其中所述验证目录为客户端系统的临时目录,该临时目录中存储有图像文件的解压缩目录。Preferably, the feature value is a HASH value calculated through the MD5 encryption algorithm. Before reading in the characteristic value list, a step of setting a verification directory is also included, and then the characteristic value list must be decrypted. The verification directory is a temporary directory of the client system, and the decompression directory of image files is stored in the temporary directory.
较佳的,计算出客户端中与该条记录相对应的文件的特征值之前还包括:判断验证目录下是否存在该对应的图像文件。Preferably, before calculating the characteristic value of the file corresponding to the record in the client, the method further includes: judging whether the corresponding image file exists in the verification directory.
较佳的,所述特征值为HASH值,该特征值列表包括文件名与HASH值,文件名与HASH值之间一一对应。Preferably, the characteristic value is a HASH value, and the characteristic value list includes a file name and a HASH value, and there is a one-to-one correspondence between the file name and the HASH value.
综上所述,本发明中当客户端下载图像文件时,一起将图像文件的特征值列表压缩在文件包内,每次在使用本地图像文件之前,总是利用HASH值列表和当前所有文件内容逐一对比,一旦发现有差异,则说明文件可能被更改或替换,将不再使用该本地图像文件。从而有效防止图像文件被随意更改。To sum up, in the present invention, when the client downloads an image file, the feature value list of the image file is compressed together in the file package, and each time before using the local image file, the HASH value list and all current file contents are always used Comparing them one by one, once a difference is found, it means that the file may be changed or replaced, and the local image file will no longer be used. Thereby effectively preventing the image file from being changed arbitrarily.
附图说明 Description of drawings
图1为本发明图像文件的使用示意图。FIG. 1 is a schematic diagram of the use of image files in the present invention.
图2为本发明使用图像文件的流程图。Fig. 2 is a flow chart of using image files in the present invention.
图3为本发明验证图像文件的流程图。Fig. 3 is a flow chart of verifying image files in the present invention.
图4为本发明其中一实施例特征值列表示意图。FIG. 4 is a schematic diagram of a list of feature values according to one embodiment of the present invention.
具体实施方式 Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
为了增加虚拟宠物的个性化效果,玩家可以购买相应的图像文件(道具),如玩具、气泡背景等供虚拟宠物玩耍及装饰宠物。如图1所示,所述图像文件内一般包括有多个文件,如图像文件1、图像文件2等,首先需要将该多个文件压缩成一个文件包下载到客户端的宠物资源目录中,该文件包内包括有该图像文件内各文件的特征值列表,然后在客户端进行解压缩,并将各图像文件的解压缩目录存储在客户端系统的临时目录中,使用图像文件时自解压缩目录中读取相关数据。In order to increase the personalization effect of the virtual pet, the player can purchase corresponding image files (props), such as toys, bubble backgrounds, etc. for the virtual pet to play and decorate the pet. As shown in Figure 1, the image file generally includes multiple files, such as image file 1, image file 2, etc. First, the multiple files need to be compressed into a file package and downloaded to the pet resource directory of the client. The file package includes a list of feature values of each file in the image file, and then decompress it on the client, and store the decompressed directory of each image file in the temporary directory of the client system, and self-decompress when using the image file Read related data from the directory.
下面将结合图2对本发明客户端使用图像文件时的具体流程作一说明:The specific process when the client of the present invention uses the image file will be described below in conjunction with Fig. 2:
客户端首先检测图像文件是否已经下载(步骤10);The client first detects whether the image file has been downloaded (step 10);
若已经下载则需要对该图像文件进行验证(步骤20);If downloaded, the image file needs to be verified (step 20);
验证通过则可使用该图像文件(步骤50);If the verification is passed, the image file can be used (step 50);
若验证不通过则到达步骤30,重新下载图像文件;If verification is not passed, then step 30 is reached, and the image file is re-downloaded;
若检测到图像文件未下载,则将图像文件压缩成一个文件包下载到客户端的宠物资源目录中,且该文件包内包括有该图像文件内各文件的特征值列表(步骤30);If it is detected that the image file is not downloaded, then the image file is compressed into a file package and downloaded in the pet resource directory of the client, and the file package includes a feature value list (step 30) of each file in the image file;
然后解压缩图像文件,并将图像文件的解压缩目录存储在客户端系统的临时目录中(步骤40);Then decompress the image file, and store the decompression directory of the image file in the temporary directory of the client system (step 40);
最后即可自解压缩目录中读取相关数据即可使用图像文件(步骤50)。Finally, the relevant data can be read from the self-extracting directory to use the image file (step 50).
本发明的一较佳实施例中该特征值列表为一HASH值列表,该HASH值列表的每一条记录分别相当于给该图像文件下相对应的一个文件拍摄“快照”,它能够记录下该图像文件文件的原始内容。该HASH列表包括文件名和HASH值,文件名和HASH值之间一一对应,所述HASH值是利用MD5加密算法计算出来的,该MD5加密算法算法可以将任意长度的数据计算转化成为一个固定长度的数据串,一旦文件的内容发生很小的改动,计算出的数据串则会发生很大的变化。In a preferred embodiment of the present invention, the characteristic value list is a HASH value list, and each record in the HASH value list is equivalent to taking a "snapshot" for a corresponding file under the image file, which can record the The raw content of the image file file. The HASH list includes file names and HASH values, and there is a one-to-one correspondence between file names and HASH values. The HASH values are calculated using the MD5 encryption algorithm. The MD5 encryption algorithm can convert data calculations of any length into a fixed-length Data string, once the content of the file changes slightly, the calculated data string will change greatly.
下面将结合图3所示说明如何实现步骤20,对图像文件进行验证(如图3所示):How to implement step 20 will be described below in conjunction with what is shown in Figure 3, and the image file is verified (as shown in Figure 3):
首先设置验证目录为客户端系统的临时目录(步骤201),由于客户端系统的临时目录存储有图像文件的解压缩目录,即是设置需要对图像文件的解压缩目录进行验证;At first setting verification directory is the temporary directory (step 201) of client system, because the temporary directory of client system is stored with the decompression directory of image file, namely setting needs to verify the decompression directory of image file;
对HASH列表进行解密(步骤202);Decrypt the HASH list (step 202);
若解密成功,读入HASH值列表(步骤203);If the decryption is successful, read in the HASH value list (step 203);
则从HASH列表中取出一条记录(步骤204);Then take out a record (step 204) from the HASH list;
判断验证目录下是否存在与该条记录相对应的文件(步骤205);Judging whether there is a file corresponding to the record under the verification directory (step 205);
若存在,则利用MD5算法计算出该文件的当前HASH值,该MD5加密算法算法可以将任意长度的数据计算转化成为一个固定长度的数据串(步骤205);If exist, then utilize MD5 algorithm to calculate the current HASH value of this file, this MD5 encryption algorithm algorithm can convert the data calculation of any length into a fixed-length data string (step 205);
判断记录中的HASH值与计算出该文件的当前HASH值是否相等(步骤207);Judging whether the HASH value in the record is equal to the current HASH value calculated for the file (step 207);
若相等则判断HASH列表中的记录是否都验证完毕(步骤208);If equal, then judge whether the record in the HASH list has been verified (step 208);
若完毕则验证通过,达到步骤50,即可使用图像文件;If complete, then the verification is passed, reaching step 50, and the image file can be used;
若未验证完毕,则回到步骤204,继续读取下一条记录。If the verification is not completed, return to
在上述步骤过程中,若对HASH列表解密失败或验证目录下不存在与所验证的记录相对应的文件,或是两个HASH值不相等,则都会验证失败,直接到达步骤30,开始重新下载该图像文件,而不再使用当前客户端中的图像文件。During the above steps, if the decryption of the HASH list fails, or there is no file corresponding to the verified record in the verification directory, or the two HASH values are not equal, the verification will fail and go directly to step 30 to start re-downloading The image file instead of using the image file in the current client.
为了更加清楚的描述本发明的图像文件的验证方法,下面将以虚拟宠物中“个性化气泡背景图像文件”为例来进行更加详细的说明。In order to describe the verification method of the image file of the present invention more clearly, the following will take the "personalized bubble background image file" in the virtual pet as an example for a more detailed description.
一个气泡背景一般包括“背景GIF文件”、“按钮BMP文件”、“配置文件”三个文件。为了下载方便,将上述的三个文件压缩成一ZIP文件包下载到客户端的宠物资源目录中,然后解压缩该三个文件,并将其解压缩目录存储在客户端系统的临时目录中。且该ZIP文件包中还包括一HASH列表,如图4所示,该HASH列表中包括有三条记录,分别是背景、按钮及配置文件,每一个记录中对应有一16字节信息串(HASH值)。A bubble background generally includes three files: "background GIF file", "button BMP file" and "configuration file". For the convenience of downloading, compress the above three files into a ZIP file package and download it to the pet resource directory of the client, then decompress the three files, and store the decompressed directory in the temporary directory of the client system. And also comprise a HASH list in this ZIP file package, as shown in Figure 4, include three records in this HASH list, are respectively background, button and configuration file, correspond to a 16-byte information string (HASH value) in each record ).
客户端在使用图像文件之前,首先设置验证目录为客户端系统的临时目录;解密出HASH列表;然后从该列表中取出背景这一栏目中所对应的记录;验证客户端系统中的解压缩目录中是否有与该记录相对应的文件,即“背景GIF文件”;若有,则利用MD5算法计算出当前“背景GIF文件”的HASH值;接着判断列表中的HASH值是否与当前计算出的HASH值相同;如此类推,直到HASH列表中所有记录的HASH值均与当前计算出的HASH值相同,则验证通过。若其中有一记录没验证通过,则已下载在本客户端的气泡背景不可再用,需要重新下载图像文件。Before the client uses the image file, first set the verification directory as the temporary directory of the client system; decrypt the HASH list; then take out the corresponding record in the background column from the list; verify the decompression directory in the client system Whether there is a file corresponding to the record, that is, "background GIF file"; if so, use the MD5 algorithm to calculate the HASH value of the current "background GIF file"; then judge whether the HASH value in the list is the same as the currently calculated The HASH values are the same; and so on, until the HASH values of all records in the HASH list are the same as the currently calculated HASH values, then the verification is passed. If one of the records fails to pass the verification, the bubble background that has been downloaded on this client can no longer be used, and the image file needs to be downloaded again.
综上述,客户端在每次使用图像文件之前,均要利用加密的HASH值与当前图像文件下所有的文件内容进行比对,一旦发现差异,则说明该图像文件已经被替换或更改,那么将不再使用当前文件,而是重新下载该图像文件。从而有效防止图像文件被随意改动。To sum up, before each use of an image file, the client must use the encrypted HASH value to compare all file contents under the current image file. Once a difference is found, it means that the image file has been replaced or changed, and the The current file is no longer used and the image file is re-downloaded. Thereby effectively preventing the image file from being changed arbitrarily.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.
Claims (14)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB200510120652XA CN100462995C (en) | 2005-12-10 | 2005-12-10 | A method for verifying and using an image file |
| PCT/CN2006/002940 WO2007065341A1 (en) | 2005-12-10 | 2006-11-02 | A method and apparatus for verifying an image file |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB200510120652XA CN100462995C (en) | 2005-12-10 | 2005-12-10 | A method for verifying and using an image file |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1979516A CN1979516A (en) | 2007-06-13 |
| CN100462995C true CN100462995C (en) | 2009-02-18 |
Family
ID=38122475
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB200510120652XA Expired - Lifetime CN100462995C (en) | 2005-12-10 | 2005-12-10 | A method for verifying and using an image file |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN100462995C (en) |
| WO (1) | WO2007065341A1 (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101262493B (en) * | 2008-01-14 | 2011-10-05 | 深圳市深信服电子科技有限公司 | Method for accelerating inter-network data transmission via stream buffer |
| CN101957858A (en) * | 2010-09-27 | 2011-01-26 | 中兴通讯股份有限公司 | Data comparison method and device |
| CN103118045B (en) * | 2011-11-17 | 2017-03-15 | 腾讯科技(深圳)有限公司 | A kind of method and system of offline download |
| US10089323B2 (en) | 2012-04-05 | 2018-10-02 | Microsoft Technology Licensing, Llc | Telemetry system for a cloud synchronization system |
| CN114281873B (en) * | 2021-12-06 | 2024-11-05 | 北京疤康健康管理有限公司 | A verifiable search method for medical blockchain data |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1333973A (en) * | 1998-11-20 | 2002-01-30 | 艾利森电话股份有限公司 | Method and device for encryption of images |
| CN1431622A (en) * | 2001-12-28 | 2003-07-23 | 佳能株式会社 | Image verification system, its appts. and method |
| US20050149902A1 (en) * | 2003-11-05 | 2005-07-07 | Xuelong Shi | Eigen decomposition based OPC model |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1552473A1 (en) * | 2002-10-09 | 2005-07-13 | Koninklijke Philips Electronics N.V. | Localisation of image tampering |
| JP2004310386A (en) * | 2003-04-04 | 2004-11-04 | Canon Inc | Image verification device, image verification method, computer program, and computer-readable recording medium |
-
2005
- 2005-12-10 CN CNB200510120652XA patent/CN100462995C/en not_active Expired - Lifetime
-
2006
- 2006-11-02 WO PCT/CN2006/002940 patent/WO2007065341A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1333973A (en) * | 1998-11-20 | 2002-01-30 | 艾利森电话股份有限公司 | Method and device for encryption of images |
| CN1431622A (en) * | 2001-12-28 | 2003-07-23 | 佳能株式会社 | Image verification system, its appts. and method |
| US20050149902A1 (en) * | 2003-11-05 | 2005-07-07 | Xuelong Shi | Eigen decomposition based OPC model |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1979516A (en) | 2007-06-13 |
| WO2007065341A1 (en) | 2007-06-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI227831B (en) | Embedding digital signatures into digital payloads | |
| JP4740157B2 (en) | Protect digital data content | |
| CN100430923C (en) | Safety digital data form and code forced implement policy | |
| US7505955B2 (en) | Information terminal and content storage/playback method | |
| US20190243948A1 (en) | Method and apparatus for delivering encoded content | |
| WO2018090642A1 (en) | Application program upgrade method, user terminal and storage medium | |
| US20030009694A1 (en) | Hardware architecture, operating system and network transport neutral system, method and computer program product for secure communications and messaging | |
| US20020199096A1 (en) | System and method for secure unidirectional messaging | |
| US20020194501A1 (en) | System and method for conducting a secure interactive communication session | |
| US20020194483A1 (en) | System and method for authorization of access to a resource | |
| US20020196935A1 (en) | Common security protocol structure and mechanism and system and method for using | |
| US20150301823A1 (en) | Information Processing Device, Difference Information Generating Device, Program, And Recording Medium. | |
| JPWO2003083746A1 (en) | Content reproduction apparatus and content reproduction control method | |
| EP2082199A2 (en) | A data storage device and method | |
| CN105706099A (en) | Software update device and software update program | |
| CN105760490B (en) | Resource storage method and device and electronic equipment | |
| US20110283362A1 (en) | data storage device and method | |
| US20110066843A1 (en) | Mobile media play system and method | |
| US20060173969A1 (en) | Retention of functionality and operational configuration for a portable data storage drive | |
| CN100462995C (en) | A method for verifying and using an image file | |
| CN103119559B (en) | Information generating system and method thereof | |
| Tibor et al. | Development of multi-platform steganographic software based on random-lsb | |
| US7330980B2 (en) | Method of and system for encrypting digital data, method of and apparatus for reproducing digital data, and computer product | |
| TWI324349B (en) | Secure protable storage device and control method for the same | |
| US20090328146A1 (en) | Method of generating authentication code in digital device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C57 | Notification of unclear or unknown address | ||
| DD01 | Delivery of document by public notice |
Addressee: Gui Yan Document name: Written notice of preliminary examination of application for patent for invention |
|
| 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 | ||
| CX01 | Expiry of patent term |
Granted publication date: 20090218 |
|
| CX01 | Expiry of patent term |