CN110688667A - Picture file processing method and device, terminal equipment and medium - Google Patents

Picture file processing method and device, terminal equipment and medium Download PDF

Info

Publication number
CN110688667A
CN110688667A CN201910955246.7A CN201910955246A CN110688667A CN 110688667 A CN110688667 A CN 110688667A CN 201910955246 A CN201910955246 A CN 201910955246A CN 110688667 A CN110688667 A CN 110688667A
Authority
CN
China
Prior art keywords
file
data
information
length
interval
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.)
Pending
Application number
CN201910955246.7A
Other languages
Chinese (zh)
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.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Infinite Light Field 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 Beijing Infinite Light Field Technology Co Ltd filed Critical Beijing Infinite Light Field Technology Co Ltd
Priority to CN201910955246.7A priority Critical patent/CN110688667A/en
Publication of CN110688667A publication Critical patent/CN110688667A/en
Pending legal-status Critical Current

Links

Images

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/602Providing cryptographic facilities or services
    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • 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)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The disclosure discloses a picture file processing method, a picture file processing device, terminal equipment and a medium. The method comprises the following steps: determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, wherein the interval identification data is used for identifying the file interval; encrypting the data of the file interval to obtain an enhanced file of the picture file; forming decryption information with preset decryption length based on the file length information and the interval identification data; and writing the decryption information into a file setting position of the enhanced file to obtain an encrypted file of the picture file. By the method, the safety of the picture can be improved.

Description

Picture file processing method and device, terminal equipment and medium
Technical Field
The embodiment of the disclosure relates to the technical field of image processing, and in particular relates to a picture file processing method, a picture file processing device, terminal equipment and a medium.
Background
With the rapid development of computer technology, people often involve a large number of pictures in daily life and work. For example, in a house source application, in order to show details of a house source to a user, a picture of the house source is shown to the user on a detail page of the house source, so that the user can know the house source deeply. With the increase of pictures, the security of the pictures becomes a technical problem to be solved urgently, such as the copyright attribution problem of the pictures, that is, how to ensure that the pictures are not plagiarized.
At present, in order to ensure the copyright ownership of a picture, a picture owner usually performs watermarking on the picture. However, the watermark can be removed by a certain method, resulting in poor picture security.
Disclosure of Invention
The embodiment of the disclosure provides a picture file processing method, a picture file processing device, terminal equipment and a medium, so as to improve the safety of pictures.
In a first aspect, an embodiment of the present disclosure provides a method for processing an image file, including:
determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, wherein the interval identification data is used for identifying the file interval;
encrypting the data of the file interval to obtain an enhanced file of the picture file;
forming decryption information with preset decryption length based on the file length information and the interval identification data;
and writing the decryption information into a file setting position of the enhanced file to obtain an encrypted file of the picture file.
In a second aspect, an embodiment of the present disclosure further provides a method for processing a picture file, including:
reading decryption information with a preset decryption length and an enhanced file from an encrypted file of a picture file, wherein the position of the decryption information in the encrypted file is determined based on the file setting position of the enhanced file;
and decrypting the enhanced file based on the decryption information to obtain the picture file.
In a third aspect, an embodiment of the present disclosure further provides an image file processing apparatus, including:
the interval determining module is used for determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, and the interval identification data is used for identifying the file interval;
the enhancement processing module is used for encrypting the data of the file interval to obtain an enhancement file of the picture file;
a decryption information forming module, configured to form decryption information with a preset decryption length based on the file length information and the interval identification data;
and the encrypted file obtaining module is used for writing the decryption information into the file setting position of the enhanced file to obtain an encrypted file of the picture file.
In a fourth aspect, an embodiment of the present disclosure further provides an image file processing apparatus, including:
the reading module is used for reading decryption information with a preset decryption length and an enhanced file from an encrypted file of a picture file, wherein the position of the decryption information in the encrypted file is determined based on the file setting position of the enhanced file;
and the decryption module is used for decrypting the enhanced file based on the decryption information to obtain the picture file.
In a fifth aspect, an embodiment of the present disclosure further provides a terminal device, including:
one or more processing devices;
storage means for storing one or more programs;
the one or more programs are executed by the one or more processing devices, so that the one or more processing devices implement the methods provided by the embodiments of the present disclosure.
In a sixth aspect, the disclosed embodiments also provide a computer readable medium, on which a computer program is stored, which when executed by a processing device implements the method provided by the disclosed embodiments.
The embodiment of the disclosure provides a picture file processing method, a picture file processing device, terminal equipment and a picture file processing medium, wherein a file interval of a picture file is determined based on file length information of the picture file and preset interval identification data, and the interval identification data is used for identifying the file interval; then, encrypting the data of the file interval to obtain an enhanced file of the picture file; secondly, based on the file length information and the interval identification data, decryption information with preset decryption length is formed; and finally, writing the decryption information into a file setting position of the enhanced file to obtain an encrypted file of the picture file. By means of the technical scheme, the picture file can be encrypted, and the safety of the picture is improved.
Drawings
Fig. 1 is a schematic flowchart of a picture file processing method according to a first embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a picture file processing method according to a second embodiment of the disclosure;
fig. 3 is a schematic flowchart of a picture file processing method according to a third embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an image file processing apparatus according to a fourth embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a picture file processing apparatus according to a fifth embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a terminal device according to a sixth embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution. Furthermore, the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
Example one
Fig. 1 is a schematic flowchart of a picture file processing method according to an embodiment of the present disclosure, where the method is applicable to a situation of improving picture security, and the method may be executed by a picture file processing apparatus, where the apparatus may be implemented by software and/or hardware and is generally integrated on a terminal device, and in this embodiment, the terminal device includes but is not limited to: mobile phones, computers, personal digital assistants, and the like. The terminal device in this embodiment can realize the collection of the picture, store the collected picture in the format of the picture file, and encrypt the picture file in the storage process to improve the security of the picture file.
As shown in fig. 1, a picture file processing method provided in a first embodiment of the present disclosure includes the following steps:
s110, determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, wherein the interval identification data is used for identifying the file interval.
In this embodiment, the picture file may be an extreme disk file depicting one image. And storing the pictures in a picture file format in the terminal equipment after the pictures are collected. In order to improve the security of the picture, the embodiment may perform encryption processing on the picture file. Before encryption, the file length information of the picture file and the preset interval identification data can be determined in the step.
The file length information can be understood as the length occupied by the picture file. The file length information may be represented by the number of bytes, for example. Section identification data may be understood as data for identifying a file section, such as data identifying a file section of a picture file. In the step, the picture file can be encrypted by processing the data in the file interval of the picture file. The section identification data may be determined by file length information. Different picture files may have different file length information and, correspondingly, different section identification data. Specifically, the section identification data may be represented by file length information, such as L1 × m/n, where L1 is the file length information, m and n are positive integers, and m is smaller than n. For example, the interval identification data may be 0, L1/3 and L1 × 2/3.
It can be understood that there are some more important critical data information such as image data position information and width in the header information of the picture file. The picture may be opened based on the critical data information. Therefore, the section identification data in this step can identify the head position section (i.e. the section corresponding to the file start position) and at least one of the remaining position sections of the picture file. The rest position intervals can be any interval except the head position interval in the picture file.
In one embodiment, the number of the section identification data is at least one, the section identification data includes section start point information and section length information, and the section start point information is determined by the file length information.
The section identification data may include section start point information and section length information. The section start point information may be information indicating a section start point. The section length information indicates information of the length occupied by the section. The section identified by the section identification data may be determined based on the section start point information and the section length information.
The number of the interval identification data may be at least one, that is, the step may determine at least one file interval based on the file length information and the interval identification data. For example, data consisting of 8 bytes are respectively taken from the file start position, the L1/3 position and the L1 x 2/3 position of the picture file, so as to obtain three file sections.
The interval identification data may be preset for the terminal device, where the setting means is not limited, and may at least identify the start position of the file, so as to process the critical data information. The more the number of the interval identification data is, the more obvious the processing effect on the picture file is, for example, the higher the security is.
Specifically, the file interval of the picture file may be determined based on the file length information and the interval identification data. Wherein the section identification data may be determined by the file length information. The section start point information as in the section identification data may be determined by the file length information. In this step, the file length information can be substituted into the interval identification data to obtain the file interval of the picture file.
The specific process of determining the file interval in this step may be to substitute the file length information into the interval starting point information to obtain the interval starting point information of the current picture file, and then select an interval with the length of the interval length information from the position of the interval starting point information as the file interval.
And S120, encrypting the data in the file interval to obtain an enhanced file of the picture file.
After the file interval of the picture file is determined, data in the file interval can be encrypted, so that the safety of the picture file is improved. The encryption processing means is not limited, and includes but is not limited to at least one of the following: encryption and out-of-order processing. The means of encryption is not limited herein. The security of the enhanced file after the encryption processing is higher than that of the picture file.
And carrying out disorder processing on the data of the file interval through a disorder algorithm. An out-of-order algorithm may be understood as an algorithm that de-orders data according to a certain rule. The idea of a simple disorder algorithm can be that iteration is carried out from n to 1, a number is randomly extracted from 0 to n-1 in each iteration and is exchanged with the current number, and the sequence obtained finally is disorder. When the data after disorder is subjected to order recovery, the data after disorder can be adjusted according to the disorder rule to obtain the data before disorder.
It is to be understood that the means for encrypting the data of the file section may further include file length information of the confusing picture file. That is, a random number may be added to the picture file to confuse file length information of the picture file. The position of the random number in the picture file is not limited herein as long as the random number and the picture file can be distinguished at the time of decryption.
In the case that the enhancement file does not include a random number, the length of the enhancement file is the same as the length of the picture file; otherwise, the length of the obfuscated file is the same as that of the picture file, and the obfuscated file is formed before the random number is added to the picture file. The purpose of ensuring the same length here is to facilitate the determination of the file interval upon decryption.
S130, based on the file length information and the interval identification data, decryption information with preset decryption length is formed.
The decryption information may be understood as information required for decrypting an encrypted file of the picture file. Decryption of the encrypted file may be achieved, for example, based on the decryption information to obtain the picture file. The decryption information may include data that needs to be known in the decryption process, such as file length information and interval identification data.
The specific operation of forming decryption information is not limited based on the file length information and the interval identification data, for example, under the condition that the random number is not included in the enhanced file, the file length information and the interval identification data can be directly arranged according to a set sequence (or encrypted after being arranged according to the set sequence) to obtain key encryption data, and then after the encryption length data of the key encryption data is added to the key encryption data, preset characters (such as 0) are supplemented to form decryption information with preset decryption length; for another example, when the enhanced file includes the random number, the file length information, the interval identification data, and the random length information are arranged according to a set sequence (or encrypted after being arranged according to the set sequence) to obtain key encrypted data, and then the encrypted length data of the key encrypted data is added to the key encrypted data, and then the preset characters are supplemented to form decryption information of the preset encrypted length. The encryption length data may be understood as data indicating the length of the key encryption data for extracting the key encryption data from the decryption information. Wherein the random length information may be information indicating a length of a random number.
It should be noted that the length of the decryption information is a preset decryption length, so as to facilitate determining which data in the encrypted file is the decryption information in the decryption stage to obtain the decryption information. The specific value of the preset decryption length is not limited, and may be 1024 bytes, for example.
It should be noted that the execution order of the step is not limited, and may be executed before S140 is executed.
S140, writing the decryption information into the file setting position of the enhancement file to obtain the encrypted file of the picture file.
After the decryption information is obtained, the decryption information may be written into the file setting location of the enhanced file in this step, where the file setting location is not limited as long as the positional relationship between the decryption information and the enhanced file can be determined. The file setting positions include but are not limited to: the header of the enhancement file, the end of the enhancement file.
After the decryption information is written into the file setting position of the enhanced file, the encrypted file of the picture file can be obtained, and therefore the picture file is processed. After the file setting position of the enhanced file is written, the decryption information and the enhanced file can be conveniently extracted from the corresponding file setting position in the encrypted file. For example, the decryption information is written at the end of the enhancement file to form an encrypted file. In the decryption process, data with preset secret length can be directly read at the end of the encrypted file to serve as decryption information, and the rest data serve as enhancement files.
The picture file processing method provided by the first embodiment of the disclosure includes determining a file interval of a picture file based on file length information of the picture file and preset interval identification data, wherein the interval identification data is used for identifying the file interval; secondly, encrypting the data of the file interval to obtain an enhanced file of the picture file; then, based on the file length information and the interval identification data, decryption information with preset decryption length is formed; and finally writing the decryption information into a file set position of the enhanced file to obtain an encrypted file of the picture file. By the aid of the method, the picture file can be encrypted, and the safety of the picture can be improved.
Example two
Fig. 2 is a schematic flow chart of a picture file processing method provided in the second embodiment of the present disclosure, and the second embodiment is embodied on the basis of various alternatives in the above embodiments. In this embodiment, the data in the file interval is encrypted to obtain the enhanced file of the picture file, and the method further includes: carrying out disorder processing on the data of the file interval to obtain disorder data; encrypting the out-of-order data to obtain out-of-order encrypted data; and obtaining an enhanced file based on the disordered encrypted data and the picture file.
Further, in this embodiment, decryption information with a preset decryption length is formed based on the file length information and the interval identification data, and is further optimized as follows: under the condition that the enhancement file comprises the random number, encrypting the file length information, the random length information of the random number and the interval identification data to obtain key encryption data; otherwise, encrypting the file length information and the interval identification data to obtain key encrypted data;
and forming decryption information with a preset decryption length based on the key encryption data, the encryption length data of the key encryption data and the set characters, wherein the encryption length data is located at the length setting position of the decryption information, the encryption length data occupies the preset length information, and the key encryption data is located at the encryption setting position of the decryption information. Please refer to the first embodiment for a detailed description of the present embodiment.
As shown in fig. 2, a picture file processing method provided in the second embodiment of the present disclosure includes the following steps:
s210, determining a file interval of the picture file based on the file length information of the picture file and preset interval identification data.
And S220, carrying out disorder processing on the data of the file interval to obtain disorder data.
The embodiment refines the step of encrypting the data in the file interval to obtain the enhanced file of the picture file. Specifically, in this step, data in a file interval of the picture file is subjected to disorder processing to obtain disorder data.
The means of the out-of-order processing is not limited. The data of the first section and the data of the second section in the file section may be interchanged. The first interval and the second interval are determined without limitation. For example, odd and even bits in the data of the file section are sequentially interchanged. The first section may include all odd bits, and the second section may include all even bits.
And S230, encrypting the disordered data to obtain disordered encrypted data.
After the disorder data is obtained, the step can encrypt the disorder data to obtain the disorder encrypted data, and the encryption means is not limited.
S240, obtaining an enhanced file based on the disordered encrypted data and the picture file.
After the disorder encrypted data are obtained, the disorder encrypted data can be written into a file interval of the picture file in sequence, original data in the file interval are replaced, and an enhanced file is obtained; the security of the picture file can be further enhanced, namely, the disordered encrypted data is written into a file interval of the picture file to obtain the obfuscated file. And then writing a random number in the set position of the obfuscated file to obtain an enhanced file. The content of the random number is not limited as long as the length can be determined. The setting position is not limited as long as the position of the random number can be determined in the enhancement file, such as writing the random number at the end of the obfuscated file.
In one embodiment, writing the out-of-order encrypted data into a file interval of the picture file to obtain an obfuscated file; generating a random number; forming an enhancement file based on the random number and the obfuscated file.
And writing a random number with the length of the random length information at a set position of the obfuscated file so as to read data with the length of the random length information at a corresponding set position in the enhanced file as the random number, wherein the rest data is the obfuscated file. The random length information may be regarded as information of the length occupied by the random number, such as the number of bytes occupied by the random number. The setting position is not limited, and only the terminal devices for transmitting the picture file are appointed in advance.
In one example, a random number with a length of random length information is written at the end of the obfuscated file, resulting in an enhanced file. In the process of obtaining the picture file based on the enhancement file, a random number with the length of random length information can be read from the tail of the enhancement file, and the residual data in the enhancement file is used as an obfuscated file.
In one example, a random number with a length of random length information is written in the header of the obfuscated file, resulting in an enhanced file. In the process of obtaining the picture file based on the enhancement file, a random number with the length being random length information can be read from the head of the enhancement file, and the residual data in the enhancement file is used as a confusion file.
S250, judging whether the enhancement file comprises a random number or not, if so, executing S260; if not, go to S270.
And determining to form decryption information based on whether the random number exists in the enhanced file after the enhanced file is obtained. Specifically, in the case where the random number is included in the enhancement file, S260 is performed; in case that the enhanced file includes the random number, S270 is performed.
S260, encrypting the file length information, the random length information of the random number and the interval identification data to obtain key encrypted data, and executing S280.
Under the condition that the enhanced file comprises the random number, the file length information, the random length information of the random number and the interval identification data can be encrypted to obtain key encrypted data. The file length information, the random length information of the random number and the interval identification data can be used when the picture file is obtained through decryption.
When the file length information, the random length information of the random number, and the section identification data are encrypted, the order of the three is not limited, and the three can be obtained only when the file length information, the random length information of the random number, and the section identification data are decrypted. Such as encryption in the order of file length information, random length information, and section identification data. The length occupied by the three can be predetermined, for example, the three all occupy 4 bytes. Therefore, when the key encrypted data is decrypted, 4 bytes of file length information can be extracted from the head part of the decrypted data, 4 bytes of file length information can be extracted from the tail part of the decrypted data, and the remaining four bytes are random length information.
And S270, encrypting the file length information and the interval identification data to obtain key encrypted data.
And under the condition that the enhanced file comprises the random number, encrypting the file length information and the interval identification data to obtain key encrypted data. When the file length information and the section identification data are encrypted, the order of the file length information and the section identification data is not limited, and the file length information and the section identification data can be obtained by decryption. The length occupied by the file length information and the section identification data may be predetermined. Such as all occupying 4 bytes. When the key encrypted data is decrypted, 4 bytes of file length information may be extracted from the head of the decrypted data, and 4 bytes of section identification data may be extracted from the tail.
S280, forming decryption information with a preset decryption length based on the key encryption data, the encryption length data of the key encryption data and the set characters, wherein the encryption length data are located at the length setting position of the decryption information, the encryption length data occupy the preset length information, and the key encryption data are located at the encryption setting position of the decryption information.
And after the key encrypted data are obtained, forming decryption information based on the key encrypted data, the encrypted length data of the key encrypted data and the set characters. Specifically, the arrangement order of the key encrypted data and the encrypted length data may be predetermined, for example, the encrypted length data is written in the head of the key encrypted data, and then the set character is added to obtain the decryption information with the length being the preset decryption length. The encrypted length data occupies the preset length information.
The length occupied by the set characters is determined by subtracting the encryption length data from the preset decryption length and subtracting the preset length information.
Illustratively, the encrypted length data of the preset length information is written in the head of the key encrypted data, and then the set character is written in the tail of the key encrypted data, so as to obtain the decryption information of the preset decryption length. Correspondingly, the encrypted length data is positioned at the length setting position of the decryption information as a head. The key encryption data is positioned at the position of the encryption setting position of the decryption information, which is a preset length information position away from the head.
When decrypting, reading data with the length of the preset length information from the head of the decryption information as the encrypted length data, and then reading the data with the length of the encrypted length data as the key encrypted data after encrypting the length data from the decryption information.
Illustratively, the key encrypted data occupies 1000 bytes, so the encrypted length data is 1000 bytes, when obtaining the encrypted information, the encrypted length data with the preset length information of 4 bytes is written in the head of the key encrypted data, and in order to obtain the decryption information with the preset decryption length of 1024 bytes, the set characters with 20 bytes are written in the end of the key encrypted data, thereby forming the decryption information. Therefore, the encrypted length data occupies 4 bytes of the preset length information at the length setting position of the decrypted data as the head. The key encryption data is positioned at the position 4 bytes away from the head of the encryption setting position of the decryption information, and the occupied length is encryption length data.
When decrypting, 4 bytes of encrypted length data can be read directly from the head of the decryption information, and then 1000 bytes of key encrypted data can be read after the encrypted length data.
And S290, writing the decryption information into the file setting position of the enhanced file to obtain an encrypted file of the picture file.
The present embodiment is described below by way of example:
the picture file processing method provided by the embodiment can be regarded as a safe and efficient picture encryption method suitable for the terminal device.
At present, a problem that a mobile phone (mobile terminal) frequently takes pictures to upload when a house source is released is that the copyright of the pictures belongs to, namely the problem that the pictures are guaranteed not to be plagiarized and the right can be maintained even after the pictures are plagiarized. The method provided by the embodiment can enable the pictures uploaded by the terminal equipment to be used only by application programs and applications developed by the terminal equipment (namely manufacturers corresponding to users of the terminal equipment for encrypting picture files), and other people cannot obtain the pictures or cannot open the pictures at last even if the pictures are obtained, and cannot access the pictures. The method comprises the following steps:
the pictures (files) are formatted, the header information of the files in the format has some important image data position information and high-width high-level key data information, and if the key information is unknown, the pictures cannot be opened, and the specific positions of the image data cannot be found. The key of the disclosure is to perform disorder and encryption processing on the key data of the picture, store the data (such as file length information, random length information of the random number and the interval identification data) in the disorder and encryption process (i.e. decryption information) to the end of the file (i.e. to the end of the enhanced file) after encryption processing, and perform corresponding decryption operation when the data is to be used, so as to obtain the original data of the picture, thereby achieving the effect of encrypting the picture. In addition, only a small amount of data is processed in the process, so that the method is high in efficiency, the calculated amount is small, and the file is only increased by about 2 kb. Specifically, the method comprises the following steps:
1. note that the picture file length (i.e., file length information) is L1.
2. The data (i.e. data in the file interval of the picture file) is taken as D1(D1 is data consisting of 8 bytes, 16 bytes or 32 bytes from the file start position, the L1/3 position and the L1 position, 2/3 position respectively), D2 is obtained by conducting disorder and encryption processing on D1, and 8 bytes are taken from D2 and written into the file start position, the L/3 position and the L2/3 position (the file length is not changed). The interval starting point information in the interval identification data is the file starting position, the L1/3 position and the L1 × 2/3 position, and the interval length information in the interval identification data takes 8 or 16 or 32 bytes.
3. Randomly generating a piece of data with the length of L2 (randomly acquired in 1-1024), and writing the data at the tail of the file (namely writing the tail of the confusion file obtained in the previous step to form an enhancement file).
4. And (3) encrypting the data (namely interval identification data) of the L1 and the L2, in a scrambling method (namely, in an encryption method such as AES and RSA) to obtain the encrypted length as confidential length data, then combining the encrypted length data and the set characters to obtain encrypted 1024-byte data (namely, ensuring the length of decryption information as preset decryption information so as to extract the decryption information from the encrypted file), and writing the encrypted 1024-byte data into the tail of the file (namely, writing the tail of the enhanced file) to obtain the final encrypted file.
5. When the application program developed by the user accesses, the decrypted file can be obtained only by the secret key and the reverse order of the method.
The second picture file processing method provided by the embodiment of the disclosure embodies the operation of obtaining the enhanced file and the operation of forming decryption information. By using the method, the data in the file interval of the picture file can be disordered and encrypted to obtain the enhanced file, and the enhanced file can comprise the random number, so that the file length information of the picture file is effectively confused. The decryption information is written into the set position of the enhanced file to obtain the encrypted file, so that the terminal equipment receiving the picture can decrypt the encrypted file successfully to obtain the picture file, and the safety of the picture file is effectively improved.
EXAMPLE III
Fig. 3 is a schematic flowchart of a picture file processing method according to a third embodiment of the present disclosure, where the method is applicable to a situation where security of a picture file is improved, and the method may be executed by a picture file processing apparatus, where the apparatus may be implemented by software and/or hardware and is generally integrated on a terminal device, and in this embodiment, the terminal device includes but is not limited to: mobile phones, computers, personal digital assistants, and the like. The terminal device in this embodiment may be a different terminal from the terminal device in the first embodiment. The terminal device in the first embodiment may be an encrypted terminal of a picture file, where the picture file is transmitted to the terminal device in this embodiment, and the two terminal devices may agree on a decryption method.
It can be understood that the two terminal devices may implement at least one of the following information: the encrypted length data is positioned at the length setting position of the decryption information; the encrypted length data occupies preset length information; the key encryption data is positioned at the encryption setting position of the decryption information; the positions and the occupied lengths of file length information, random length information and interval identification data in the key encrypted data; the file length information in the key encrypted data and the position and the occupied length of the interval identification data; the location of the random number in the obfuscated file; an encryption method used in each stage of encrypting the picture file; a method of out-of-order processing.
As shown in fig. 3, a method for processing a picture file provided in the third embodiment of the present disclosure includes the following steps:
s310, reading decryption information with a preset decryption length and an enhancement file from an encrypted file of a picture file, wherein the position of the decryption information in the encrypted file is determined based on the file setting position of the enhancement file.
It should be noted that, in this embodiment, the process of obtaining the picture file by decryption may be the reverse process of obtaining the picture file by encryption, and reference may be made to the above embodiment for details of this embodiment.
After the encrypted file is obtained, the embodiment may first read decryption information with a preset decryption length from the encrypted file, where data in the encrypted file except the decryption information is an enhanced file.
The location of the decryption information in the encrypted file may be determined based on the file-setting location of the enhancement file. For example, when the encrypted file is formed, the file setting position of the enhanced file is written as the head, and when the decryption information in the encrypted file is extracted, the decryption information with the preset decryption length can be read from the head of the encrypted file, and the rest data in the encrypted file is taken as the enhanced file.
S320, decrypting the enhanced file based on the decryption information to obtain the picture file.
After the decryption information is obtained, the enhanced file can be decrypted based on the decryption information, so that the picture file is obtained. The specific decryption operation may be performed in reverse order based on the method used in the encryption.
Specifically, information included in the decryption information, such as encrypted length data and key encrypted data, may be extracted first, and then file length information and the interval identification data may be obtained based on the key encrypted data, or file length information, random length information of the random number, and the interval identification data may be obtained based on the key encrypted data.
In the case where the random number is included in the enhancement file, the random number is first removed from the enhancement file to obtain an obfuscated file. It should be noted that, when obtaining the enhancement file based on the random number and the obfuscated file, the position relationship between the random number and the obfuscated file may be predetermined. And the decrypted mobile terminal reads the random number with the length of the random length information from the enhancement file based on the position relation, and takes the rest data as an obfuscated file. And finally, decrypting the data in the file interval of the obfuscated file to obtain the picture file.
The decryption means is not limited, and may be determined based on the means used when encrypting the data in the file section of the picture file. Means of decryption processing include, but are not limited to: decryption and reverse order processing.
And under the condition that the enhancement file does not contain the random number, directly decrypting the data in the file interval of the enhancement file to obtain the picture file.
Note that, in the case where the random number is not included in the enhancement file, the length of the enhancement file is the same as the file length information of the picture file. In the case where the enhancement file includes a random number, the length of the obfuscated file is the same as the file length information of the picture file. The purpose is to acquire data of the same file interval for processing. Namely, after the data in the file section of the picture file is encrypted, the data in the same file section can be obtained in the decryption stage for decryption, that is, the data in the file section of the obfuscated file is obtained for decryption or the data in the file section of the enhanced file is obtained for decryption.
In one embodiment, the decrypting the enhanced file based on the decryption information to obtain the picture file includes:
extracting file length information and interval identification data in the decryption information, wherein the interval identification data is used for identifying a file interval;
determining a file interval of the enhanced file based on the file length information and the interval identification data;
and decrypting the data of the file interval to obtain the picture file.
The positions and occupied lengths of the file length information and the interval identification data in the decryption information may be agreed in advance between the terminal devices of the first embodiment and the second embodiment. The means for determining the file section of the enhancement file may refer to the means for determining the file section of the picture file.
The decryption processing means may be determined based on the encryption processing means in the first embodiment, and specifically, the decryption processing includes, but is not limited to, performing decryption processing on data in the file section first, and then performing out-of-order processing, where the out-of-order processing means is determined based on the out-of-order processing means in the first embodiment. Because the data is scrambled in the first embodiment, the data is scrambled in the same manner, and the data is processed in a forward order. Therefore, the out-of-order processing in this embodiment may also be referred to as forward order processing, i.e. restoring the order of the data in the picture file interval.
In one embodiment, the extracting file length information and section identification data in the decryption information includes:
extracting encrypted length data with the length being preset length information at the length setting position of the decryption information;
extracting key encryption data from the decryption information based on an encryption setting position and the encryption length data;
and decrypting the key encrypted data to obtain file length information and interval identification data.
Specifically, data of which the length is the encrypted length data is read from the encryption setting position of the decryption information as the key encrypted data. The decryption means is determined based on the encryption means in the first embodiment, and is not limited herein. The file length information and the location and occupation length of the span identification data may be predetermined.
In one embodiment, the decrypting the enhanced file based on the decryption information to obtain the picture file includes: extracting file length information, interval identification data and random length information in the decryption information; based on the random length information, removing a random number in the decryption information to obtain a confusion file; determining a file interval of the obfuscated file based on the file length information and the interval identification data; and decrypting the data of the file interval to obtain the picture file.
Specifically, encrypted length data with the length being preset length information is extracted at the length setting position of the decryption information; extracting key encrypted data from the decryption information based on an encryption setting position and the encrypted length data, namely reading data with the length of the encrypted length data from the encryption setting position as the key encrypted data; and decrypting the key encrypted data to obtain file length information, interval identification information and random length information.
The random length information may indicate the length of the random number, and the present embodiment may remove the random number with the length of the random length information from the decryption information to obtain the obfuscated file. The location of the random number bit in the decrypted information may be predetermined.
And after determining the obfuscated file, determining the file interval of the obfuscated file by adopting a means of determining that the file intervals of the image files are the same. And then, decrypting the data in the file interval to obtain the picture file.
In one embodiment, the number of the section identification data is at least one, the section identification data includes section start point information and section length information, and the section start point information is determined by the file length information.
The third embodiment of the present disclosure provides a picture file processing method, which first reads decryption information and an enhancement file with a preset decryption length from an encrypted file of a picture file; and then decrypting the enhanced file based on the decryption information to obtain the picture file. By the method, the safety of the picture file can be improved.
Example four
Fig. 4 is a schematic structural diagram of a picture file processing apparatus according to a fourth embodiment of the present disclosure, which is applicable to a situation of improving picture security, where the apparatus may be implemented by software and/or hardware and is generally integrated on a terminal device.
As shown in fig. 4, the apparatus includes: an interval determination module 41, an enhancement processing module 42, a decryption information forming module 43 and an encrypted file obtaining module 44;
the interval determining module 41 is configured to determine a file interval of the picture file based on file length information of the picture file and preset interval identification data, where the interval identification data is used to identify the file interval;
the enhancement processing module 42 is configured to encrypt the data in the file interval to obtain an enhancement file of the picture file;
a decryption information forming module 43, configured to form decryption information with a preset decryption length based on the file length information and the interval identification data;
an encrypted file obtaining module 44, configured to write the decryption information into a file setting position of the enhanced file, so as to obtain an encrypted file of the picture file.
In this embodiment, the apparatus first determines a file interval of a picture file by an interval determination module 41 based on file length information of the picture file and preset interval identification data; then, the data in the file interval is encrypted through an enhancement processing module 42 to obtain an enhancement file of the picture file; then, a decryption information forming module 43 forms decryption information with a preset decryption length based on the file length information and the interval identification data; and finally, writing the decryption information into the file setting position of the enhanced file through an encrypted file obtaining module 44 to obtain an encrypted file of the picture file.
The embodiment provides a picture file processing device, which can improve the safety of pictures by encrypting picture files.
Further, the number of the section identification data is at least one, the section identification data includes section start point information and section length information, and the section start point information is determined by the file length information.
Further, the enhancement processing module 42 includes:
the disorder processing unit is used for performing disorder processing on the data of the file interval to obtain disorder data;
the encryption unit is used for encrypting the disordered data to obtain disordered encrypted data;
and the obtaining unit is used for obtaining an enhanced file based on the disordered encrypted data and the picture file.
Further, the obtaining unit is specifically configured to:
writing the disordered encrypted data into a file interval of the picture file to obtain a confusion file;
generating a random number;
forming an enhancement file based on the random number and the obfuscated file.
Further, the decryption information forming module 43 is specifically configured to:
under the condition that the enhancement file comprises the random number, encrypting the file length information, the random length information of the random number and the interval identification data to obtain key encryption data; otherwise, encrypting the file length information and the interval identification data to obtain key encrypted data;
and forming decryption information with a preset decryption length based on the key encryption data, the encryption length data of the key encryption data and the set characters, wherein the encryption length data is located at the length setting position of the decryption information, the encryption length data occupies the preset length information, and the key encryption data is located at the encryption setting position of the decryption information.
The picture file processing device can execute the picture file processing methods provided by the first and second embodiments of the disclosure, and has the corresponding functional modules and beneficial effects of the execution methods.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a picture file processing apparatus according to a fifth embodiment of the present disclosure, which is applicable to a situation of improving picture security, where the apparatus may be implemented by software and/or hardware and is generally integrated on a terminal device.
As shown in fig. 5, the apparatus includes: a reading module 51 and a decryption module 52;
the reading module 51 is configured to read decryption information and an enhancement file with a preset decryption length from an encrypted file of a picture file, where a position of the decryption information in the encrypted file is determined based on a file setting position of the enhancement file;
and the decryption module 52 is configured to decrypt the enhancement file based on the decryption information to obtain the picture file.
In this embodiment, the apparatus first reads the decryption information and enhancement file with a preset decryption length from the encrypted file of the picture file through the reading module 51; then, the decryption module 52 decrypts the enhancement file based on the decryption information to obtain the picture file.
The embodiment provides a picture file processing device which can improve the safety of picture files.
Further, the decryption module 52 specifically includes:
an extracting unit, configured to extract file length information and interval identification data in the decryption information, where the interval identification data is used to identify a file interval;
a determining unit configured to determine a file section of the enhanced file based on the file length information and the section identification data;
and the decryption unit is used for decrypting the data in the file interval to obtain the picture file.
Further, the extraction unit is specifically configured to:
extracting encrypted length data with the length being preset length information at the length setting position of the decryption information;
extracting key encryption data from the decryption information based on an encryption setting position and the encryption length data;
and decrypting the key encrypted data to obtain file length information and interval identification data.
Further, the decryption module 52 is specifically configured to:
extracting file length information, interval identification data and random length information in the decryption information;
based on the random length information, removing a random number in the decryption information to obtain a confusion file;
determining a file interval of the obfuscated file based on the file length information and the interval identification data;
and decrypting the data of the file interval to obtain the picture file.
Further, the number of the section identification data is at least one, the section identification data includes section start point information and section length information, and the section start point information is determined by the file length information.
The image file processing device can execute the image file processing method provided by the third embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a terminal device according to a sixth embodiment of the present disclosure. The terminal Device 400 in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a vehicle mounted terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a Digital TV, a desktop computer, etc. The terminal device 400 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the terminal device 400 may include one or more processing means (e.g., a central processing unit, a graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. One or more processing devices 401 implement the methods as provided by the present disclosure. In the RAM403, various programs and data necessary for the operation of the terminal apparatus 400 are also stored. The processing device 401, the ROM402, and the RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408, including, for example, magnetic tape, hard disk, etc., storage 408 for storing one or more programs; and a communication device 409. The communication means 409 may allow the terminal device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates a terminal apparatus 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer-readable medium may be contained in the terminal device 400; or may exist separately without being assembled into the terminal device 400.
The computer-readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device 400 to: determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, wherein the interval identification data is used for identifying the file interval; encrypting the data of the file interval to obtain an enhanced file of the picture file; forming decryption information with preset decryption length based on the file length information and the interval identification data; and writing the decryption information into a file setting position of the enhanced file to obtain an encrypted file of the picture file.
Or when the above-mentioned one or more programs are executed by the terminal device, cause the terminal device 400 to: reading decryption information with a preset decryption length and an enhanced file from an encrypted file of a picture file, wherein the position of the decryption information in the encrypted file is determined based on the file setting position of the enhanced file; and decrypting the enhanced file based on the decryption information to obtain the picture file.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the name of a module in some cases does not constitute a limitation on the module itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Example 1 provides a picture file processing method according to one or more embodiments of the present disclosure, including:
determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, wherein the interval identification data is used for identifying the file interval;
encrypting the data of the file interval to obtain an enhanced file of the picture file;
forming decryption information with preset decryption length based on the file length information and the interval identification data;
and writing the decryption information into a file setting position of the enhanced file to obtain an encrypted file of the picture file.
Example 2 in accordance with one or more embodiments of the present disclosure, the method of example 1,
the number of the section identification data is at least one, the section identification data includes section start point information and section length information, and the section start point information is determined by the file length information.
Example 3 in accordance with one or more embodiments of the present disclosure, the method of example 1,
the encrypting the data in the file interval to obtain the enhanced file of the picture file includes:
carrying out disorder processing on the data of the file interval to obtain disorder data;
encrypting the out-of-order data to obtain out-of-order encrypted data;
and obtaining an enhanced file based on the disordered encrypted data and the picture file.
Example 4 in accordance with one or more embodiments of the present disclosure, the method of example 3,
obtaining an enhanced file based on the out-of-order encrypted data and the picture file, including:
writing the disordered encrypted data into a file interval of the picture file to obtain a confusion file;
generating a random number;
forming an enhancement file based on the random number and the obfuscated file.
Example 5 in accordance with one or more embodiments of the present disclosure, the method of example 1,
the forming decryption information of a preset decryption length based on the file length information and the interval identification data includes:
under the condition that the enhancement file comprises the random number, encrypting the file length information, the random length information of the random number and the interval identification data to obtain key encryption data; otherwise, encrypting the file length information and the interval identification data to obtain key encrypted data;
and forming decryption information with a preset decryption length based on the key encryption data, the encryption length data of the key encryption data and the set characters, wherein the encryption length data is located at the length setting position of the decryption information, the encryption length data occupies the preset length information, and the key encryption data is located at the encryption setting position of the decryption information.
Example 6 provides a picture file processing method according to one or more embodiments of the present disclosure, including:
reading decryption information with a preset decryption length and an enhanced file from an encrypted file of a picture file, wherein the position of the decryption information in the encrypted file is determined based on the file setting position of the enhanced file;
and decrypting the enhanced file based on the decryption information to obtain the picture file.
Example 7 in accordance with one or more embodiments of the present disclosure, the method of example 6,
the decrypting the enhanced file based on the decryption information to obtain the picture file includes:
extracting file length information and interval identification data in the decryption information, wherein the interval identification data is used for identifying a file interval;
determining a file interval of the enhanced file based on the file length information and the interval identification data;
and decrypting the data of the file interval to obtain the picture file.
Example 8 in accordance with one or more embodiments of the present disclosure, the method of example 7,
the extracting of the file length information and the interval identification data in the decryption information includes:
extracting encrypted length data with the length being preset length information at the length setting position of the decryption information;
extracting key encryption data from the decryption information based on an encryption setting position and the encryption length data;
and decrypting the key encrypted data to obtain file length information and interval identification data.
Example 9 in accordance with one or more embodiments of the present disclosure, the method of example 6,
the decrypting the enhanced file based on the decryption information to obtain the picture file includes:
extracting file length information, interval identification data and random length information in the decryption information;
based on the random length information, removing a random number in the decryption information to obtain a confusion file;
determining a file interval of the obfuscated file based on the file length information and the interval identification data;
and decrypting the data of the file interval to obtain the picture file.
Example 10 in accordance with one or more embodiments of the present disclosure, the method of example 7 or 9,
the number of the section identification data is at least one, the section identification data includes section start point information and section length information, and the section start point information is determined by the file length information.
Example 11 provides, in accordance with one or more embodiments of the present disclosure, a picture file processing apparatus including:
the interval determining module is used for determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, and the interval identification data is used for identifying the file interval;
the enhancement processing module is used for encrypting the data of the file interval to obtain an enhancement file of the picture file;
a decryption information forming module, configured to form decryption information with a preset decryption length based on the file length information and the interval identification data;
and the encrypted file obtaining module is used for writing the decryption information into the file setting position of the enhanced file to obtain an encrypted file of the picture file.
Example 12 the apparatus of example 11, the number of the section identification data being at least one, the section identification data including section start point information and section length information, the section start point information being determined by the file length information, according to one or more embodiments of the present disclosure.
Example 13 the apparatus of example 11, the enhancement processing module comprising:
the disorder processing unit is used for performing disorder processing on the data of the file interval to obtain disorder data;
the encryption unit is used for encrypting the disordered data to obtain disordered encrypted data;
and the obtaining unit is used for obtaining an enhanced file based on the disordered encrypted data and the picture file.
Example 14 the apparatus of example 13, according to one or more embodiments of the present disclosure, the deriving unit, in particular, is to:
writing the disordered encrypted data into a file interval of the picture file to obtain a confusion file;
generating a random number;
forming an enhancement file based on the random number and the obfuscated file.
Example 15 the apparatus of example 11, the decryption information forming module 43, in accordance with one or more embodiments of the present disclosure, is specifically configured to:
under the condition that the enhancement file comprises the random number, encrypting the file length information, the random length information of the random number and the interval identification data to obtain key encryption data; otherwise, encrypting the file length information and the interval identification data to obtain key encrypted data;
and forming decryption information with a preset decryption length based on the key encryption data, the encryption length data of the key encryption data and the set characters, wherein the encryption length data is located at the length setting position of the decryption information, the encryption length data occupies the preset length information, and the key encryption data is located at the encryption setting position of the decryption information.
Example 16 provides, in accordance with one or more embodiments of the present disclosure, a picture file processing apparatus including: the reading module is used for reading decryption information with a preset decryption length and an enhanced file from an encrypted file of a picture file, wherein the position of the decryption information in the encrypted file is determined based on the file setting position of the enhanced file;
and the decryption module is used for decrypting the enhanced file based on the decryption information to obtain the picture file.
Example 17 the apparatus of example 16, the decryption module, according to one or more embodiments of the present disclosure, specifically comprising:
an extracting unit, configured to extract file length information and interval identification data in the decryption information, where the interval identification data is used to identify a file interval;
a determining unit configured to determine a file section of the enhanced file based on the file length information and the section identification data;
and the decryption unit is used for decrypting the data in the file interval to obtain the picture file.
Example 18 the apparatus of example 17, the extraction unit, in accordance with one or more embodiments of the present disclosure, is to:
extracting encrypted length data with the length being preset length information at the length setting position of the decryption information;
extracting key encryption data from the decryption information based on an encryption setting position and the encryption length data;
and decrypting the key encrypted data to obtain file length information and interval identification data.
Example 19 the apparatus of example 16, the decryption module, in accordance with one or more embodiments of the present disclosure, is to:
extracting file length information, interval identification data and random length information in the decryption information;
based on the random length information, removing a random number in the decryption information to obtain a confusion file;
determining a file interval of the obfuscated file based on the file length information and the interval identification data;
and decrypting the data of the file interval to obtain the picture file.
Example 20 the apparatus of example 17 or 18, wherein the number of the section identification data is at least one, the section identification data includes section start point information and section length information, and the section start point information is determined by the file length information.
Example 21 provides, in accordance with one or more embodiments of the present disclosure, a terminal device, comprising:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the method of any of examples 1-10.
Example 22 provides a computer-readable medium having stored thereon a computer program that, when executed by a processing apparatus, implements the method of any of examples 1-10, in accordance with one or more embodiments of the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (10)

1. A picture file processing method is characterized by comprising the following steps:
determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, wherein the interval identification data is used for identifying the file interval;
encrypting the data of the file interval to obtain an enhanced file of the picture file;
forming decryption information with preset decryption length based on the file length information and the interval identification data;
and writing the decryption information into a file setting position of the enhanced file to obtain an encrypted file of the picture file.
2. The method according to claim 1, wherein the number of the section identification data is at least one, the section identification data includes section start point information and section length information, and the section start point information is determined by the file length information.
3. The method according to claim 1, wherein the encrypting the data in the file interval to obtain the enhanced file of the picture file comprises:
carrying out disorder processing on the data of the file interval to obtain disorder data;
encrypting the out-of-order data to obtain out-of-order encrypted data;
and obtaining an enhanced file based on the disordered encrypted data and the picture file.
4. The method of claim 3, wherein obtaining an enhanced file based on the out-of-order encrypted data and the picture file comprises:
writing the disordered encrypted data into a file interval of the picture file to obtain a confusion file;
generating a random number;
forming an enhancement file based on the random number and the obfuscated file.
5. The method according to claim 1, wherein forming decryption information of a preset decryption length based on the file length information and the section identification data comprises:
under the condition that the enhancement file comprises the random number, encrypting the file length information, the random length information of the random number and the interval identification data to obtain key encryption data; otherwise, encrypting the file length information and the interval identification data to obtain key encrypted data;
and forming decryption information with a preset decryption length based on the key encryption data, the encryption length data of the key encryption data and the set characters, wherein the encryption length data is located at the length setting position of the decryption information, the encryption length data occupies the preset length information, and the key encryption data is located at the encryption setting position of the decryption information.
6. A picture file processing method is characterized by comprising the following steps:
reading decryption information with a preset decryption length and an enhanced file from an encrypted file of a picture file, wherein the position of the decryption information in the encrypted file is determined based on the file setting position of the enhanced file;
and decrypting the enhanced file based on the decryption information to obtain the picture file.
7. A picture file processing apparatus, comprising:
the interval determining module is used for determining a file interval of the picture file based on file length information of the picture file and preset interval identification data, and the interval identification data is used for identifying the file interval;
the enhancement processing module is used for encrypting the data of the file interval to obtain an enhancement file of the picture file;
a decryption information forming module, configured to form decryption information with a preset decryption length based on the file length information and the interval identification data;
and the encrypted file obtaining module is used for writing the decryption information into the file setting position of the enhanced file to obtain an encrypted file of the picture file.
8. A picture file processing apparatus, comprising:
the reading module is used for reading decryption information with a preset decryption length and an enhanced file from an encrypted file of a picture file, wherein the position of the decryption information in the encrypted file is determined based on the file setting position of the enhanced file;
and the decryption module is used for decrypting the enhanced file based on the decryption information to obtain the picture file.
9. A terminal device, comprising:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the method of any of claims 1-6.
10. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the method according to any one of claims 1-6.
CN201910955246.7A 2019-10-09 2019-10-09 Picture file processing method and device, terminal equipment and medium Pending CN110688667A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910955246.7A CN110688667A (en) 2019-10-09 2019-10-09 Picture file processing method and device, terminal equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910955246.7A CN110688667A (en) 2019-10-09 2019-10-09 Picture file processing method and device, terminal equipment and medium

Publications (1)

Publication Number Publication Date
CN110688667A true CN110688667A (en) 2020-01-14

Family

ID=69111811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910955246.7A Pending CN110688667A (en) 2019-10-09 2019-10-09 Picture file processing method and device, terminal equipment and medium

Country Status (1)

Country Link
CN (1) CN110688667A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187732A (en) * 2020-09-09 2021-01-05 北京幻想纵横网络技术有限公司 Data encryption and loading method and device
CN113190857A (en) * 2021-04-09 2021-07-30 作业帮教育科技(北京)有限公司 Picture processing method and device, electronic equipment and computer readable medium
CN115510473A (en) * 2022-11-24 2022-12-23 广州市千钧网络科技有限公司 Confidential resource processing method, processing device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402670A (en) * 2011-08-03 2012-04-04 广东欧珀移动通信有限公司 File encryption and decryption method
CN103366124A (en) * 2012-03-26 2013-10-23 宇龙计算机通信科技(深圳)有限公司 Terminal and file management method
US20140032924A1 (en) * 2012-07-30 2014-01-30 David M. Durham Media encryption based on biometric data
CN104091129A (en) * 2014-06-26 2014-10-08 腾讯科技(深圳)有限公司 Data processing method and device
CN106203128A (en) * 2015-04-30 2016-12-07 宋青见 Web data encipher-decipher method, device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402670A (en) * 2011-08-03 2012-04-04 广东欧珀移动通信有限公司 File encryption and decryption method
CN103366124A (en) * 2012-03-26 2013-10-23 宇龙计算机通信科技(深圳)有限公司 Terminal and file management method
US20140032924A1 (en) * 2012-07-30 2014-01-30 David M. Durham Media encryption based on biometric data
CN104091129A (en) * 2014-06-26 2014-10-08 腾讯科技(深圳)有限公司 Data processing method and device
CN106203128A (en) * 2015-04-30 2016-12-07 宋青见 Web data encipher-decipher method, device and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187732A (en) * 2020-09-09 2021-01-05 北京幻想纵横网络技术有限公司 Data encryption and loading method and device
CN113190857A (en) * 2021-04-09 2021-07-30 作业帮教育科技(北京)有限公司 Picture processing method and device, electronic equipment and computer readable medium
CN115510473A (en) * 2022-11-24 2022-12-23 广州市千钧网络科技有限公司 Confidential resource processing method, processing device and electronic equipment

Similar Documents

Publication Publication Date Title
CN110688667A (en) Picture file processing method and device, terminal equipment and medium
CN104680077B (en) Method for encrypting picture, method for viewing picture, system and terminal
CN107612683B (en) Encryption and decryption method, device, system, equipment and storage medium
JP2012212138A (en) Encryption program, decryption program, encryption method, decryption method, system, and content generation method
CN101103348A (en) Method and device for consuming rights objects having inheritance structure
CN112149168B (en) File data encryption method and device and electronic equipment
CN106778295B (en) File storage method, file display method, file storage device, file display device and terminal
CN104023332A (en) Electronic terminal and short message encrypting and decrypting method thereof
CN114390317B (en) Encryption method and system for streaming video
CN110545542B (en) Main control key downloading method and device based on asymmetric encryption algorithm and computer equipment
CN102685592A (en) Streaming media player method supporting digital rights management
CN111708680A (en) Error reporting information analysis method and device, electronic equipment and storage medium
CN116821941B (en) Data encryption and decryption method, device, equipment and storage medium
CN113032345A (en) File processing method, device, terminal and non-transitory storage medium
CN104092680A (en) Coding and decoding method, device and system for audio signal
CN102142072A (en) Encryption processing and decryption processing method and device of electronic files
CN111130805B (en) Secure transmission method, electronic device, and computer-readable storage medium
CN108985109B (en) Data storage method and device
CN114692100A (en) Digital watermark adding and extracting method and device, electronic equipment and readable medium
CN107463808B (en) Method for calling functional module integrated in operating system
CN114666624A (en) Video file encryption and decryption method
CN114491421A (en) File encryption method, file processing method, file encryption device, file processing device, readable medium and electronic equipment
CN110618967B (en) Application program running method, installation package generating method, device, equipment and medium
CN113961931A (en) Adb tool using method and device and electronic equipment
CN113987471A (en) Executable file execution method and device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20230427

Address after: Room 802, Information Building, 13 Linyin North Street, Pinggu District, Beijing, 101299

Applicant after: Beijing youzhuju Network Technology Co.,Ltd.

Address before: No. 715, 7th floor, building 3, 52 Zhongguancun South Street, Haidian District, Beijing 100081

Applicant before: Beijing infinite light field technology Co.,Ltd.

TA01 Transfer of patent application right