CN111192187B - Decryption method and system - Google Patents
Decryption method and system Download PDFInfo
- Publication number
- CN111192187B CN111192187B CN201911102778.2A CN201911102778A CN111192187B CN 111192187 B CN111192187 B CN 111192187B CN 201911102778 A CN201911102778 A CN 201911102778A CN 111192187 B CN111192187 B CN 111192187B
- Authority
- CN
- China
- Prior art keywords
- array
- encryption
- key
- tail
- head
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000003491 array Methods 0.000 claims description 49
- 238000004590 computer program Methods 0.000 claims description 8
- 238000000605 extraction Methods 0.000 claims description 8
- 238000004422 calculation algorithm Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 9
- 230000010365 information processing Effects 0.000 description 6
- 239000000654 additive Substances 0.000 description 3
- 230000000996 additive effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/0021—Image watermarking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Technology Law (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- General Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Storage Device Security (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Facsimile Transmission Control (AREA)
Abstract
The invention discloses a decryption method and a system, wherein the decryption method comprises the steps of firstly, establishing a pixel array to be decrypted of a picture to be decrypted; secondly, acquiring a head position and/or a tail position in the pixel array to be decrypted, and determining a unit grid array according to the head position and/or the tail position; then, extracting an encryption key from the unit grid array according to the head position and/or the tail position; and finally, comparing the obtained encryption key with a preset encryption key. By adopting the decryption method, the images can be effectively prevented from being stolen.
Description
Technical Field
The invention belongs to the field of picture processing, and particularly relates to a decryption method and system.
Background
With the improvement of intellectual property consciousness, people attach more and more importance to the copyright of personal works, such as photographed photos, drawn images and the like, encryption is carried out, and as the existing method for preventing the pictures from being stolen is mainly to add watermarks to the pictures, people can intuitively see the pictures without decrypting the pictures when using the pictures, but the watermarks influence the attractiveness of the pictures and are not easy to remove, and when people only cut a part of the pictures for use, no method is provided for proving the copyright of the pictures. Therefore, other encryption methods are adopted in the prior art, so that whether the picture is stolen or not needs to be decrypted, and the encrypted picture is decrypted, and the technical problem to be solved is becoming more and more urgent.
Disclosure of Invention
The technical problem to be solved by the invention is to overcome the defects of the prior art, and provide a decryption method and a decryption system, wherein the decryption method can effectively prevent the images from being stolen.
In view of the above, the present invention aims to provide a decryption method, which adopts the following technical scheme:
a decryption method, the decryption method including,
establishing a pixel array to be decrypted of the picture to be decrypted;
acquiring a head position and/or a tail position in a pixel array to be decrypted, and determining a unit grid array according to the head position and/or the tail position;
extracting an encryption key from the unit grid array according to the head position and/or the tail position;
and comparing the obtained encryption key with a preset encryption key.
Further, the decryption method further comprises the steps of,
extracting the first three elements and the single digit values of the values of all pixel point arrays in the pixel array to be decrypted;
the extracted single digit values of the preset head position and/or the preset tail position are processed to obtain a head key and/or a tail key of the picture to be decrypted;
comparing the acquired head key and/or tail key with a preset head key and/or tail key, determining the head position and/or tail position, and determining the unit grid array.
Further, extracting the encryption key in the unit cell array includes at least,
starting from a first pixel point array after the head position of a first row of the grid array is finished, sequentially extracting a single digit value from every other two pixel point arrays in the row array of the grid array, and extracting every other two row arrays in the grid array until all encryption elements are extracted, and/or finishing extraction after the encryption elements of a tail key are extracted.
Further, the decryption method may further comprise converting the encryption element of the encryption key into an encryption key, in particular,
converting the encryption elements of all the extracted encryption keys into an encryption array;
converting the encrypted array into a number;
and converting the numbers into character strings according to the dictionary table, wherein the character strings are encryption keys.
It is also an object of the present invention to provide a decryption system comprising at least one processor and at least one memory;
the memory stores a computer program for executing the decryption method described above, and the processor calls the computer program in the memory to execute the decryption method described above.
It is also an object of the present invention to provide a decryption system, comprising,
the pixel array establishing module is used for establishing a pixel array to be decrypted of the picture to be decrypted;
the acquisition module is used for identifying the head position and/or the tail position in the pixel array to be decrypted and determining a unit grid array according to the head position and/or the tail position;
the extraction module is used for extracting the encryption key from the unit grid array according to the head position and/or the tail position;
and the comparison module is used for comparing the acquired encryption key with a preset encryption key.
The decryption method of the invention can rapidly and effectively acquire whether the picture is stolen or not, and further, even if the encrypted picture is cut, the encryption information can be decrypted according to part of the picture, so that the decryption method of the invention can effectively prevent the picture from being stolen and improve the use safety of the picture.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow diagram of an encryption method according to an embodiment of the present invention;
FIG. 2 illustrates a grid array diagram in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of an array of equally divided pixels in a grid in accordance with an embodiment of the present invention;
fig. 4 is a schematic diagram showing an encryption information processing flow using a character string as encryption information in the embodiment of the present invention;
FIG. 5 is a schematic diagram of an encryption information arrangement in a grid array to be encrypted according to an embodiment of the present invention;
FIG. 6 is a flow chart of a decryption method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an encryption system according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a decryption system according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of another encryption system according to an embodiment of the present invention;
fig. 10 shows a schematic structural diagram of another decryption system in an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, an encryption method is described in the embodiment of the present invention, firstly, a pixel array of a picture to be encrypted is established, secondly, the pixel array of the picture to be encrypted is equally divided into one or more grid arrays, then, the same encryption information is added into the grid arrays to obtain an encrypted pixel array, and finally, the encrypted picture is configured according to the encrypted pixel array. Thereby achieving the purpose of encrypting the picture and preventing the picture from being stolen.
Specifically, a picture has a large amount of pixel information, and a pixel point includes an RGB color value and an Alpha transparency value (also referred to as a channel value), where RGB represents Red Green Blue, and R parameter values, G parameter values, B parameter values, and Alpha transparency values are all in a range of 0 to 255, so that the pixel information of the picture is composed of a plurality of numbers, and therefore, the pixel information of the picture can be regarded as a one-dimensional array composed of a plurality of numbers; thus, a pixel array of the picture to be encrypted is established, namely, one pixel point can be regarded as a one-dimensional array formed by four digits of RGB color values and Alpha transparency values, so that the original pixel array of the picture to be encrypted is a two-dimensional array taking the one-dimensional array of one pixel point as a unit, the height and the width of the picture to be encrypted are recorded, and further, the pixel point array further comprises one or more line number groups formed by the pixel point arrays. Preferably, a one-dimensional array of pixels is recorded as an array of pixels. Further, according to the encryption information, determining the height and width of a unit grid array capable of adding the encryption information; and equally dividing the picture pixel array to be encrypted into one or more grid arrays according to the height and the width of the unit grid array. The pixel point array in the grid array is a part of the picture pixel array to be encrypted. As the data format of the grid array is exemplarily shown in fig. 2, the grid array forms a row number group of the grid array for the pixel point array of each row, and only a part of the pixel point arrays in the grid array are shown in fig. 2. Preferably, the picture to be encrypted can be regarded as a two-dimensional array formed by one or more grid arrays, and when the encrypted picture is divided into grids, a sufficient number of pixel point groups in the grid arrays meeting the grid can be added to all the encrypted information, so that the length of the encrypted information and the size of the original pixel point groups are considered at the same time when the grid is divided.
The encryption method further comprises adding a blank pixel point array, in the process of equally dividing the pixel array of the picture to be encrypted into one or more grid arrays according to the height and the width of the unit grid array, as shown in fig. 3, dividing the picture to be encrypted into a plurality of grids, wherein all grids in fig. 3 have the same height and width as those of the unit grid X, but when the picture is divided into the same grids, the picture to be encrypted does not meet the condition of equally dividing all grids, and then the picture to be encrypted needs to be equally divided into grids with the same height and width by adding the blank pixel point array, in fig. 3, the original height of the picture to be encrypted is H, the width is W, but when the grids are equally divided, part of grids are incomplete, so that the grids divided by the picture to be encrypted are the same by adding part of the blank pixel point array. The purpose of adding the blank pixel point array is to avoid writing errors caused by incomplete grid arrays when writing encryption information in each grid. Preferably, the total number of pixel point arrays in the grid array into which the pixel array of the picture to be encrypted is equally divided is the same as the total number of pixel point arrays in the unit grid array. Further preferably, when dividing the grid equally, if there is a grid that cannot be divided equally, a blank pixel array may be added according to the total number of pixel arrays in the unit grid array.
The encryption method further comprises the steps of presetting encryption information and encryption rules, wherein the encryption information comprises one or a combination of a head key, an encryption key and a tail key; the encryption rule comprises one or more of an encryption algorithm, an encryption key adding mode and an encryption information processing mode. Specifically, the header key, the encryption key or the tail key in the encryption information is usually an encryption string composed of a plurality of characters, the encryption string is required to be processed according to a preset encryption information processing mode, the encryption information processing mode can be that the encryption string is converted into corresponding numbers and then the numbers are converted into an encryption array, and finally encryption elements in the encryption array are adopted to encrypt the grid array. Specifically, as shown in fig. 4, taking the encryption key as a string 123abc and the preset rule as an exemplary description using a dictionary table, in fig. 4, first, the encryption string 123abc needs to be converted into a corresponding number, and the conversion of the encryption string into the corresponding number according to the dictionary table is as follows: 010203101112, then further, the numbers are converted into an encryption array, which is [0,1,0,2,0,3,1,0,1,1,1,2], such that the elements in the encryption array are all encryption elements. Preferably, the encryption information may be a combination of one or more encryption elements selected by the user.
Further specifically, when the head key, the encryption key or the tail key in the encryption information is added to the grid array, the same encryption algorithm can be adopted, and the encryption algorithm at least comprises encryption elements in the head key, the encryption key or the tail key are added to the pixel point array to be encrypted, so that the number of units of the sum value of the first three elements in the encrypted pixel point array is equal to the encryption elements. The specific encryption algorithm steps can be as follows: firstly, determining a pixel point array to be encrypted and an encryption element; secondly, performing addition operation on the first three elements in the encrypted pixel point array to obtain a single digit value of the first three elements and the value, and then subtracting the single digit value from the encrypted element to obtain a difference value between the first three elements and the value; and finally, carrying out operation on the difference value and one or more of the first three elements in the pixel point array according to an addition rule to obtain an encrypted pixel point array, wherein the encrypted pixel point array meets the first three elements and is added, and the obtained sum value is equal to the encryption element. When the difference value is calculated with the first three elements in the pixel point array, the calculation result of any element in the first three elements still needs to be within 0-255, so that the step of calculating the difference value with one or more of the first three elements in the pixel point array according to an addition rule to obtain an encrypted pixel point array further comprises the steps of adding an element smaller than 0 to 10 if the element exists in the encrypted pixel point array and subtracting an element larger than 255 from 10 if the element exists in the encrypted pixel point array and is larger than 255. Preferably, the encryption algorithm is not limited to making only the single digit value of the sum value of the first three-bit elements in the encrypted pixel point array equal to the encryption element, but may also be the case that the single digit value of any one element in the first three-bit elements in the pixel point array is equal to the encryption element or the single digit value of the sum value of the four-bit elements in the encrypted pixel point array is equal to the encryption element.
Further, the rule for adding the difference is exemplified and at least comprises the steps of integrating the difference into an array form with three elements, wherein only one difference is used, so that a value of 0 and the difference are integrated into a one-dimensional array with three elements; for example, the difference value is 4, and may be integrated into [4, 0], but not limited to [4, 0], or [0,4,0], and then the difference value is added to the first three elements in the pixel point array respectively to obtain an encrypted pixel point array, for example, the pixel point array is [21,31,65,255], and the added array is [25,31,65,255]. Further, the adding rule in the encryption algorithm may be to split the difference value, that is, split the difference value into one or more adding elements; then integrating the split added numbers into a one-dimensional array with three elements; because the split added number is added with the first three elements of the pixel point array to be encrypted, when the difference value is split, the number of the split elements is at most 3. Preferably, the numerical value difference is divided as evenly as possible, so that the quality of the picture can be ensured, and the display of the picture is not influenced. Preferably, the encryption algorithm has non-uniqueness, but the resulting bit value obtained by adding the first three digits of the encrypted pixel point array is equal to the encrypted digit.
The pixel point array is [23,34,45,255] and the encryption element is 6, firstly, the first three elements of the pixel point array are added to obtain a sum value of 2; secondly, subtracting the number value of the unit from the encryption element to obtain a difference value of 4, adding the 4 into the first three elements in the pixel point array [23,34,45,255], and then dividing the difference value into three parts for exemplary explanation, wherein the 4 can be split into 2,1 and 1; and adding elements in the 2, 1-formed addition array [2, 1] and the first three elements in the pixel point array respectively to obtain the encrypted pixel point array [25,35,46,255]. Preferably, the 2,1 three-bit element is not limited to [2, 1] when the additive array is composed, and the order of the three-bit elements may be [1,2,1], [1, 2], or the like. Thus, the add array has non-uniqueness.
Similarly, the pixel point array is [1,23,3,255] and the encryption element is 1, firstly, the first three elements of the pixel point array are added to obtain a sum value of 7; secondly, subtracting the value of the unit number from the encryption element to obtain a difference value of-6, adding-6 into the first three elements in the pixel point array [1,23,3,255], and then dividing the value difference into three equal parts by adopting an exemplary description, wherein-6 can be split into-2, -2 and-2; and then-2, -2, -2 is formed into an addition array of [ -2, -2, -2], and finally elements in the addition array [ -2, -2, -2] are respectively added with the first three elements in the pixel point array to obtain the encrypted pixel point array [ -1,21,1,255]. And if the element-1 of the encrypted pixel point array is smaller than 0, performing addition operation on the element-1 and the element-10, and finally obtaining the encrypted pixel point array of [9,21,1,255]. When the element in the encrypted pixel point array is greater than 255, the element greater than 255 is subtracted from 10, and detailed description is omitted.
The trisection splitting of the difference value can be that firstly, the difference value is divided by 3, the equal value and the residual value are recorded, secondly, the residual value is divided by 2, the equal value and the residual value are recorded, and then the residual value divided by 2 is divided by 1, and the equal value is recorded; finally, correspondingly adding the three equal scores to obtain three added elements, taking a difference value of 4 as an example, firstly dividing the three added elements with 3 to obtain an equal score of 1, and the remaining value of 1, wherein the added elements divided with 3 are 1,1 and 1; then continuously dividing the remainder value by 2 to obtain an equivalent value of 0, and dividing the remainder value by 1, wherein the additive elements after dividing the remainder value by 2 are 0,0 and 0; then, continuously dividing the remainder value obtained by dividing the remainder value by 2 by 1 to obtain an equivalent value of 1, wherein the remainder value is 0 (the remainder value cannot be divided equally any more), and the additive elements obtained by dividing the remainder value by 1 are 1,0 and 0; the three calculated add elements are added to 2,1 so that the final add array is [2, 1], in summary, the add array is not unique. Preferably, the algorithm for adding the difference to the array of pixel points is not unique.
The rule of addition of the difference is part of the encryption algorithm, so that the above exemplary description is also part of the encryption algorithm.
Further, the same encryption information is added to all grid arrays obtained by equally dividing the picture to be encrypted, and in the process of obtaining the encrypted grid arrays, a head position, an encryption position and a tail position are required to be divided from the grid arrays, firstly, the head position is reserved in the grid arrays of the grid, and the head position is used for adding a head key. Wherein the head position occupies one or more pixel point arrays, and the one or more pixel point arrays may be continuous and/or discontinuous. Thus, the header key may be an encrypted array of one or more encrypted elements. Preferably, the head position occupies at least 9 pixel point arrays. For illustration in fig. 5, the head position is located at the upper left corner of the grid array, the number of pixel point arrays occupied by the head position is 9, and the arrangement mode is that the first three pixel point arrays of the first three rows of line arrays are sequentially occupied from the first pixel point array at the upper left corner of the unit grid, wherein the encryption arrays adopted by the head key are [1,2,3,4,5,6,7,8,9], and then 9 encryption elements in the encryption arrays are added to the head position. The arrangement mode of the head position is not unique to the head key, the pixel point array occupied by the head position and the position of the pixel point array can be determined according to the length of the head key, and the length of the head key can also be determined according to the head position. However, the head position and/or the head key cannot be too simple, for example, the head position only occupies 4 pixel point arrays, the head key only occupies four encryption elements, and there may be 4 unencrypted adjacent pixel point arrays in the encrypted picture, and when decryption is performed, the extracted content is the same as the head key, so that the head position and/or the head key is too simple, the probability that the head position is difficult to determine is increased, encryption quality is affected, and difficulty is brought to decryption.
Secondly, adding an encryption key into the grid array by taking the head position as a reference point according to an encryption key adding mode, wherein the method specifically comprises the following steps: determining a first position of a first encryption element in an encryption key in a grid array to be encrypted, starting from the first position, sequentially adding the encryption elements in the encryption key in the grid array to be encrypted, and further specifically, the adding mode of the encryption key is not limited to one mode, the adding mode of the encryption key can be adopted to add one encryption element in every n pixel point groups in a row array of the grid array from the encryption position of the first encryption element, and sequentially encrypting every n row arrays in the grid array, wherein n is more than or equal to 0. Taking fig. 5 as an example, the position of the first encryption element in fig. 5 is the first pixel array after the first row is ended at the head position of the grid array. In fig. 5, the encryption key is string 123abc, and the encryption array is [0,1,0,2,0,3,1,0,1,1,1,2], so that elements in the encryption array sequentially add one encryption element every two pixel point groups in the row array of the grid array from the position of the first encryption element, and encrypt the grid array every two row line groups in the grid array. Only a portion of the encryption elements are shown in fig. 5 due to the grid array restriction. The encryption key adding mode ensures that the picture is not distorted, and also plays a role in preventing the picture from being stolen. Preferably, the line groups of the grid array are all taken as X-axis, the column number groups of the grid array are taken as Y-axis, the encryption key is added in a mode of starting from the position of the first encryption element, the X-axis is to add one encryption element every n pixel points, and the Y-axis is to encrypt every n line groups in sequence, wherein n is more than or equal to 0.
And finally, after the encryption key addition is finished, determining a tail position in the grid array, and adding a tail key at the tail position, wherein the tail key is preferably immediately after the encryption key and is used as an end mark of the encryption key, and when the tail key is added, the addition is performed according to the addition mode of the encryption key. The array of pixels that incorporate the tail key thus constitutes the tail position of the grid array. Further, the tail position may be one or more pixel point arrays, and the tail key may be one or more encryption elements, where the tail position may determine the length of the tail key, or the tail key may determine the number of pixel point arrays occupied by the tail position and an arrangement manner thereof. Taking fig. 5 as an exemplary illustration, the tail key adopts a character string "&", the number corresponding to the character string "&" in the dictionary table is "56", the tail key array is [5,6], the encryption mode is adopted to start from the position of the first encryption element, one encryption element is added to every two pixel point groups in the row array of the grid array, and encryption is sequentially performed to every two row line arrays in the grid array. Preferably, when encrypting the grid array, adding a tail key as an end flag to the encryption key, and when adding the encryption key, adding the encryption key and the tail key to the grid sequentially, for example, the encryption key adopts a character string 123abc &withthe tail key, wherein the tail key is &. Further preferably, the adding manner of the tail position is not limited to the adding manner of the encryption key, but may be directly added to the last one or more pixel point arrays of the grid array, but the tail position is located in the pixel point array after the pixel point array occupied by the last encryption element in the encryption key.
In this embodiment, the encryption method further includes removing the blank pixel array, that is, removing the blank pixel array added in the encryption method from the encrypted picture, first, according to the width and height of the original picture to be encrypted, making the length of the pixel array set in the row array in the encrypted pixel array equal to the width of the original picture to be encrypted, making the length of the pixel array set in the column direction of the encrypted pixel array equal to the height of the original picture to be encrypted, and finally, cutting out the pixel array with the width and height equal to the original picture to be encrypted, that is, removing the redundant blank pixel array. Taking fig. 3 as an exemplary illustration, after the blank pixel point array is added to the original picture to be encrypted, the height H and the width W of the original picture to be encrypted are changed, after the encryption of the original picture to be encrypted is completed, the same head key, encryption key and tail key are added to each grid, and then the pixel array after the encryption of the picture to be encrypted is a new encrypted two-dimensional array, so that the length of the uplink array of the encrypted pixel array in the X-axis is equal to the width of the original picture to be encrypted, and the length of the set of all the pixel point arrays in the Y-axis is equal to the height of the original picture to be encrypted, and then interception is performed, namely, the redundant blank pixel point array is removed.
As shown in fig. 6, a decryption method is described in an embodiment of the present invention, where the decryption method includes, first, creating a pixel array to be decrypted of a picture to be decrypted, then, traversing the pixel array to be decrypted of the decrypted picture, searching and obtaining a head position and/or a tail position in the pixel array to be decrypted, and determining any unit grid array according to the head position and/or the tail position; then, according to the head position or the tail position, the encryption elements in the unit grid array are analyzed; and finally, converting the calculated encryption element into an encryption key, comparing the encryption key with a preset encryption key, and if the encryption key is consistent with the preset encryption key, decrypting the picture to be an original picture, thereby achieving the purpose of anti-theft picture. Specifically, the principle and/or method adopted by the original pixel array for establishing the decrypted picture and the pixel array for establishing the picture to be encrypted are the same, and are not described herein. When traversing the pixel array of the picture to be decrypted, firstly, reversely searching the head position and/or the tail position by adopting an encryption algorithm, thereby determining a unit grid array, and specifically, extracting the first three elements and the single digit values of the values of all pixel point arrays in the pixel array to be decrypted; the extracted single digit values of the preset head position and/or the preset tail position are processed to obtain a head key and/or a tail key of the picture to be decrypted; comparing the acquired head key and/or tail key with a preset head key and/or a preset tail key, determining one or more head positions and/or tail positions, and determining one or more unit grid arrays. After one or more unit grid arrays are determined, one or more unit grid arrays are selected, the head position or the tail position is used as a reference point in the selected one or more unit grid arrays, the unit number values of the corresponding pixel point arrays are reversely extracted according to an encryption key adding mode, all the extracted unit number values form an encryption array, the encryption array is reversely converted into an encryption key according to an encryption information processing mode, and finally the obtained encryption key is compared with a preset encryption key.
Taking fig. 5 as an example to illustrate the decryption process, as can be seen from fig. 5, the encryption information and encryption rule of the picture with the grid array of fig. 5 are: the head position adopts a 3x3 arrangement mode at the upper left corner of the grid, and the array corresponding to the head key is [1,2,3,4,5,6,7,8,9]; the encryption key is a character string 123abc, the corresponding encryption array is [0,1,0,2,0,3,1,0,1,1,1,2], and the first bit of the encryption key is the first bit pixel point array after the end of the first row head position of the grid array; the tail position is "&", the corresponding tail key array is [5,6], and the tail key and the encryption key are added in the same mode. When decrypting the picture with the grid of fig. 5, when traversing the original pixel array of the picture, obtaining the first three digit numbers of the pixel array and the first three digit numbers of the value of the picture to be decrypted, taking the first three digit numbers of the pixel array and the first three digit numbers of the value of the pixel array in the grid of fig. 5 as an example, and taking 1,2,3,0,2,2,1,2,2,0 as an example; 4,5,6,2,2,2,2,2,2,2;7,8,9,2,2,2,2,2,2,2; and thus, the number of units of the pixel point array at the position 3x3 of the upper left corner of the grid is 1,2,3,4,5,6,7,8 and 9, the head position and the head key of the encryption rule are satisfied, and the head position is determined, and the similar acquisition mode of the tail position will not be repeated. When a picture is taken, one or more head positions and/or tail positions can be obtained, one or more unit grid arrays can be obtained, any unit grid array is selected to extract the encryption elements, in the extraction process, the extraction rule is consistent with the encryption rule, after the head positions in fig. 5 are determined, the unit grid array is determined, the first pixel point array after the end of the head positions of the first row of the grid array is reversely arranged according to the encryption key adding mode, every two pixel point arrays are arranged in the row array of the grid array, and the single digit number is sequentially extracted in every two row arrays in the grid array until all the encryption elements are extracted, and/or the extraction is finished after the encryption elements of the tail key are extracted, then all the encryption elements of the extracted encryption keys are formed into the encryption array, the encryption array is converted into the encryption key according to the encryption rule, the decrypted encryption key is compared with the encryption key added into the picture, in the decryption process, the processing mode of finally converting all the encryption numbers into the encryption keys is opposite to the encryption key processing mode in the encryption process, if the encryption key is converted into a figure of fig. 35, and the encryption key is converted into a dictionary number 37c, and the encryption key is converted into a character string 37c according to the figure 35, and the encryption key is further converted into a character string 37c.
In this embodiment, the encryption information and the encryption rule may be customized, but the encryption information and the encryption rule of one encrypted picture have uniqueness, and the decryption method is also uniquely determined according to the encryption information and the encryption rule, so that after the picture is encrypted, even if the picture is cut into small parts, we can still obtain the encrypted character string, thereby achieving the purpose of preventing theft.
In this embodiment, the pixel array of the picture can also be regarded as a one-dimensional array composed of three color values of RGB, and the encryption and decryption methods of a picture are the same as the above methods, and will not be described again.
On the basis of the method, the embodiment of the invention also adaptively provides an encryption system, as shown in fig. 7, the encryption system sequentially comprises a pixel array establishing module, a pixel array processing module, an encryption module and a configuration module for realizing data connection, wherein the pixel array establishing module is used for establishing a pixel array of a picture to be encrypted; the pixel array processing module is used for equally dividing the pixel array of the picture to be encrypted into one or more grid arrays; the encryption module is used for adding the same encryption information into the grid array to obtain an encrypted pixel array; the configuration module is used for configuring the encrypted picture according to the encrypted pixel array. Specifically, the pixel array establishing module is further configured to enable the pixel array to be encrypted to include a row array, and take a pixel point array formed by four numbers as a minimum unit of the pixel array; the pixel array processing module is also used for determining the height and the width of a unit grid array capable of adding the encryption information according to the encryption information, and is also used for adding a blank pixel point array; the encryption module is also used for determining a head key, an encryption key and a tail key in the encryption information and encrypting the picture to be encrypted according to an encryption rule; the configuration module is also used for removing a blank pixel point array added in the encryption process of the encrypted picture.
The encryption system further comprises a preset module for presetting encryption information and encryption rules. Specifically, the encryption information preset by the preset module comprises one or a combination of a head key, an encryption key and a tail key; the encryption rule comprises one or more of an encryption algorithm, an encryption key adding mode and an encryption information processing mode.
On the basis of the method, the embodiment of the invention also adaptively provides a decryption system, as shown in fig. 8, wherein the decryption system comprises a pixel array establishing module, an acquiring module, an extracting module and a comparing module which are connected with each other through data; the pixel array establishing module is used for establishing a pixel array to be decrypted of the picture to be decrypted; the acquisition module is used for identifying the head position and/or the tail position in the pixel array to be decrypted and determining a unit grid array according to the head position and/or the tail position; the extraction module is used for extracting an encryption key from the unit grid array according to the head position and/or the tail position;
the comparison module is used for comparing the obtained encryption key with a preset encryption key.
On the basis of the above method, the embodiment of the present invention also adaptively provides an encryption system, as shown in fig. 9, where the system includes at least one processor and at least one memory; the memory stores a computer program for executing the encryption method described above, and the processor calls the computer program in the memory to execute the encryption method described above.
On the basis of the above method, the embodiment of the present invention also adaptively provides a decryption system, as shown in fig. 10, where the system includes at least one processor and at least one memory; the memory stores a computer program for executing the decryption method described above, and the processor calls the computer program in the memory to execute the decryption method described above.
Although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (5)
1. A decryption method, characterized in that: the method of decryption may include the steps of,
establishing a pixel array to be decrypted of the picture to be decrypted;
acquiring a head position and/or a tail position in a pixel array to be decrypted, and determining a unit grid array according to the head position and/or the tail position;
extracting an encryption key from the unit grid array according to the head position and/or the tail position;
comparing the obtained encryption key with a preset encryption key;
the method for obtaining the head position and/or the tail position in the pixel array to be decrypted and determining the unit grid array according to the head position and/or the tail position comprises the following steps:
extracting the first three elements and the single digit values of the values of all pixel point arrays in the pixel array to be decrypted;
the extracted single digit values of the preset head position and/or the preset tail position are processed to obtain a head key and/or a tail key of the picture to be decrypted;
comparing the acquired head key and/or tail key with a preset head key and/or tail key, determining the head position and/or tail position, and determining the unit grid array.
2. The decryption method according to claim 1, wherein: extracting the encryption key in the unit cell array includes at least,
starting from a first pixel point array after the head position of a first row of the grid array is finished, sequentially extracting a single digit value from every other two pixel point arrays in the row array of the grid array, and extracting every other two row arrays in the grid array until all encryption elements are extracted, and/or finishing extraction after the encryption elements of a tail key are extracted.
3. The decryption method according to claim 2, wherein: the decryption method further comprises converting the encryption element of the encryption key into the encryption key, in particular,
converting the encryption elements of all the extracted encryption keys into an encryption array;
converting the encrypted array into a number;
and converting the numbers into character strings according to the dictionary table, wherein the character strings are encryption keys.
4. A decryption system, characterized by: the system includes at least one processor and at least one memory;
the memory stores a computer program for performing the method of any one of claims 1-3, the processor invoking the computer program in memory to perform the method of any one of claims 1-3.
5. A decryption system, characterized by: the decryption system may comprise a processor configured to,
the pixel array establishing module is used for establishing a pixel array to be decrypted of the picture to be decrypted;
the acquisition module is used for identifying the head position and/or the tail position in the pixel array to be decrypted and determining a unit grid array according to the head position and/or the tail position;
the extraction module is used for extracting the encryption key from the unit grid array according to the head position and/or the tail position;
the comparison module is used for comparing the acquired encryption key with a preset encryption key;
wherein, discern head position and/or afterbody position in waiting to decrypt the pixel array, and according to head position and/or afterbody position, confirm the unit net array, include:
extracting the first three elements and the single digit values of the values of all pixel point arrays in the pixel array to be decrypted;
the extracted single digit values of the preset head position and/or the preset tail position are processed to obtain a head key and/or a tail key of the picture to be decrypted;
comparing the acquired head key and/or tail key with a preset head key and/or tail key, determining the head position and/or tail position, and determining the unit grid array.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911102778.2A CN111192187B (en) | 2018-08-27 | 2018-08-27 | Decryption method and system |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911102778.2A CN111192187B (en) | 2018-08-27 | 2018-08-27 | Decryption method and system |
CN201810982109.8A CN109068021B (en) | 2018-08-27 | 2018-08-27 | Encryption and decryption method and system |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810982109.8A Division CN109068021B (en) | 2018-08-27 | 2018-08-27 | Encryption and decryption method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111192187A CN111192187A (en) | 2020-05-22 |
CN111192187B true CN111192187B (en) | 2023-10-24 |
Family
ID=64756191
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911102778.2A Active CN111192187B (en) | 2018-08-27 | 2018-08-27 | Decryption method and system |
CN201810982109.8A Active CN109068021B (en) | 2018-08-27 | 2018-08-27 | Encryption and decryption method and system |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810982109.8A Active CN109068021B (en) | 2018-08-27 | 2018-08-27 | Encryption and decryption method and system |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN111192187B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111815723B (en) * | 2020-07-08 | 2024-04-12 | 北京华云安信息技术有限公司 | Data encryption method and device |
CN112437205B (en) * | 2020-11-18 | 2022-03-15 | 光谷技术有限公司 | Video encryption method and device |
CN113297613A (en) * | 2021-05-12 | 2021-08-24 | 捷德(中国)科技有限公司 | Key access method, key processing device, key processing equipment and computer storage medium |
CN113282911A (en) * | 2021-05-12 | 2021-08-20 | 捷德(中国)科技有限公司 | Identity authentication method, device, equipment and computer storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010256953A (en) * | 2009-04-21 | 2010-11-11 | Dainippon Printing Co Ltd | Encryption processing system for file |
CN102142074A (en) * | 2011-03-31 | 2011-08-03 | 东北大学 | Chaos based universal electronic file encryption and decryption method |
CN105488426A (en) * | 2015-11-30 | 2016-04-13 | 西安闻泰电子科技有限公司 | Mobile platform image encryption method |
CN107483193A (en) * | 2017-08-31 | 2017-12-15 | 郑州云海信息技术有限公司 | A kind of encryption method, decryption method, encryption device and decryption device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2404487A (en) * | 2003-07-31 | 2005-02-02 | Sony Uk Ltd | Access control for digital storage medium content |
JP4952627B2 (en) * | 2008-03-21 | 2012-06-13 | 富士通株式会社 | Image processing apparatus, image processing method, and image processing program |
JP2010045744A (en) * | 2008-08-18 | 2010-02-25 | Fujitsu Ltd | Method and system for encrypting document data |
JP6572787B2 (en) * | 2016-01-27 | 2019-09-11 | セイコーエプソン株式会社 | Image scanner and image scanning system |
CN107154851B (en) * | 2017-06-30 | 2020-09-08 | 上海众人网络安全技术有限公司 | Data encryption and decryption method and device |
-
2018
- 2018-08-27 CN CN201911102778.2A patent/CN111192187B/en active Active
- 2018-08-27 CN CN201810982109.8A patent/CN109068021B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010256953A (en) * | 2009-04-21 | 2010-11-11 | Dainippon Printing Co Ltd | Encryption processing system for file |
CN102142074A (en) * | 2011-03-31 | 2011-08-03 | 东北大学 | Chaos based universal electronic file encryption and decryption method |
CN105488426A (en) * | 2015-11-30 | 2016-04-13 | 西安闻泰电子科技有限公司 | Mobile platform image encryption method |
CN107483193A (en) * | 2017-08-31 | 2017-12-15 | 郑州云海信息技术有限公司 | A kind of encryption method, decryption method, encryption device and decryption device |
Also Published As
Publication number | Publication date |
---|---|
CN109068021B (en) | 2020-02-14 |
CN109068021A (en) | 2018-12-21 |
CN111192187A (en) | 2020-05-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111192187B (en) | Decryption method and system | |
EP2154878A1 (en) | Image encyption device, image decyption device, method, and program | |
WO2020073508A1 (en) | Method and device for adding and extracting audio watermark, electronic device and medium | |
CN105281894B (en) | Plaintext encryption method and system based on seven-order magic cube | |
US11196538B2 (en) | Image encryption method and apparatus, sensor and readable storage medium | |
CN108650434A (en) | A kind of method of image encryption | |
CN101527829B (en) | Method and device for processing video data | |
Majeed et al. | AN IMPROVED LSB IMAGE STEGANOGRAPHY TECHNIQUE USING BIT-INVERSE IN 24 BIT COLOUR IMAGE. | |
JP6543764B2 (en) | Security authentication method for digital video content and system therefor | |
Goli et al. | Introducing a new method robust against crop attack in digital image watermarking using two-step sudoku | |
CN103745479A (en) | Digital steganography and steganalysis method for color image | |
CN112788195A (en) | Image processing method, device and equipment | |
KR102438102B1 (en) | Apparatus, method, computer-readable storage medium and computer program for encrypting information using image steganography | |
CN111026583B (en) | Backup recovery method for multi-private key of blockchain wallet and computer readable storage medium | |
CN116089984B (en) | A leak-proof management method and system for administrative documents | |
CN106228503B (en) | The digital watermark embedding and extracting method of satellite remote-sensing image SHP dot files | |
CN117560456A (en) | Large model data leakage prevention method and system | |
CN115879126B (en) | Medical information sharing method based on secure cloud storage, electronic equipment and storage medium | |
CN109981917A (en) | A kind of image in 2 D code optical encryption method and its system, device, storage medium | |
CN117879845B (en) | Video data file encryption protection method and system based on block chain | |
CN112380551B (en) | A dual-image-based reversible data hiding method and system | |
CN107135395B (en) | A Method of Steganography and Extraction of Secret Information in Digital Color Image | |
CN109727237B (en) | Image Tampering Detection Method Based on Mixed Description of Uniform Feature Points | |
CN113362042B (en) | Government affair service integrated management workflow design modeling method | |
US9972061B2 (en) | Method and apparatus for generating anti-forgery image |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |