[go: up one dir, main page]

CN111192187A - Decryption method and system - Google Patents

Decryption method and system Download PDF

Info

Publication number
CN111192187A
CN111192187A CN201911102778.2A CN201911102778A CN111192187A CN 111192187 A CN111192187 A CN 111192187A CN 201911102778 A CN201911102778 A CN 201911102778A CN 111192187 A CN111192187 A CN 111192187A
Authority
CN
China
Prior art keywords
array
encryption
key
encrypted
tail
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.)
Granted
Application number
CN201911102778.2A
Other languages
Chinese (zh)
Other versions
CN111192187B (en
Inventor
崔顶峰
巩仔明
邱慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Youxin Shuxiang Beijing Information Technology Co ltd
Original Assignee
Youxin Shuxiang Beijing Information 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 Youxin Shuxiang Beijing Information Technology Co ltd filed Critical Youxin Shuxiang Beijing Information Technology Co ltd
Priority to CN201911102778.2A priority Critical patent/CN111192187B/en
Publication of CN111192187A publication Critical patent/CN111192187A/en
Application granted granted Critical
Publication of CN111192187B publication Critical patent/CN111192187B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting 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)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Multimedia (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (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 decryption system, wherein the decryption method comprises the following 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 acquired encryption key with a preset encryption key. By adopting the decryption method, the picture can be effectively prevented from being stolen.

Description

Decryption method and system
Technical Field
The invention belongs to the field of picture processing, and particularly relates to a decryption method and a decryption system.
Background
With the improvement of intellectual property consciousness, people pay more and more attention to the copyright of personal works, for example, shot photos, drawn images and the like are encrypted, and the existing method for preventing pictures from being stolen mainly adds watermarks to the pictures, so that the pictures can be visually seen without decryption when being used by other people, but the watermarks influence the attractiveness of the pictures and are not easy to remove, and when other people only cut part of the pictures for use, the copyright ownership of the pictures cannot be proved. Therefore, other encryption methods are also adopted in the prior art, so that whether the picture is stolen needs to be verified by decrypting the picture, and the encrypted picture is decrypted, which is also becoming a more and more urgent technical problem.
Disclosure of Invention
The technical problem to be solved by the present invention is to overcome the defects of the prior art, and to provide a decryption method and system, wherein the decryption method can effectively prevent pictures from being stolen.
In view of this, the present invention provides a decryption method, which adopts the following technical solutions:
a method of decryption, the method of decryption comprising,
establishing a pixel array to be decrypted of a 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 acquired encryption key with a preset encryption key.
Further, the decryption method may further include,
extracting the first three-digit numerical values of the first three-digit elements and values of all the pixel point arrays in the pixel array to be decrypted;
extracting and processing the extracted single digit numerical value of the preset head position and/or the preset tail position to obtain a head key and/or a tail key of the picture to be decrypted;
and 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 grid array at least comprises,
starting from the first pixel point array after the head position of the first row of the grid array is finished, sequentially extracting the numerical values of the digits in the row array of the grid array every two rows of the row array, and finishing the extraction until all the encrypted elements are extracted and/or the encrypted elements of the tail key are extracted.
Further, the decryption method may further comprise converting the encrypted element of the encryption key into the encryption key, and 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 invention to provide a decryption system, said system comprising at least one processor and at least one memory;
the memory stores a computer program for executing the decryption method, and the processor calls the computer program in the memory to execute the decryption method.
It is also an object of the 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 acquiring module is used for identifying 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;
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 can rapidly and effectively acquire whether the picture is stolen or not, and further, even if the encrypted picture is cut, the encrypted information can be decrypted according to part of the picture, so that the picture can be effectively prevented from being stolen, and the use safety of the picture is improved.
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 will 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 in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of an encryption method in an embodiment of the present invention;
FIG. 2 is a schematic diagram of a grid array in an embodiment of the invention;
FIG. 3 is a schematic diagram of an equally-divided grid pixel array in an embodiment of the invention;
FIG. 4 is a schematic diagram illustrating a processing flow of encrypted information using a character string as the encrypted information in the embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating an arrangement of encryption information in a to-be-encrypted grid array according to an embodiment of the present invention;
FIG. 6 is a flow chart of a decryption method in an embodiment of the invention;
FIG. 7 is a schematic diagram of an encryption system in an embodiment of the present invention;
fig. 8 shows a schematic structural diagram of a decryption system in an embodiment of the present invention;
FIG. 9 is a schematic diagram of another encryption system in an embodiment of the present invention;
fig. 10 shows a schematic structural diagram of another decryption system in the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an encryption method is introduced in the embodiment of the present invention, and includes first, establishing a pixel array of a picture to be encrypted, then, equally dividing the pixel array of the picture to be encrypted into one or more grid arrays, then, adding the same encryption information to the grid arrays to obtain encrypted pixel arrays, and finally, configuring the encrypted picture according to the encrypted pixel arrays. Therefore, the purpose of encrypting the picture and preventing the picture from being stolen is achieved.
Specifically, one picture has a large amount of pixel information, and one pixel point includes RGB color values and Alpha transparency values (also referred to as channel values), wherein RGB represents Red (Red) Green (Blue), and ranges of an R parameter value, a G parameter value, a B parameter value, and an Alpha transparency value are all 0 to 255, so that the pixel information of one picture is composed of many numbers, and thus, the pixel information of one picture can be regarded as a one-dimensional array composed of many numbers; the method comprises the steps of establishing a pixel array of a picture to be encrypted, namely, regarding one pixel point as a one-dimensional array consisting of four numbers of RGB color value and Alpha transparency value, taking an original pixel array of the picture to be encrypted as a two-dimensional array taking the one-dimensional array of the pixel point as a unit, and simultaneously recording the height and width of the picture to be encrypted. Preferably, the one-dimensional array of one pixel is recorded as the pixel array. Further, according to the encryption information, determining the height and the width of a unit grid array which can be added with 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. And the pixel point array in the grid array is a part of the pixel array of the picture to be encrypted. As an exemplary data format of the grid array is shown in fig. 2, as can be seen from fig. 2, the grid array is a row array in which pixel arrays of each row form a grid array, and only a part of the pixel arrays in the grid array is 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, enough pixel point arrays in the grid arrays meet the requirement that all the encryption information can be added, so that the length of the encryption information and the size of the original pixel array are considered simultaneously when the grids are divided.
The encryption method further comprises adding a blank pixel point array, dividing the encrypted picture into a plurality of grids according to the height and the width of the unit grid array in the process of equally dividing the pixel array of the picture to be encrypted into one or a plurality of grid arrays, as shown in fig. 3, wherein all the grids in fig. 3 have the same height and width as 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 the grids, the picture to be encrypted needs to be equally divided into the grids with the same height and width by adding the blank pixel point array, in fig. 3, the original height of the encrypted picture is H, the width of the encrypted picture is W, and when the grids are equally divided, part of the grids are divided, so that the grids divided by the picture to be encrypted are the same due to incomplete addition of 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 encryption information is written in each grid. Preferably, the total number of pixel point arrays in the grid array equally divided by the pixel array of the picture to be encrypted is the same as the total number of pixel point arrays in the unit grid array. Further preferably, when the grid is equally divided, if the grid cannot be equally divided, the blank pixel point array can be added according to the total number of the pixel point 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 head key, the encryption key, or the tail key in the encrypted information is usually an encryption character string composed of a plurality of characters, and the encryption character string needs to be processed according to a preset encryption information processing mode, where the encryption character string is converted into corresponding numbers, the numbers are converted into an encryption array, and finally, the grid array is encrypted by using the encryption elements in the encryption array. Specifically, as shown in fig. 4, taking the encryption key as the character string 123abc and taking the dictionary table as an exemplary illustration, in fig. 4, first, the encryption character string 123abc needs to be converted into corresponding numbers, and the conversion of the encryption character string into corresponding numbers according to the dictionary table is: 010203101112, the number is further converted to an encrypted array, the encrypted array being [0,1,0,2,0,3,1,0,1,1,1,2], such that the elements in the encrypted array are all encrypted elements. Preferably, the encryption information may be a combination of one or more encryption elements selected by a user.
Further specifically, the same encryption algorithm may be adopted when adding the head key, the encryption key, or the tail key in the encrypted information to the grid array, where the encryption algorithm at least includes adding the encryption element in the head key, the encryption key, or the tail key to the pixel array to be encrypted, and making the ones numerical value of the sum of the first three elements in the encrypted pixel array equal to the encryption element. The specific encryption algorithm steps may be: 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 the ones numerical value of the first three elements and the values, and then subtracting the encrypted elements from the ones numerical value to obtain a difference value between the encrypted elements and the ones numerical value; and finally, calculating the difference value with one or more of the previous three-bit elements in the pixel point array according to an adding rule to obtain an encrypted pixel point array, wherein the encrypted pixel point array meets the requirement of adding the previous three-bit elements, and the obtained single digit numerical value of the sum value is equal to the encrypted elements. When the difference value is operated with the first three-bit elements in the pixel point array, the operation result of any element in the first three-bit elements still needs to be within 0-255, so that the step of operating the difference value with one or more of the first three-bit elements in the pixel point array according to the addition rule to obtain the encrypted pixel point array further comprises the step of adding the element smaller than 0 and 10 if the element in the encrypted pixel point array is smaller than 0, or subtracting the element larger than 255 and 10 if the element in the encrypted pixel point array is larger than 255. Preferably, the encryption algorithm is not limited to make only the ones numerical value of the sum of the first three-bit elements in the encrypted pixel point array equal to the encrypted elements, but may also be the case where the ones numerical value of any one of the first three-bit elements in the pixel point array is equal to the encrypted elements or the ones numerical value of the sum of the four-bit elements in the encrypted pixel point array is equal to the encrypted elements.
More specifically, the adding rule of the difference values is exemplarily described, which at least includes integrating the difference values into an array form having three elements, where there is only one difference value, so that a value of 0 is integrated with the difference values into a one-dimensional array having three elements; for example, if the difference is 4, the two values may be integrated into [4,0,0], but not limited to [4,0,0], or [0,4,0], and then added to the first three-bit elements in the pixel array to obtain an encrypted pixel array, for example, the pixel array is [21,31,65,255], and the added array is [25,31,65,255 ]. Further, the addition rule in the encryption algorithm may also be to split the difference value, that is, split the difference value into one or more addition elements; then, integrating the split added numbers into a one-dimensional array with three elements; and adding the split added number with the first three-bit element of the pixel point array to be encrypted, wherein when the difference value is split, the number of the split elements is at most 3. Preferably, the numerical difference is divided equally as much 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 result unit number value obtained by adding the first three digits of the encrypted pixel point array is equal to the encrypted digit.
Taking pixel point array [23,34,45,255] and encryption element 6 as an example, firstly, adding elements to the first three-bit elements of the pixel point array to obtain a single digit numerical value of a sum value of 2; secondly, subtracting the numerical value of the single digit from the encrypted element to obtain a difference value of 4, adding 4 into the first three elements in the pixel point array [23,34,45,255], and dividing the numerical value difference into three parts for exemplary explanation, so that 4 can be divided into 2,1, 1; and then adding the added array composed of 2,1 and 1 into [2,1,1], and finally adding the elements in the added array [2,1,1] with the first three-bit elements in the pixel point array respectively to obtain the encrypted pixel point array [25,35,46,255 ]. Preferably, the 2,1,1 three-bit element is not limited to [2,1,1] when composing the addition array, and the order of the three-bit element may also be [1,2,1], [1,1,2], and the like. Therefore, 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-digit elements of the pixel point array are added to obtain a single digit value of the sum value of 7; secondly, subtracting the numerical value of the single digit from the encrypted 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 dividing the numerical value difference into trisection into exemplary descriptions, so that-6 can be divided into-2, -2 and-2; and then adding the elements in the adding array [ -2, -2, -2] to the first three-bit elements in the pixel point array to obtain an encrypted pixel point array [ -1,21,1,255 ]. And if the element-1 of the encrypted pixel point array is less than 0, adding-1 and 10, and finally setting the encrypted pixel point array as [9,21,1,255 ]. When the elements in the encrypted pixel point array are greater than 255, the elements greater than 255 and 10 are subtracted, which is not described in detail again for example.
The trisection splitting of the difference value can be that the difference value is divided by 3, an equal value and a residual value are recorded, then the residual value is divided by 2, the equal value and the residual value are recorded, then the residual value divided by 2 is divided by 1, and the equal value is recorded; finally, correspondingly adding the three divided values to obtain three added elements, taking a difference value of 4 as an example, dividing the three added elements by 3 to obtain an equal value of 1, and taking the remaining value of 1, and then dividing the three added elements by 3 to obtain 1,1 and 1; continuously dividing the remainder value by 2 to obtain an equal score of 0, and dividing the remainder value by 2 to obtain additional elements of 0,0 and 0; then, the remaining value after being divided by 2 and 1 are divided continuously to obtain an equal score value of 1, the remaining value is 0 (cannot be divided equally), and then the added elements after being divided by 1 are 1,0 and 0; the three-times operated-up add elements are added to 2,1,1, so that the final add array is [2,1,1], which in all cases has no uniqueness. Preferably, the algorithm for adding the difference value to the pixel point array is not unique.
The addition rule of the difference is a part of the encryption algorithm, so that the above exemplary description also partially exemplifies the encryption algorithm.
Further specifically, the same encryption information is added to all grid arrays obtained by equally dividing a picture to be encrypted, and in the process of obtaining the encrypted grid array, a head position, an encryption position and a tail position need to be divided from the grid array. 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. As exemplarily illustrated in fig. 5, the head position is located at the upper left corner of the grid array, the number of pixel arrays occupied by the head position is 9, and the arrangement manner adopted is that the first pixel array from the upper left corner of the unit grid sequentially occupies the first three pixel arrays of the first three rows of pixel arrays, wherein the encrypted array adopted by the head key is [1,2,3,4,5,6,7,8,9], and then 9 encrypted elements in the encrypted array are added to the head position respectively. 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, and the head key only has four encryption elements, and there may exist a case where 4 unencrypted adjacent pixel point arrays in an encrypted picture are decrypted, and the extracted content is the same as the head key, so that the head position and/or the head key are too simple, the probability that the head position is difficult to determine is increased, the encryption quality is affected, and the decryption is difficult.
Secondly, taking the head position as a reference point in the grid array, adding an encryption key according to an encryption key adding mode, specifically: the method comprises the steps of determining a first position of a first encryption element in an encryption key in a to-be-encrypted grid array, and sequentially adding the encryption elements in the encryption key in the to-be-encrypted grid array from the first position, wherein the encryption elements are not limited to a mode, and the mode of adding the encryption key can be that the mode of adding the encryption key is used for sequentially encrypting every n rows of row arrays in the grid array from the encryption position of the first encryption element, and adding one encryption element every n pixel arrays in the row arrays of the grid array, wherein n is more than or equal to 0. Taking fig. 5 as an exemplary illustration, the position of the first encryption element in fig. 5 is the first pixel point array after the first row of the head position of the grid array is finished. In fig. 5, the encryption key uses a character string 123abc, and the encryption array is [0,1,0,2,0,3,1,0,1,1,1,2], so that the elements in the encryption array sequentially add an encryption element to every two pixel point arrays in the row array of the grid array according to the position of the first encryption element, and encrypt the grid array every two rows in the grid array. Only a portion of the encrypted elements are shown in fig. 5 due to the lattice array limitations. The encryption key adding mode enables the picture not to be distorted, and also prevents the picture from being stolen. Preferably, the row number groups of the grid array are all regarded as an X axis, the column number groups of the grid array are regarded as a Y axis, the adding mode of the encryption key is from the position of the first encryption element, the X axis is to add one encryption element every n pixel points, the Y axis is to sequentially encrypt every n row number groups, wherein n is larger than or equal to 0.
And finally, after the addition of the encryption key is finished, determining a tail position in the grid array, and adding the tail key at the tail position, wherein preferably, the tail key is used as an end mark of the encryption key immediately after the encryption key, and is added according to the addition mode of the encryption key when the tail key is added. Therefore, the pixel point array added with the tail key forms 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 the arrangement manner thereof. Taking fig. 5 as an example to illustrate, the tail key uses the character string "&", the number corresponding to the character string "&" in the dictionary table is "56", the tail key array is [5,6], and the encryption manner is that, from the position of the first encryption element, an encryption element is added to every two pixel point arrays in the row array of the grid array, and the encryption is sequentially performed to every two row arrays in the grid array. Preferably, when the grid array is encrypted, a tail key serving as an end mark is added to the encryption key, and when the encryption key is added, the encryption key and the tail key are sequentially added to the grid, for example, the encryption key adopts a string 123abc &withthe tail key, where the tail key is &. Further preferably, the adding mode of the tail position is not limited to the adding mode of the encryption key, but the tail position can also be directly added into the last one or more pixel point arrays of the grid array, but the tail position is positioned 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 a blank pixel point array, that is, removing the blank pixel point 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 point 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 point array set in the column direction of the encrypted pixel array equal to the height of the original picture to be encrypted, and finally, truncating the pixel array with the width and the height equal to that of the original picture to be encrypted, that is, removing the redundant blank pixel point array. Taking fig. 3 as an example to illustrate that after a 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 original picture to be encrypted is encrypted, the same head key, encryption key and tail key are added to each grid, the pixel array after the picture to be encrypted is a new two-dimensional array after encryption, the length of the row array of the encrypted pixel array on the X axis is equal to the width of the original picture to be encrypted, the length of the set of all pixel point arrays on the Y axis is equal to the height of the original picture to be encrypted, and then interception is performed, that is, redundant blank pixel point arrays are removed.
As shown in fig. 6, a decryption method is introduced in the embodiment of the present invention, where the decryption method includes, firstly, establishing a pixel array to be decrypted of a picture to be decrypted, secondly, traversing the pixel array to be decrypted of the decrypted picture, finding 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 elements 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 into the original picture, thereby achieving the purpose of preventing the picture from being stolen. Specifically, the principle and/or method used for establishing the original pixel array of the decrypted picture is the same as that used for establishing the pixel array of the picture to be encrypted, and details are not repeated here. 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 so as to determine a unit grid array, and specifically, extracting the first three-digit numerical value of the first three-digit element and value of all pixel point arrays in the pixel array to be decrypted; extracting and processing the extracted single digit numerical value of the preset head position and/or the preset tail position to obtain a head key and/or a tail key of the picture to be decrypted; and 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 selected one or more unit grid arrays take the head position or the tail position as a reference point, the unit digit numerical values of the corresponding pixel point arrays are reversely extracted according to an encryption key adding mode, then all the extracted unit digit numerical values form an encryption array, then 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.
The decryption process is described by taking fig. 5 as an example, and as can be seen from fig. 5, the encryption information and the encryption rule of the picture with the grid array of fig. 5 are as follows: the head position adopts a 3x3 arrangement mode at the upper left corner of the grid, and the corresponding array of 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 head position of the first row of the grid array is finished; the tail position is set as &', the corresponding tail key array is [5,6], and the tail key and the encryption key are added in the same mode. Therefore, when the picture with the grid of fig. 5 is decrypted, when the original pixel array of the picture is traversed, the ones digit values of the first three digits and values of all the pixel point arrays of the picture to be decrypted can be obtained, and taking the ones digit values of all the pixel point arrays and values of the first three rows of arrays in the grid of fig. 5 as an example, the ones digit values are 1,2,3,0,2,2,1,2,2, 0; 4,5,6, 2,2,2,2,2, 2; 7,8,9, 2,2,2,2,2, 2; therefore, the ones digit numerical value of the pixel point array at the position of 3x3 at 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 which meet the encryption rule are determined, and the similar acquisition mode of the tail position is not repeated. When a picture is taken, one or more head positions and/or tail positions can be obtained, so that one or more unit grid arrays can be obtained, any unit grid array is selected to extract the encrypted elements, in the extraction process, the extraction rule is consistent with the encryption rule, after the head position is determined in the graph 5, the unit grid array is determined, the unit grid array is reversely extracted from the first pixel array after the head position of the first row of the grid array is finished according to the encryption key adding mode, every two pixel arrays are arranged in the row array of the grid array, and the unit digit numerical values are sequentially extracted from every two rows of the row array in the grid array until all the encrypted elements are extracted, and/or the extraction is finished after the encrypted elements of the tail key are extracted, and then the extracted encrypted elements of all the encryption keys form the encrypted array, then, the encrypted array is converted into the encryption key according to the encryption rule, so that the decrypted encryption key is compared with the encryption key added to the picture, specifically, the processing mode of finally converting all encrypted numbers into the encryption key in the decryption process is the reverse process of the processing mode of processing the encryption key in the encryption process, as shown in fig. 5, the encrypted array of [0,1,0,2,0,3,1,0,1,1,1,2] is converted into the number 010203101112, and then the number is further converted into the encryption key of the character string 123abc according to the dictionary table.
In this embodiment, the encryption information and the encryption rule can be customized, but the encryption information and the encryption rule of an 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, an encrypted character string can still be obtained, and the purpose of preventing theft is achieved.
In this embodiment, the pixel array of the picture may also be regarded as a one-dimensional array composed of three RGB color values, and the encryption and decryption methods for one picture are the same as the above methods, and are not described again.
On the basis of the above method, an embodiment of the present invention further adaptively provides an encryption system, as shown in fig. 7, the encryption system sequentially includes a pixel array establishing module, a pixel array processing module, an encryption module, and a configuration module, which implement data connection, wherein the pixel array establishing module is configured to establish 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 a pixel array composed of four numbers is used as a minimum unit of the pixel array; the pixel array processing module is also used for determining the height and width of a unit grid array which can be added with the encrypted information according to the encrypted information, and is also used for adding a blank pixel point array; the encryption module is further 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 the blank pixel point array added in the encryption process of the encrypted picture.
The encryption system further comprises a presetting module for presetting encryption information and encryption rules. Specifically, the encryption information preset by the preset module includes 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 above method, an embodiment of the present invention further adaptively provides a decryption system, as shown in fig. 8, where the decryption system includes a pixel array establishing module, an obtaining module, an extracting module, and a comparing module, which implement data connection; 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 the 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 acquired encryption key with a preset encryption key.
On the basis of the above method, the embodiment of the present invention further adaptively provides an encryption system, as shown in fig. 9, the system includes at least one processor and at least one memory; the memory stores a computer program for executing the encryption method, and the processor calls the computer program in the memory to execute the encryption method.
On the basis of the above method, the embodiment of the present invention further adaptively provides a decryption system, as shown in fig. 10, the system includes at least one processor and at least one memory; the memory stores a computer program for executing the decryption method, and the processor calls the computer program in the memory to execute the decryption method.
Although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. A decryption method, characterized by: the decryption method comprises the steps of,
establishing a pixel array to be decrypted of a 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 acquired encryption key with a preset encryption key.
2. Decryption method according to claim 1, characterized in that: the decryption method may further comprise the step of,
extracting the first three-digit numerical values of the first three-digit elements and values of all the pixel point arrays in the pixel array to be decrypted;
extracting and processing the extracted single digit numerical value of the preset head position and/or the preset tail position to obtain a head key and/or a tail key of the picture to be decrypted;
and 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.
3. Decryption method according to claim 1, characterized in that: extracting the encryption key in the unit grid array includes at least,
starting from the first pixel point array after the head position of the first row of the grid array is finished, sequentially extracting the numerical values of the digits in the row array of the grid array every two rows of the row array, and finishing the extraction until all the encrypted elements are extracted and/or the encrypted elements of the tail key are extracted.
4. A decryption method according to claim 3, characterized in that: the decryption method further comprises 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.
5. A decryption system, characterized by: the system comprises at least one processor and at least one memory;
the memory stores a computer program for performing the method of any of claims 1-4, and the processor calls the computer program in the memory to perform the method of any of claims 1-4.
6. A decryption system, characterized by: the decryption system comprises a first decryption unit for decrypting the encrypted data,
the pixel array establishing module is used for establishing a pixel array to be decrypted of the picture to be decrypted;
the acquiring module is used for identifying 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;
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.
CN201911102778.2A 2018-08-27 2018-08-27 Decryption method and system Active CN111192187B (en)

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
CN201810982109.8A CN109068021B (en) 2018-08-27 2018-08-27 Encryption and decryption method and system
CN201911102778.2A CN111192187B (en) 2018-08-27 2018-08-27 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 true CN111192187A (en) 2020-05-22
CN111192187B CN111192187B (en) 2023-10-24

Family

ID=64756191

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201810982109.8A Active CN109068021B (en) 2018-08-27 2018-08-27 Encryption and decryption method and system
CN201911102778.2A Active CN111192187B (en) 2018-08-27 2018-08-27 Decryption method and system

Family Applications Before (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) CN109068021B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111815723A (en) * 2020-07-08 2020-10-23 北京华云安信息技术有限公司 Data 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

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112437205B (en) * 2020-11-18 2022-03-15 光谷技术有限公司 Video encryption method and device
CN113282911A (en) * 2021-05-12 2021-08-20 捷德(中国)科技有限公司 Identity authentication method, device, equipment and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050044045A1 (en) * 2003-07-31 2005-02-24 Pelly Jason Charles Access control for digital content
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 郑州云海信息技术有限公司 An encryption method, a decryption method, an encryption device and a decryption device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050044045A1 (en) * 2003-07-31 2005-02-24 Pelly Jason Charles Access control for digital content
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 郑州云海信息技术有限公司 An encryption method, a decryption method, an encryption device and a decryption device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111815723A (en) * 2020-07-08 2020-10-23 北京华云安信息技术有限公司 Data encryption method and device
CN111815723B (en) * 2020-07-08 2024-04-12 北京华云安信息技术有限公司 Data 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

Also Published As

Publication number Publication date
CN111192187B (en) 2023-10-24
CN109068021B (en) 2020-02-14
CN109068021A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109068021B (en) Encryption and decryption method and system
WO2020073508A1 (en) Method and device for adding and extracting audio watermark, electronic device and medium
Lee et al. A novel data hiding scheme based on modulus function
CN105281894B (en) Plaintext encryption method and system based on seven-order magic cube
US10354355B2 (en) Digital watermarking
CN111401320B (en) Privacy-protecting biometric image processing method, device, medium, and apparatus
Majeed et al. AN IMPROVED LSB IMAGE STEGANOGRAPHY TECHNIQUE USING BIT-INVERSE IN 24 BIT COLOUR IMAGE.
CN101527829B (en) Method and device for processing video data
TWI716037B (en) Method and device for writing and reading digital watermark
CN103745479A (en) Digital steganography and steganalysis method for color image
Hong et al. A color image authentication scheme with grayscale invariance
CN111026583B (en) Backup recovery method for multi-private key of blockchain wallet and computer readable storage medium
US6023511A (en) Cryptosystem for encrypting digital image or voice file
KR102438102B1 (en) Apparatus, method, computer-readable storage medium and computer program for encrypting information using image steganography
Al-Tamimi et al. Image steganography using least significant bits (LSBs): a novel algorithm
CN116089984B (en) A leak-proof management method and system for administrative documents
Ibanez et al. Optimization of least significant bit steganography using genetic algorithm to improve data security
CN117156154A (en) Dual video watermark embedding method, dual video watermark extracting device and electronic equipment
CN115802005A (en) Security monitoring video storage method for residential houses
CN114465779A (en) A reversible and separable ciphertext domain information hiding method and system
Hong Human visual system based data embedding method using quadtree partitioning
CN117879845B (en) Video data file encryption protection method and system based on block chain
JP2020184663A (en) High resistance digital watermarking method
Lin et al. A novel secure data hiding scheme using a secret reference matrix
CN118862175B (en) A data security storage method for an artificial intelligence data platform

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