CN103942284B - File fingerprint information extracting method based on sine function - Google Patents

File fingerprint information extracting method based on sine function Download PDF

Info

Publication number
CN103942284B
CN103942284B CN201410138961.9A CN201410138961A CN103942284B CN 103942284 B CN103942284 B CN 103942284B CN 201410138961 A CN201410138961 A CN 201410138961A CN 103942284 B CN103942284 B CN 103942284B
Authority
CN
China
Prior art keywords
file
fingerprint information
bit
information
method based
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.)
Active
Application number
CN201410138961.9A
Other languages
Chinese (zh)
Other versions
CN103942284A (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.)
Space Star Technology Co Ltd
Original Assignee
Space Star Technology 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 Space Star Technology Co Ltd filed Critical Space Star Technology Co Ltd
Priority to CN201410138961.9A priority Critical patent/CN103942284B/en
Publication of CN103942284A publication Critical patent/CN103942284A/en
Application granted granted Critical
Publication of CN103942284B publication Critical patent/CN103942284B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

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)
  • Storage Device Security (AREA)
  • Collating Specific Patterns (AREA)

Abstract

一种基于正弦函数的文件指纹信息提取方法,利用正弦函数来产生一个位置序列,该序列作为从文件内容中提取文件指纹信息时的位置值,取出值后用一个置换矩阵进行置换,从而得到最终的文件指纹,以实现对文件明文的一定程度保密性。其中置换矩阵可以设置一个默认值或者由使用者自己指定,这种策略实现简单,可伸缩性强,能提供任意bit长度的指纹,指纹信息可以以任意形式分散在文件内容当中,非常适合流密码对数据进行加解密的场景中。

A file fingerprint information extraction method based on a sine function, which uses a sine function to generate a position sequence, which is used as a position value when extracting file fingerprint information from the file content, and after the value is taken out, it is replaced by a replacement matrix to obtain the final File fingerprints to achieve a certain degree of confidentiality of the plaintext of the file. Among them, the permutation matrix can be set to a default value or specified by the user. This strategy is simple to implement and highly scalable. It can provide fingerprints of any bit length. The fingerprint information can be scattered in the file content in any form, which is very suitable for stream ciphers. In the scenario of encrypting and decrypting data.

Description

一种基于正弦函数的文件指纹信息提取方法A File Fingerprint Information Extraction Method Based on Sine Function

技术领域technical field

本发明属于计算机应用领域,涉及一种文件加密信息的获取方法。The invention belongs to the field of computer applications, and relates to a method for acquiring file encryption information.

背景技术Background technique

在计算机应用中,特别是信息安全领域,文件指纹信息是一个很重要的方法和策略。所谓文件指纹,是指可以唯一标示某个文件的特征,每一个不同的文件都会有不同的指纹信息。文件指纹在保护数据完整性,身份识别等诸多方面有着举足轻重的作用。在很多场景下,需要采用更加简单有效的文件指纹信息提取机制。In computer applications, especially in the field of information security, file fingerprint information is a very important method and strategy. The so-called file fingerprint refers to the feature that can uniquely identify a certain file, and each different file will have different fingerprint information. File fingerprints play a pivotal role in protecting data integrity, identification and many other aspects. In many scenarios, it is necessary to adopt a simpler and more effective file fingerprint information extraction mechanism.

现有的文件指纹信息提取方法,主要是集中在寻找相关杂凑函数来对文件内容进行处理。比如在校验数据完整性方面,数据发布者首先对文件内容进行杂凑,将杂凑值附着在文件的头部或尾部,数据接收者接收数据后,再对文件内容进行杂凑,将杂凑值与原始的杂凑值进行比对,从而判断数据是否被篡改或损坏。在业界,比较成熟且应用广泛的杂凑函数有MDx、SHA-x等。Existing file fingerprint information extraction methods mainly focus on finding relevant hash functions to process file content. For example, in terms of verifying data integrity, the data publisher first hashes the content of the file, and attaches the hash value to the head or tail of the file. The hash value is compared to determine whether the data has been tampered with or damaged. In the industry, relatively mature and widely used hash functions include MDx and SHA-x.

然而,在流密码机制中,要对每一个文件采用不同的密钥进行加解密,常用的利用文件指纹来标识不同文件的方法是不适合的,因为需要在文件头部或尾部附加一个指纹信息,影响了文件长度,并且指纹信息是公开的,一旦被破坏,文件就有无法解密的风险。因此,研究一种能在流密码体制中使用的文件指纹信息提取方法是非常必要的。However, in the stream cipher mechanism, each file needs to be encrypted and decrypted with a different key. The commonly used method of using file fingerprints to identify different files is not suitable, because a fingerprint information needs to be attached to the file header or tail , affects the length of the file, and the fingerprint information is public, once it is destroyed, the file has the risk of being unable to decrypt. Therefore, it is very necessary to study a file fingerprint information extraction method that can be used in stream ciphers.

发明内容Contents of the invention

本发明的技术解决问题是:克服现有技术的不足,提供了一种基于正弦函数的文件指纹信息提取方法,特别适合于流密码体制中对数据进行加解密。The problem solved by the technology of the present invention is to overcome the deficiencies of the prior art and provide a method for extracting file fingerprint information based on a sinusoidal function, which is especially suitable for encrypting and decrypting data in a stream cipher system.

本发明的技术解决方案是:一种基于正弦函数的文件指纹信息提取方法,包括如下步骤:The technical solution of the present invention is: a kind of file fingerprint information extraction method based on sinusoidal function, comprises the following steps:

(1)利用随机序列生成器,生成一个长度为n bit的随机序列;所述的随机序列只生成一次,不再重复生成。(1) Use a random sequence generator to generate a random sequence with a length of n bits; the random sequence is only generated once and will not be generated repeatedly.

(2)获取文件内容以及按bit计算的文件大小A,采用下式计算得到位置信息,从文件内容中提取相应的bit作为初始指纹信息,(2) Obtain the file content and the file size A calculated by bit, use the following formula to calculate the location information, and extract the corresponding bit from the file content as the initial fingerprint information,

式中,S为1到n之间的整数,F(S)为从文件内容中提取的第S个位置,L为由文件大小A决定的扩散系数,当A小于16KB时,L=217bit,当A大于等于16KB时,L=A;In the formula, S is an integer between 1 and n, F(S) is the Sth position extracted from the file content, L is the diffusion coefficient determined by the file size A, when A is less than 16KB, L=2 17 bit, when A is greater than or equal to 16KB, L=A;

(3)从文件内容中提取相应bit的信息生成n bit的初始指纹信息;当步骤(2)中计算得到的提取位置个数等于n时,从n个对应位置提取的bit信息即为初始指纹信息,当步骤(2)中计算得到的提取位置个数小于n时,利用从对应位置提取的利用bit信息,对步骤(1)中生成的随即序列从最高位开始进行顺序替换,由此得到n bit的初始指纹信息;(3) Extract the corresponding bit information from the file content to generate n-bit initial fingerprint information; when the number of extraction positions calculated in step (2) is equal to n, the bit information extracted from n corresponding positions is the initial fingerprint information information, when the number of extraction positions calculated in step (2) is less than n, the random sequence generated in step (1) is replaced sequentially from the highest bit by using the bit information extracted from the corresponding position, thus obtaining n bit initial fingerprint information;

(4)利用置换矩阵将n bit的初始指纹信息进行置换,从而得到最终的文件指纹信息。所述的置换矩阵为一个16*16的二维数组,数组中的每个元素都不相同,但是每一个元素的取值都属于0~255中的一个值。置换矩阵为固定的默认矩阵或者由用户随机选取。(4) Use the permutation matrix to replace the n-bit initial fingerprint information to obtain the final file fingerprint information. The permutation matrix is a 16*16 two-dimensional array, each element in the array is different, but the value of each element belongs to a value from 0 to 255. The permutation matrix is a fixed default matrix or randomly selected by the user.

本发明与现有技术相比的优点在于:The advantage of the present invention compared with prior art is:

(1)实现简单。利用正弦函数来产生一个位置序列,该序列作为从文件内容中提取文件指纹信息时的位置值,取出值后用一个置换矩阵进行置换,从而得到最终的文件指纹,相比传统的HASH方法,本发明方法无需对待加密的源文件进行任何的改动(传统HASH方法需要将文件的hash值附加在文件当中),易于实现;(1) Simple to implement. Use the sine function to generate a position sequence, which is used as the position value when extracting the file fingerprint information from the file content. After the value is taken out, it is replaced with a permutation matrix to obtain the final file fingerprint. Compared with the traditional HASH method, this The inventive method does not need to make any changes to the source file to be encrypted (the traditional HASH method needs to append the hash value of the file to the file), which is easy to implement;

(2)非常适合用户流密码体制中。在不改变文件内容的情况下,实现标识每个文件的身份功能,为不同文件产生不同的密钥流。传统的方法必须对源文件内容进行改变,如果一旦文件在传输过程中出现差错,则源文件无法解密,采用本发明方法可以避免上述问题;(2) It is very suitable for the user stream cipher system. Without changing the content of the file, the identity function of identifying each file is realized, and different key streams are generated for different files. The traditional method must change the content of the source file. If an error occurs in the transmission process of the file, the source file cannot be decrypted. The method of the present invention can avoid the above problems;

(3)安全性更高。采用补足随机数组,使之适合不同大小的文件,并提供很好的安全性。传统的方法对于小文件的安全性弱,因为小文件,利用传统的方法可以进行蛮力破解,而采用文件指纹和补足随机数据,可以保证即使在文件内容很小的情况下,也提供更加安全的保证。(3) Higher security. A random array is used to make it suitable for files of different sizes and provide good security. Traditional methods are less secure for small files, because small files can be cracked by brute force using traditional methods, and using file fingerprints and supplementing random data can ensure that even when the file content is small, it can provide more secure guarantee.

附图说明Description of drawings

图1为本发明方法的流程框图。Fig. 1 is a flowchart of the method of the present invention.

具体实施方式detailed description

如图1所示,为本发明基于正弦函数的文件指纹信息提取方法的流程图,主要包括如下几个步骤:As shown in Figure 1, it is a flow chart of the file fingerprint information extraction method based on the sine function of the present invention, which mainly includes the following steps:

一、初始指纹生成1. Initial Fingerprint Generation

根据文件内容及文件长度(按bit长度计算),结合正弦函数及指纹位置计算公式,从文件内容中提取相应位数的初始指纹信息。According to the file content and file length (calculated by bit length), combined with the sine function and fingerprint position calculation formula, the initial fingerprint information of the corresponding number of digits is extracted from the file content.

(1)获取文件长度;(1) Obtain the file length;

(2)根据文件长度按照以下指纹计算公式计算出指纹信息在文件内容中所对应的位置;(2) According to the length of the file, calculate the corresponding position of the fingerprint information in the file content according to the following fingerprint calculation formula;

公式说明:文件指纹信息的长度为n bits,S为[1,n]之间的整数,表示要提取指纹的第S位;L为扩散系数,由文件的大小决定,当文件大小小于16KB时L取217,其它情况L为文件的大小(按bit计算);F(S)表示提取第S位所对应文件的具体位置。Formula description: The length of the file fingerprint information is n bits, S is an integer between [1,n], indicating the Sth bit of the fingerprint to be extracted; L is the diffusion coefficient, determined by the size of the file, when the file size is less than 16KB L is 2 17 , and in other cases L is the size of the file (calculated in bits); F(S) indicates the specific location of the file corresponding to the S-th bit.

上述公式的推导过程如下:The derivation process of the above formula is as follows:

由于关系函数采用正弦函数,比特位在文件中的下标从0开始计算,因此Since the relationship function adopts a sine function, the subscript of the bit in the file starts from 0, so

因此得出如下公式:Therefore, the following formula is obtained:

上述公式之所以采用正弦函数为基础来实现对文件指纹位的生成,其原因是:1)因为正弦函数产生的位置信息比线性函数产生的位置信息更具隐蔽性,而且比高次函数和指数/对数函数简单;2)函数的系数和文件内容进行关联,保证不同的文件有不同的位置信息,即使相同的文件长度,其指纹信息值也是不同的;3)为了解决小文件的问题,采取了补足随机数组的形式进行安全保证措施。The reason why the above formula uses the sine function as the basis to realize the generation of file fingerprint bits is that: 1) Because the position information generated by the sine function is more concealed than the position information generated by the linear function, and it is better than the high-order function and exponential function. The /logarithmic function is simple; 2) The coefficient of the function is associated with the file content to ensure that different files have different location information. Even if the file length is the same, its fingerprint information value is different; 3) In order to solve the problem of small files, The security guarantee measures are taken in the form of supplementing random arrays.

(3)根据求出的位置(以bit计数的位置)从文件内容中读出对应的初始指纹信息位,若文件长度太小,则根据需要从补足数组中取出相应长度的比特串填充初始指纹信息。(3) Read the corresponding initial fingerprint information bit from the file content according to the calculated position (position counted in bits). If the file length is too small, fill the initial fingerprint with a bit string of corresponding length from the complementary array as needed information.

二、补足数组生成2. Complementary array generation

由随机序列生成器(一个随机序列生成函数)生成一个比特数组,该数组是一个与文件指纹信息长度相同的比特串,并且一次生成,永久使用。A bit array is generated by a random sequence generator (a random sequence generating function), which is a bit string with the same length as the file fingerprint information, and is generated once and used permanently.

(1)利用随机序列生成器计算出与指纹信息长度等长的一个随机序列;(1) Use the random sequence generator to calculate a random sequence equal to the length of the fingerprint information;

(2)利用预先设定好的随机性检测规则检测生成的随机序列的随机性是否符合要求,若不符合重新生成随机序列;若符合要求则该生成的随机序列即为补足数组;(2) Use the pre-set randomness detection rules to check whether the randomness of the generated random sequence meets the requirements, if not, regenerate the random sequence; if it meets the requirements, the generated random sequence is a complementary array;

三、指纹信息置换3. Fingerprint Information Replacement

可以由开发者设置一个默认置换矩阵,并提供接口供使用者选择是否指定置换矩阵,用置换矩阵对初始指纹信息进行置换后得出最终的文件指纹信息。The developer can set a default permutation matrix, and provide an interface for the user to choose whether to specify the permutation matrix, and use the permutation matrix to replace the initial fingerprint information to obtain the final file fingerprint information.

(1)确定使用默认置换矩阵还是使用用户指定的置换矩阵;(1) Determine whether to use the default permutation matrix or use the user-specified permutation matrix;

(2)利用置换矩阵将初始指纹信息进行置换,得到最终的文件指纹信息。(2) Use the permutation matrix to replace the initial fingerprint information to obtain the final file fingerprint information.

置换矩阵即一个16*16的二维数组,数组中每个元素都是不同的,且都属于0~255中的一个值,也就是说,置换矩阵就是0~255的一个排列。所谓默认置换矩阵,即由算法自动随机生成;而用户指定的置换矩阵,即使用者也可以自己生成一个排列,以算法参数的形式进行输入。The permutation matrix is a 16*16 two-dimensional array. Each element in the array is different and belongs to a value from 0 to 255. That is to say, the permutation matrix is an arrangement of 0 to 255. The so-called default permutation matrix is automatically and randomly generated by the algorithm; and the user-specified permutation matrix, that is, the user can also generate a permutation by himself and input it in the form of algorithm parameters.

置换矩阵用来对初始文件指纹信息进行变换,使其与文件数据的关系更加复杂,提高文件指纹信息获取的保密性,置换矩阵的作用是打乱文件指纹信息中比特位的位置,因此二维数组中元素不能重复。The permutation matrix is used to transform the initial file fingerprint information, making the relationship with the file data more complex, and improving the confidentiality of file fingerprint information acquisition. The function of the permutation matrix is to disturb the position of the bits in the file fingerprint information. Elements in the array cannot be repeated.

本发明说明书中未作详细描述的内容属本领域技术人员的公知技术。The content that is not described in detail in the description of the present invention belongs to the well-known technology of those skilled in the art.

Claims (3)

1. a kind of file fingerprint information extracting method based on SIN function, it is characterised in that comprise the steps:
(1) random sequence generator is utilized, random sequences of the length for n bit are generated;
(2) file size A for obtaining file content and calculating by bit, using following formula positional information is calculated,
F ( S ) = ( L + 1 ) · s i n π ( S - 1 ) 2 ( n - 1 )
In formula, S is that 1 to the integer between n, F (S) is the S position extracted from file content, and L is to be determined by file size A Fixed diffusion coefficient, when A is less than 16KB, L=217Bit, when A is more than or equal to 16KB, L=A;
(3) information that corresponding bit is extracted from file content generates the initial fingerprint information of n bit;When calculating in step (2) When the extraction position number for arriving is equal to n, the bit information extracted from n correspondence position is initial fingerprint information, when step (2) In calculated extraction position number when being less than n, using the bit information extracted from correspondence position, to what is generated in step (1) Immediately sequence proceeds by order and replaces from highest order, thus obtains the initial fingerprint information of n bit;
(4) the initial fingerprint information of n bit is entered into line replacement using permutation matrix, so as to obtain final file fingerprint information; Described permutation matrix is the two-dimensional array of a 16*16, and each element in array is different from, but each element Value belongs to a value in 0~255.
2. a kind of file fingerprint information extracting method based on SIN function according to claim 1, it is characterised in that:Institute The random sequences stated are only generated once, are not repeated to generate.
3. a kind of file fingerprint information extracting method based on SIN function according to claim 1, it is characterised in that:Institute The permutation matrix stated is fixed default matrix or is randomly selected by user.
CN201410138961.9A 2014-04-08 2014-04-08 File fingerprint information extracting method based on sine function Active CN103942284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410138961.9A CN103942284B (en) 2014-04-08 2014-04-08 File fingerprint information extracting method based on sine function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410138961.9A CN103942284B (en) 2014-04-08 2014-04-08 File fingerprint information extracting method based on sine function

Publications (2)

Publication Number Publication Date
CN103942284A CN103942284A (en) 2014-07-23
CN103942284B true CN103942284B (en) 2017-05-03

Family

ID=51189952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410138961.9A Active CN103942284B (en) 2014-04-08 2014-04-08 File fingerprint information extracting method based on sine function

Country Status (1)

Country Link
CN (1) CN103942284B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281581A (en) * 2007-09-27 2008-10-08 北京数字证书认证中心有限公司 Method for checking whether contents of paper file is distorted or not
CN102880833A (en) * 2012-08-28 2013-01-16 福州讯华信息技术有限公司 Two-dimensional code anti-fake verification method for documents
CN102930317A (en) * 2012-11-30 2013-02-13 中企永联数据交换技术(北京)有限公司 Device for generating two-dimension code identifiers of books, two-dimension code identification device and system
CN103544408A (en) * 2013-09-23 2014-01-29 中山大学 Method for embedment and extraction of PDF document hidden information according to composite font

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4424422B2 (en) * 2008-01-18 2010-03-03 富士ゼロックス株式会社 Information processing apparatus, information processing system, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281581A (en) * 2007-09-27 2008-10-08 北京数字证书认证中心有限公司 Method for checking whether contents of paper file is distorted or not
CN102880833A (en) * 2012-08-28 2013-01-16 福州讯华信息技术有限公司 Two-dimensional code anti-fake verification method for documents
CN102930317A (en) * 2012-11-30 2013-02-13 中企永联数据交换技术(北京)有限公司 Device for generating two-dimension code identifiers of books, two-dimension code identification device and system
CN103544408A (en) * 2013-09-23 2014-01-29 中山大学 Method for embedment and extraction of PDF document hidden information according to composite font

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
计算机安全系统中随机序列发生器的研究;苏桂平 等;《计算机研究与发展》;20030731;第40卷(第7期);994-1000 *

Also Published As

Publication number Publication date
CN103942284A (en) 2014-07-23

Similar Documents

Publication Publication Date Title
Hakak et al. Approaches for preserving content integrity of sensitive online Arabic content: A survey and research challenges
TWI670621B (en) Information encryption and decryption method and device
Panah et al. On the properties of non-media digital watermarking: a review of state of the art techniques
CN101227269B (en) Method for binding and publishing digital information or cryptographic key based on fingerprint frequency domain
CN110457873B (en) A watermark embedding and detection method and device
CN100507936C (en) A Robust Hash Image Authentication Method Based on Zernike Moments
US20150134971A1 (en) Apparatus and method for decrypting encrypted file
CN101976321A (en) Generated encrypting method based on face feature key
WO2018165811A1 (en) Method for saving and verifying biometric template, and biometric recognition apparatus and terminal
Koppu et al. A fast enhanced secure image chaotic cryptosystem based on hybrid chaotic magic transform
CN104850765A (en) Watermark processing method, device and system
CN111475690B (en) Character string matching method and device, data detection method and server
WO2013162402A1 (en) Digital information protection method
CN105337742B (en) LFSR file encryption and decryption method based on face image features and GPS information
CN106778292B (en) A kind of quick restoring method of Word encrypted document
CN107257283B (en) Fingerprint Authentication Method Based on Quantum Graphic State
CN102194066A (en) Method for taking fingerprint information as key
CN103065278A (en) Multi-stage certification method aimed at shaft horse power (shp) line face image layer integrality
Katuk et al. An enhanced block pre-processing of PRESENT algorithm for fingerprint template encryption in the internet of things environment
CN102509058B (en) Point type GIS vector data disguise and recovery method based on redundant bit replacement
CN103942284B (en) File fingerprint information extracting method based on sine function
CN104363089B (en) A kind of method that fuzzy vault is realized based on geographical location information
CN104065488A (en) Method for authenticating microprocessor card cloud management system based on combined public keys
Yi et al. A robust digital watermarking for medical images based on PHTs-DCT
Saini A survey on watermarking web contents for protecting copyright

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant