WO2018090192A1 - 基于光学加密和解密技术的图像加密和解密方法及装置 - Google Patents

基于光学加密和解密技术的图像加密和解密方法及装置 Download PDF

Info

Publication number
WO2018090192A1
WO2018090192A1 PCT/CN2016/105931 CN2016105931W WO2018090192A1 WO 2018090192 A1 WO2018090192 A1 WO 2018090192A1 CN 2016105931 W CN2016105931 W CN 2016105931W WO 2018090192 A1 WO2018090192 A1 WO 2018090192A1
Authority
WO
WIPO (PCT)
Prior art keywords
decimal
code
binary
segment
image
Prior art date
Application number
PCT/CN2016/105931
Other languages
English (en)
French (fr)
Inventor
邹文斌
焦述铭
庄兆永
李霞
Original Assignee
深圳大学
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 深圳大学 filed Critical 深圳大学
Priority to PCT/CN2016/105931 priority Critical patent/WO2018090192A1/zh
Publication of WO2018090192A1 publication Critical patent/WO2018090192A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing

Definitions

  • the invention belongs to the field of optical encryption and decryption technology, and in particular relates to an image encryption and decryption method and device based on optical encryption and decryption technology.
  • optical encryption technology protects electronic information during transmission and storage to prevent disclosure to unauthorized users.
  • optical encryption technology has high parallelism, The advantages of high speed and multiple encryption parameters are expected to occupy a place in the field of encryption technology in the future.
  • common optical encryption techniques include: dual random phase encryption (DRPE, Double) Random Phase Encoding ), based on fractional Fourier transform ( FFT ) Double random phase encryption, wavelength multiplexed encryption, and asymmetric encryption based on phase truncation.
  • the optical encryption technology in the prior art has a disadvantage: after the above-mentioned optical encryption technology, the original image is decrypted and the original image is severely disturbed by the speckle noise, thereby affecting the definition of the decrypted image.
  • the invention provides an image encryption and decryption based on optical encryption and decryption technology
  • the method and device aim to solve the problem that the image decrypted by the existing optical encryption technology is seriously disturbed by speckle noise, thereby affecting the definition of the decrypted image.
  • the invention provides an image encryption method based on optical encryption and decryption technology, which comprises: converting an image to be encrypted into a binary sequence code; converting the binary serial code into a decimal serial code according to a preset conversion sequence rule; The order of the first to last bits in the decimal sequence code, dividing the decimal sequence code into a plurality of segments, and setting a capacity of each of the plurality of segments to be less than or equal to a maximum capacity of a single two-dimensional code; Converting the segment into a two-dimensional code corresponding to the segment, and optically encrypting the two-dimensional code to restore the encrypted two-dimensional code to the image to be encrypted by optical decryption.
  • the invention provides an image decryption method based on optical encryption and decryption technology, comprising: optically decrypting a two-dimensional code to be decrypted, obtaining a decrypted two-dimensional code, and converting the decrypted two-dimensional code into an inclusion a segment having a decimal digit; arranging the converted segments according to the segment number preset in the decrypted two-dimensional code to generate a decimal sequence code; and according to a preset conversion sequence rule, the decimal sequence code Convert to binary sequence code; restore the converted binary sequence code to an image.
  • the invention provides an image encryption device based on optical encryption and decryption technology, comprising: a conversion module for converting an image to be encrypted into a binary sequence code; and the conversion module is further configured to follow a preset conversion sequence rule Converting the binary sequence code into a decimal sequence code; the dividing module is configured to divide the decimal sequence code into a plurality of segments according to an order from a first bit to a last bit in the decimal sequence code, and set each of the plurality of segments The capacity of a segment is less than or equal to the maximum capacity of a single two-dimensional code; the conversion module is further configured to convert the segment into a two-dimensional code corresponding to the segment, and optically encrypt the two-dimensional code. The encrypted two-dimensional code is restored to the image to be encrypted by optical decryption.
  • the invention provides an image decryption device based on optical encryption and decryption technology, comprising: a conversion module, configured to optically decrypt a two-dimensional code to be decrypted, obtain a decrypted two-dimensional code, and obtain the decrypted two-dimensional code Converting the code into a segment containing a decimal number; the generating module is configured to arrange the converted segments according to the segment number preset in the decrypted two-dimensional code to generate a decimal sequence code; the conversion module is used to Converting the decimal sequence code into a binary sequence code according to a preset conversion sequence rule; the restoration module is configured to restore the converted binary sequence code to an image.
  • a conversion module configured to optically decrypt a two-dimensional code to be decrypted, obtain a decrypted two-dimensional code, and obtain the decrypted two-dimensional code Converting the code into a segment containing a decimal number
  • the generating module is configured to arrange the converted segments according to the segment number
  • the image encryption and decryption method and device based on optical encryption and decryption technology converts an image to be encrypted into a binary sequence code, and converts the binary sequence code into a decimal sequence code according to a preset conversion sequence rule, according to the The order from the first bit to the last bit in the decimal sequence code, dividing the decimal sequence code into a plurality of segments, and setting the capacity of each segment of the plurality of segments to be less than or equal to the maximum capacity of the single two-dimensional code, and converting the segment Forming a two-dimensional code corresponding to the segment, and optically encrypting the two-dimensional code to restore the encrypted two-dimensional code to the image to be encrypted by optical decryption.
  • the two-dimensional code is used as the carrier of the image, and then the two-dimensional code is optically encrypted, so that the image restored by optical decryption can be prevented from being disturbed by speckle noise, thereby making the decrypted image more clear and complete.
  • FIG. 1 is a schematic flowchart showing an implementation of an image encryption method based on optical encryption and decryption technology according to a first embodiment of the present invention
  • FIG. 2 is a schematic flowchart showing an implementation of an image encryption method based on optical encryption and decryption technology according to a second embodiment of the present invention
  • FIG. 3 is a schematic diagram of a process of converting an image into a two-dimensional code
  • FIG. 4 is a schematic flowchart showing an implementation of an image decryption method based on optical encryption and decryption technology according to a third embodiment of the present invention
  • FIG. 5 is a schematic diagram of an image decryption method corresponding to the image encryption method of FIG. 3;
  • FIG. 6 is a schematic structural diagram of an image encryption apparatus based on an optical encryption and decryption technology according to a fourth embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an image encryption apparatus based on optical encryption and decryption technology according to a fifth embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of an image decryption apparatus based on optical encryption and decryption technology according to a sixth embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of an image encryption method based on an optical encryption and decryption technology according to a first embodiment of the present invention, which can be applied to an optical encryption and decryption system, and the image encryption method shown in FIG. Includes the following steps:
  • the image to be encrypted is a grayscale image, and may also be a color image.
  • the image to be encrypted in any storage format can be converted into a binary serial code, and the storage format of the image to be encrypted can be a bitmap file (BMP, Bitmap). Format, also available for PCX (Personal Computer Exchange) format, or for graphics interchange format (GIF, Graphics) Interchange Format) format, also available as Joint Photographic Expert Group (JPEG, Joint Photographic Expert Group)
  • the format can also be other storage formats, and will not be described here.
  • Each clip contains multiple decimal digits.
  • the maximum capacity is an inherent parameter, and different types of two-dimensional codes have different maximum capacities. For example, the maximum capacity of a single traditional QR code is 1167 digits, a single tiny QR code (Micro QR Code has a maximum capacity of 35 digits.
  • S104 Convert the segment into a two-dimensional code corresponding to the segment, and optically encrypt the two-dimensional code to restore the encrypted two-dimensional code to the image to be encrypted by optical decryption.
  • a segment is correspondingly converted into a two-dimensional code.
  • the generated two-dimensional code needs to be optically encrypted to obtain an encrypted two-dimensional code.
  • the image to be encrypted is converted into a binary sequence code; the binary sequence code is converted into a decimal sequence code according to a preset conversion sequence rule, and the first to last digits of the decimal sequence code are used.
  • the decimal serial code is divided into a plurality of segments, and the capacity of each of the plurality of segments is set to be smaller than or equal to the maximum capacity of the single two-dimensional code, and the segment is converted into a two-dimensional code corresponding to the segment, and the
  • the two-dimensional code is optically encrypted to restore the encrypted two-dimensional code to the image to be encrypted by optical decryption, so that the two-dimensional code is used as a carrier of the image, and then the two-dimensional code is optically encrypted to prevent optical decryption.
  • the restored image is disturbed by speckle noise, which makes the decrypted image more clear and complete.
  • FIG. 2 is a schematic flowchart of an image encryption method based on an optical encryption and decryption technology according to a second embodiment of the present invention, which can be applied to an optical encryption and decryption system, and the optical encryption and the optical encryption method shown in FIG.
  • the image encryption method of the decryption technology mainly includes the following steps:
  • the image to be encrypted is a grayscale image.
  • the image to be encrypted in any storage format can be converted into a binary serial code.
  • the storage format of the image to be encrypted can be BMP format, PCX format, GIF format, or JPEG.
  • the format can also be other storage formats, and will not be described here.
  • the preset order is the order of the first to last bits in the binary sequence code. For example, if the binary sequence code converted by the image in S201 is 10010101111000, the first digit of the binary sequence code is the binary digit 1 located at the leftmost side of the entire sequence, and the last digit of the binary sequence code is the binary at the far right of the entire sequence. Digit 0, the four bits extracted from the binary sequence code are 1001.
  • S203 Determine, by using the value of the four bits, a method of converting the binary digit into a decimal digit.
  • the manner of converting the binary digit into a decimal digit by determining the value of the four bits is specifically:
  • the four bits are 1000 or 1001, the four bits of 1000 are converted to decimal number 8 according to a preset binary to decimal rule, or the four bits of 1001 are converted into a decimal number 9;
  • the preset binary to decimal rule is: binary digital 1000 converted to decimal digital 8, binary digital 1001 converted to decimal digital 9, binary digital 000 converted to decimal digital 0, binary digital 001 converted to decimal digital 1, binary digital 010 converted to Decimal number 2, binary digit 011 is converted to decimal digit 3, binary digit 100 is converted to decimal digit 4, binary digit 101 is converted to decimal digit 5, binary digit 110 is converted to decimal digit 6, and binary digit 111 is converted to decimal digit 7.
  • Steps S202 to S203 are described by taking the binary sequence code 10010101111000 as an example.
  • the unconverted four bits 1001 are extracted from the sequence according to the preset order, and 1001 is directly converted into the decimal number 9; the unconverted extraction is continued according to the preset order.
  • the four bits 0101 which are neither 1000 nor 1001, then re-extract the unconverted three bits 010 in the preset order and convert 010 to decimal number 2; then continue from the sequence in the preset order Extracting the unconverted four bits 1111, which are neither 1000 nor 1001, then re-extract the unconverted three bits 111 according to the preset order, and convert 111 to decimal number 7; continue to follow the preset order
  • the unconverted four bits 1000 are extracted from the sequence and 1000 is directly converted to decimal number 8.
  • the decimal numbers obtained by the first conversion are arranged in the front, and the decimal numbers obtained by the conversion are arranged in the back.
  • the decimal numbers converted in the above step S204 are taken as an example, and arranged in the order of the conversion.
  • the decimal sequence code is: 9278.
  • Each clip contains multiple decimal digits.
  • the order of the first to last digits in the decimal sequence code is the same as the order from the first bit to the last bit in the binary sequence code. For example, if the decimal sequence code is 9278, the first digit of the decimal sequence code is 9, the last bit. Is 8.
  • the capacity of each segment must be less than or equal to the maximum capacity of a single two-dimensional code. For example, assuming that the maximum size of a single two-dimensional code is 2 digits and the decimal sequence code is 9278, the two segments divided are: segment A. Including 9 and 2, segment B includes 7 and 8; assuming that the maximum capacity of a single two-dimensional code is 3 digits, there are two division methods. The first division is: segment A includes 9 and 2, segment B Including 7 and 8; the second division is: segment A includes 9, 2, and 7, and segment B includes 8.
  • S208 Insert a preset segment number into the two-dimensional code corresponding to each segment according to the order of the decimal digits in the decimal sequence code, so that the segment to be segmented is restored according to the segment sequence at the time of decryption.
  • a segment is converted into a two-dimensional code.
  • the segment number is used to indicate the order of the segment arrangement.
  • the segment number may be expressed in the form of a number, such as 1, 2, 3, .... N, the smaller the number, the more the arrangement is forward, the serial number of the segment may also use Roman numerals, and the characters with the arrangement order may be customized.
  • the decimal sequence code is 9278
  • the segment A includes 9 and 2
  • the segment B includes 7 and 8
  • the segment A has a segment number of 1
  • the segment B has a segment number of 2
  • the segment A is arranged in front
  • the segment B is arranged. Arranged at the back.
  • the segment number can ensure that the order of the digits in the decimal sequence code generated by the segment at the time of decryption coincides with the order of the digits in the decimal sequence code at the time of encryption.
  • FIG. 3 is a schematic diagram of a process of converting an image into a two-dimensional code. As shown in FIG. 3, the above steps S201 to S208 are described by a practical example, as follows:
  • Step 1 Convert the image to be encrypted into a binary serial code of 001110100010011110110010010001000;
  • Step 2 extract four bits 0011 from the binary digits of the binary sequence code that are not converted into decimal digits according to a preset order;
  • Step 3 The four bits are neither 1000 nor 1001. Then, according to the preset sequence, three bits 001 are extracted from the binary digits of the binary sequence code that are not converted into decimal digits, and the decimal rule is converted according to the decimal. Convert the bit to decimal number 1;
  • Step 4 Continue to perform step 1, extract the four bits to 1101, and then perform step 3, re-extract the three bits to 110, and convert 110 to decimal digit 6;
  • Step 5 Continue to step 1, extract the four bits to 1000, and directly convert 1000 to decimal digit 8;
  • Step 6 Continue to step 1, extract the four bits to 1001, and directly convert 1001 to decimal digit 9;
  • the binary sequence code of step 1 is converted into a decimal sequence code 1689731108;
  • the three segments into which the decimal sequence code is divided are segment 1, segment 2, and segment 3, wherein segment 1 includes 1689, and segment 2 includes 7311, segment 3 Including 08, satisfying that each segment is smaller than the maximum capacity of a single two-dimensional code;
  • the segment 1 is then converted to a two-dimensional code A, the segment 2 is converted to a two-dimensional code B, and the segment 3 is converted to a two-dimensional code C, where the numbers 1, 2 and 3 are segment numbers.
  • each segment that is divided is smaller than the maximum capacity of the single two-dimensional code, other division modes may be selected.
  • the image to be encrypted is converted into a binary sequence code, and four bits are extracted from the binary number of the binary sequence code that is not converted into a decimal digit according to a preset order, and the binary value is determined by the value of the four bits.
  • the method of converting digital into decimal digits continues to perform the process of extracting four bits until all binary digits in the binary serial code are converted into decimal digits, and the obtained decimal digits are arranged according to the order of conversion, to obtain the decimal serial code.
  • FIG. 4 is a schematic flowchart showing an implementation of an image decryption method based on optical encryption and decryption technology according to a third embodiment of the present invention, which can be applied to an optical encryption and decryption system, and the optical encryption and decryption system shown in FIG.
  • the technical image decryption method mainly includes the following steps:
  • S402. Arrange the converted segments according to the segment numbers preset in the decrypted two-dimensional code to generate a decimal sequence code.
  • the decoding method of the step S401 to the step S404 corresponds to the image encryption method in the embodiment shown in FIG. 1 and FIG. 2 .
  • the decoding method of the step S401 to the step S404 corresponds to the image encryption method in the embodiment shown in FIG. 1 and FIG. 2 .
  • For the related content refer to the description of the embodiment of FIG. 1 and FIG. 2 , and details are not described herein again.
  • FIG. 5 is a schematic diagram of an image decryption method corresponding to the image encryption method of FIG.
  • the two-dimensional code to be decrypted is optically decrypted to obtain a decrypted two-dimensional code, and the decrypted two-dimensional code is converted into a segment containing a decimal number according to the decrypted two-dimensional code.
  • the preset segment number is arranged, and the converted segments are arranged to generate a decimal sequence code, and the decimal sequence code is converted into a binary sequence code according to a preset conversion sequence rule, and the converted binary sequence code is restored to an image.
  • optical decryption of the two-dimensional code and then restoration of the decrypted two-dimensional code to the image can prevent the interference of speckle noise, thereby making the decrypted image more clear and complete, and at the same time, the segment number can be used to more accurately restore the segment.
  • FIG. 6 is a schematic structural diagram of an image encryption apparatus based on an optical encryption and decryption technology according to a fourth embodiment of the present invention.
  • the image encryption device based on the optical encryption and decryption technique illustrated in FIG. 6 may be an execution body of the image encryption method based on the optical encryption and decryption technology provided by the foregoing embodiment shown in FIGS. 1 and 2.
  • the image encryption device based on the optical encryption and decryption technology illustrated in FIG. 6 mainly includes a conversion module 601 and a division module 602. The above functional modules are described in detail as follows:
  • a conversion module 601 configured to convert an image to be encrypted into a binary serial code
  • the conversion module 601 is further configured to convert the binary sequence code into a decimal sequence code according to a preset conversion sequence rule
  • the dividing module 602 is configured to divide the decimal sequence code into a plurality of segments according to an order from a first bit to a last bit in the decimal sequence code, and set a capacity of each of the plurality of segments to be less than or equal to a single two-dimensional code. Maximum capacity
  • the converting module 601 is further configured to convert the segment into a two-dimensional code corresponding to the segment, and optically encrypt the two-dimensional code to restore the encrypted two-dimensional code to the image to be encrypted by optical decryption.
  • the conversion module 601 converts the image to be encrypted into a binary sequence code, and converts the binary sequence code into a decimal sequence code according to a preset conversion sequence rule, and the dividing module 602 follows the first bit in the decimal sequence code.
  • the order of the last bit is divided into a plurality of segments, and the capacity of each of the plurality of segments is set to be less than or equal to the maximum capacity of the single two-dimensional code, and then the conversion module 601 converts the segment into a Corresponding two-dimensional code of the segment, and optically encrypting the two-dimensional code, so that the encrypted two-dimensional code is restored to the image to be encrypted by optical decryption, so that the two-dimensional code is used as a carrier of the image, and then the second The optical code is optically encrypted to prevent the image restored by optical decryption from being disturbed by speckle noise, thereby making the decrypted image more clear and complete.
  • each functional module is merely an example, and the actual application may be configured according to requirements, such as corresponding hardware configuration requirements or software.
  • the above function assignment is performed by different functional modules, that is, the internal structure of the image encryption device based on optical encryption and decryption technology is divided into different functional modules to complete all or part of the functions described above.
  • the corresponding functional modules in this embodiment may be implemented by corresponding hardware, or may be executed by corresponding hardware to execute corresponding software. The above description principles may be applied to various embodiments provided in this specification, and are not described herein again.
  • FIG. 7 is a schematic structural diagram of an image encryption apparatus based on an optical encryption and decryption technology according to a fifth embodiment of the present invention.
  • the image encryption device based on the optical encryption and decryption technique illustrated in FIG. 7 may be an execution body of the image encryption method based on the optical encryption and decryption technology provided by the foregoing embodiments shown in FIGS. 1 and 2.
  • the conversion module 701 includes: an extraction module 7011, a determination module 7012, an execution module 7013, and an arrangement module.
  • the determining module 7012 includes a conversion sub-module 70121.
  • the converting module 701 is configured to convert the image to be encrypted into a binary serial code.
  • the image to be encrypted is a grayscale image.
  • the image to be encrypted in any storage format can be converted into a binary serial code.
  • the storage format of the image to be encrypted can be BMP format, PCX format, GIF format, or JPEG.
  • the format can also be other storage formats, and will not be described here.
  • the conversion module 701 includes: an extraction module 7011, a determination module 7012, an execution module 7013, and an arrangement module 7014.
  • the determination module 7012 includes a conversion sub-module 70121.
  • the extracting module 7011 is configured to extract four bits from the binary digits of the binary sequence code that are not converted into decimal digits in a preset order.
  • the preset order is the order of the first to last bits in the binary sequence code. For example, if the binary sequence code converted by the image in S201 is 10010101111000, the first digit of the binary sequence code is the binary digit 1 located at the leftmost side of the entire sequence, and the last digit of the binary sequence code is the binary at the far right of the entire sequence. Digit 0, the four bits extracted from the binary sequence code are 1001.
  • a determining module 7012 is configured to determine a manner of converting the binary digit into a decimal number by the value of the four bits.
  • the determining module 7012 includes: a conversion submodule 70121.
  • the conversion sub-module 70121 is configured to convert the four bits of 1000 into a decimal number 8, or the four bits that will be 1001, according to a preset binary-to-decimal rule, if the four bits are 1000 or 1001. Convert to decimal digit 9;
  • the conversion sub-module 70121 is further configured to: if the four bits are neither 1000 nor 1001, re-extract three bits from the binary digit of the binary sequence code that is not converted into a decimal digit according to the preset sequence, and according to the The binary to decimal rule converts the three bits to a decimal number.
  • the preset binary to decimal rule is: binary digital 1000 converted to decimal digital 8, binary digital 1001 converted to decimal digital 9, binary digital 000 converted to decimal digital 0, binary digital 001 converted to decimal digital 1, binary digital 010 converted to Decimal number 2, binary digit 011 is converted to decimal digit 3, binary digit 100 is converted to decimal digit 4, binary digit 101 is converted to decimal digit 5, binary digit 110 is converted to decimal digit 6, and binary digit 111 is converted to decimal digit 7.
  • the executing module 7013 is configured to continue the process of extracting four bits until all binary digits in the binary serial code are converted into decimal digits.
  • Steps S202 to S203 are described by taking the binary sequence code 10010101111000 as an example.
  • the unconverted four bits 1001 are extracted from the sequence according to the preset order, and 1001 is directly converted into the decimal number 9; the unconverted extraction is continued according to the preset order.
  • the four bits 0101 which are neither 1000 nor 1001, then re-extract the unconverted three bits 010 in the preset order and convert 010 to decimal number 2; then continue from the sequence in the preset order Extracting the unconverted four bits 1111, which are neither 1000 nor 1001, then re-extract the unconverted three bits 111 according to the preset order, and convert 111 to decimal number 7; continue to follow the preset order
  • the unconverted four bits 1000 are extracted from the sequence and 1000 is directly converted to decimal number 8.
  • the arranging module 7014 is configured to arrange the obtained decimal numbers according to the order of the conversion to obtain the decimal sequence code.
  • the decimal numbers obtained by the first conversion are arranged in the front, and the decimal numbers obtained by the conversion are arranged in the back.
  • the decimal numbers converted in the above step S204 are taken as an example, and arranged in the order of the conversion.
  • the decimal sequence code is: 9278.
  • the dividing module 702 is configured to divide the decimal sequence code into a plurality of segments according to an order from a first bit to a last bit in the decimal sequence code, and set a capacity of each of the plurality of segments to be less than or equal to a single two-dimensional code. Maximum capacity.
  • Each clip contains multiple decimal digits.
  • the order of the first to last digits in the decimal sequence code is the same as the order from the first bit to the last bit in the binary sequence code. For example, if the decimal sequence code is 9278, the first digit of the decimal sequence code is 9, the last bit. Is 8.
  • the capacity of each segment must be less than or equal to the maximum capacity of a single two-dimensional code. For example, assuming that the maximum size of a single two-dimensional code is 2 digits and the decimal sequence code is 9278, the two segments divided are: segment A. Including 9 and 2, segment B includes 7 and 8; assuming that the maximum capacity of a single two-dimensional code is 3 digits, there are two division methods. The first division is: segment A includes 9 and 2, segment B Including 7 and 8; the second division is: segment A includes 9, 2, and 7, and segment B includes 8.
  • the converting module 701 is configured to convert the segment into a two-dimensional code corresponding to the segment, and optically encrypt the two-dimensional code to restore the encrypted two-dimensional code to the image to be encrypted by optical decryption.
  • the setting module 703 is configured to insert a preset segment number into the two-dimensional code corresponding to each segment according to the order of the decimal digits in the decimal sequence code, so that the segment to be segmented is reduced according to the segment number when decrypting. Serial code.
  • a segment is converted into a two-dimensional code.
  • the segment number is used to indicate the order of the segment arrangement.
  • the segment number may be expressed in the form of a number, such as 1, 2, 3, .... N, the smaller the number, the more the arrangement is forward, the serial number of the segment may also use Roman numerals, and the characters with the arrangement order may be customized.
  • the decimal sequence code is 9278
  • the segment A includes 9 and 2
  • the segment B includes 7 and 8
  • the segment A has a segment number of 1
  • the segment B has a segment number of 2
  • the segment A is arranged in front
  • the segment B is arranged. Arranged at the back.
  • the segment number can ensure that the order of the digits in the decimal sequence code generated by the segment at the time of decryption coincides with the order of the digits in the decimal sequence code at the time of encryption.
  • the conversion module 701 converts the image to be encrypted into a binary sequence code
  • the extraction module 7011 extracts four bits from the binary digits of the binary sequence code that are not converted into decimal digits according to a preset order
  • the determining module 7012 passes.
  • the four bit values determine the manner in which the binary digits are converted to decimal digits.
  • Execution module 7013 proceeds to perform the process of extracting four bits until all binary digits in the binary sequence code are converted to decimal digits, and permutation module 7014 follows the conversion.
  • the dividing module 702 Arranging the obtained decimal numbers in a sequence to obtain the decimal sequence code, the dividing module 702 divides the decimal sequence code into a plurality of segments according to the order from the first bit to the last bit in the decimal sequence code, and sets the plurality of segments.
  • each segment is less than or equal to the maximum capacity of the single two-dimensional code
  • the conversion module 701 converts the segment into a two-dimensional code corresponding to the segment, and optically encrypts the two-dimensional code to make the encrypted two
  • the dimension code is restored to the image to be encrypted by optical decryption
  • the setting module 703 Inserting a preset segment number into the two-dimensional code corresponding to each segment according to the order of the decimal numbers in the decimal sequence code, so that the segment to be segmented is restored according to the segment number in the decryption, so that As the carrier of the image, the dimension code optically encrypts the two-dimensional code, which can prevent the image restored by optical decryption from being disturbed by speckle noise, and the decrypted image is more clear and complete.
  • FIG. 8 is a schematic structural diagram of an image decryption apparatus based on an optical encryption and decryption technology according to a sixth embodiment of the present invention.
  • the image decryption apparatus based on the optical encryption and decryption technique illustrated in FIG. 8 may be an execution body of the image decryption method based on the optical encryption and decryption technology provided by the foregoing embodiment shown in FIG.
  • the image decryption apparatus based on the optical encryption and decryption technology illustrated in FIG. 8 mainly includes a conversion module 801, a generation module 802, and a restoration module 803.
  • the above functional modules are described in detail as follows:
  • the conversion module 801 is configured to optically decrypt the two-dimensional code to be decrypted, obtain the decrypted two-dimensional code, and convert the decrypted two-dimensional code into a segment containing the decimal digit;
  • the generating module 802 is configured to arrange the converted segments according to the segment number preset in the decrypted two-dimensional code to generate a decimal sequence code
  • the conversion module 801 is configured to convert the decimal sequence code into a binary sequence code according to a preset conversion sequence rule.
  • the restoration module 803 is configured to restore the converted binary serial code to an image.
  • the image decryption device based on the optical encryption and decryption technology in the embodiment of the present invention and the image encryption device based on the optical encryption and decryption technology shown in FIG. 6 and FIG. 7 may be located in one terminal, or may be located in a terminal. Different terminals.
  • the conversion module 801 optically decrypts the two-dimensional code to be decrypted, obtains the decrypted two-dimensional code, and converts the decrypted two-dimensional code into a segment containing the decimal digit
  • the generating module 802 follows the The segment number preset in the decrypted two-dimensional code, the converted segments are arranged to generate a decimal sequence code, and the conversion module 801 converts the decimal sequence code into a binary sequence code according to a preset conversion sequence rule, and restores
  • the module 803 restores the converted binary sequence code to an image, so that the two-dimensional code is optically decrypted first, and then the decrypted two-dimensional code is restored to the image to prevent speckle noise interference, thereby making the decrypted image more clear and complete.
  • the fragment sequence number can be used to more accurately restore the fragment to the encrypted decimal sequence code.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the modules is only a logical function division.
  • there may be another division manner for example, multiple modules or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication link shown or discussed may be an indirect coupling or communication link through some interface, device or module, and may be electrical, mechanical or otherwise.
  • the modules described as separate components may or may not be physically separated.
  • the components displayed as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM, Read-Only) Memory, random access memory (RAM), disk or optical disk, and other media that can store program code.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

本发明公开了一种基于光学加密和解密技术的图像加密和解密方法及装置,该方法包括:将待加密图像转换成二进制序列码,按照预置的转换序列规则,将该二进制序列码转换成十进制序列码,按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量,将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像,这样将二维码作为图像的载体,再对该二维码进行光学加密,可以防止通过光学解密还原出的图像受到斑点噪声的干扰,进而使得解密出的图像更加清晰完整。

Description

基于光学加密和解密技术的图像加密和解密方法 及 装置 技术领域
本发明属于光学加密和解密技术领域,尤其涉及一种基于光学加密和解密技术的图像加密和解密方 法及装置。
背景技术
信息加密技术可以对电子信息在传输和储存过程中进行保护,防止泄露给非法使用者。其中光学加密技术具有高并行性、 高速度和多加密参数等优点,有望在未来的加密技术领域占据一席之地。对于一幅图像,常见的光学加密技术包括:双随机相位加密( DRPE , Double Random Phase Encoding ),基于分数傅里叶变换( FFT , fractional Fourier transform )的双随机相位加密,波长多路复用加密和基于相位截断的非对称加密等。
但是现有技术中的光学加密技术均有一个缺点:通过上述的光学加密技术之后,再解密出原图像均会受到斑点噪声的严重干扰,进而影响解密出的图像的清晰度。
技术问题
本发明提供一种基于光学加密和解密技术的图像加密和解密 方法及装置,旨在解决因通过现有的光学加密技术解密出的图像受到斑点噪声的严重干扰,进而影响解密出的图像的清晰度的问题
技术解决方案
本发明提供的一种基于光学加密和解密技术的图像加密方法,包括:将待加密图像转换成二进制序列码;按照预置的转换序列规则,将所述二进制序列码转换成十进制序列码;按照所述十进制序列码中首位到末位的顺序,将所述十进制序列码划分为多个片段,并设置所述多个片段中每一片段的容量均小于或者等于单个二维码的最大容量;将所述片段转换成与所述片段对应的二维码,并将所述二维码进行光学加密,以使已加密的二维码通过光学解密还原为所述待加密图像。
本发明提供的一种基于光学加密和解密技术的图像解密方法,包括:将待解密二维码进行光学解密,得到已解密的二维码,并将所述已解密的二维码转换为包含有十进制数码的片段;按照所述已解密的二维码中预置的片段序号,将转换后的片段进行排列,以生成十进制序列码;按照预置的转换序列规则,将所述十进制序列码转换成二进制序列码;并将已转换的二进制序列码还原为图像。
本发明提供的一种基于光学加密和解密技术的图像加密装置,包括:转换模块用于将待加密图像转换成二进制序列码;所述转换模块,还用于按照预置的转换序列规则,将所述二进制序列码转换成十进制序列码;划分模块用于按照所述十进制序列码中首位到末位的顺序,将所述十进制序列码划分为多个片段,并设置所述多个片段中每一片段的容量均小于或者等于单个二维码的最大容量;所述转换模块还用于将所述片段转换成与所述片段对应的二维码,并将所述二维码进行光学加密,以使已加密的二维码通过光学解密还原为所述待加密图像。
本发明提供的一种基于光学加密和解密技术的图像解密装置,包括:转换模块用于将待解密二维码进行光学解密,得到已解密的二维码,并将所述已解密的二维码转换为包含有十进制数码的片段;生成模块用于按照所述已解密的二维码中预置的片段序号,将转换后的片段进行排列,以生成十进制序列码;所述转换模块用于按照预置的转换序列规则,将所述十进制序列码转换成二进制序列码;还原模块用于将已转换的二进制序列码还原为图像。
本发明提供的基于光学加密和解密技术的图像加密和解密方法及装置,将待加密图像转换成二进制序列码,按照预置的转换序列规则,将该二进制序列码转换成十进制序列码,按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量,将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像。
有益效果
这样将二维码作为图像的载体,再对该二维码进行光学加密,可以防止通过光学解密还原出的图像受到斑点噪声的干扰,进而使得解密出的图像更加清晰完整。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例。
图1是本发明第一实施例提供的基于光学加密和解密技术的图像加密方法的实现流程示意图;
图2是本发明第二实施例提供的基于光学加密和解密技术的图像加密方法的实现流程示意图;
图3是由图像转换为二维码过程的示意图;
图4是本发明第三实施例提供的基于光学加密和解密技术的图像解密方法的实现流程示意图;
图5是图3中图像加密方法对应的图像解密方法的示意图;
图6是本发明第四实施例提供的基于光学加密和解密技术的图像加密装置的结构示意图;
图7是本发明第五实施例提供的基于光学加密和解密技术的图像加密装置的结构示意图;
图8是本发明第六实施例提供的基于光学加密和解密技术的图像解密装置的结构示意图。
本发明的实施方式
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而非全部实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
请参阅图1,图1为本发明第一实施例提供基于光学加密和解密技术的图像加密方法的实现流程示意图,可应用于光学加密和解密系统中,图1所示的图像加密方法,主要包括以下步骤:
S101、将待加密图像转换成二进制序列码。
该待加密图像为灰度图像,也可以为彩色图像。在计算机中,任何存储格式的待加密图像均可以转换为二进制序列码,该待加密图像的存储格式可以为位图文件(BMP,Bitmap) 格式,也可以为个人电脑交换(PCX,Personal Computer Exchange)格式,也可以为图形交换格式(GIF, Graphics Interchange Format)格式,还可以为联合照片专家组(JPEG,Joint Photographic Expert Group) 格式,还可以为其他存储格式,此处不做赘述。
S102、按照预置的转换序列规则,将该二进制序列码转换成十进制序列码。
S103、按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量。
每个片段均包含有多个十进制数码。该最大容量为固有参数,不同种类的二维码具有不同的最大容量。例如,单个传统二维码的最大容量为1167数字,单个微小二维码(Micro QR Code)的最大容量为35个数字。
S104、将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像。
一个片段对应转换成一个二维码。生成的二维码均需要进行光学加密,以得到已加密的二维码。
本发明实施例中,将待加密图像转换成二进制序列码;按照预置的转换序列规则,将该二进制序列码转换成十进制序列码,按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量,将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像,这样将二维码作为图像的载体,再对该二维码进行光学加密,可以防止通过光学解密还原出的图像受到斑点噪声的干扰,进而使得解密出的图像更加清晰完整。
请参阅图2,图2为本发明第二实施例提供的基于光学加密和解密技术的图像加密方法的实现流程示意图,可应用于光学加密和解密系统中,图2所示的基于光学加密和解密技术的图像加密方法,主要包括以下步骤:
S201、将待加密图像转换成二进制序列码。
该待加密图像为灰度图像。在计算机中,任何存储格式的待加密图像均可以转换为二进制序列码,该待加密图像的存储格式可以为BMP格式,也可以为PCX格式,也可以为GIF格式,还可以为JPEG 格式,还可以为其他存储格式,此处不做赘述。
S202、按照预置顺序从该二进制序列码中未转换成十进制数码的二进制数码开始提取四个比特。
该预置顺序为该二进制序列码中首位到末位的排列顺序。例如,S201中由图像转换成的二进制序列码为10010101111000,则该二进制序列码的首位为位于整个序列最左侧的二进制数码1,该二进制序列码的末位为位于整个序列最右侧的二进制数码0,从该二进制序列码中提取的四个比特为1001。
S203、通过该四个比特的数值确定将二进制数码转换成十进制数码的方式。
可选地,通过该四个比特的数值确定将二进制数码转换成十进制数码的方式具体为:
若该四个比特为1000或1001,则依据预置的二进制转十进制规则,将为1000的该四个比特转换为十进制数码8,或将为1001的该四个比特转换为十进制数码9;
若该四个比特既非1000也非1001,则重新按照该预置顺序从该二进制序列码中未转换成十进制数码的二进制数码开始提取三个比特,并依据该二进制转十进制规则将该三个比特转换为十进制数码。
预置的二进制转十进制规则为:二进制数码1000转换为十进制数码8、二进制数码1001转换为十进制数码9,二进制数码000转换为十进制数码0,二进制数码001转换为十进制数码1,二进制数码010转换为十进制数码2,二进制数码011转换为十进制数码3,二进制数码100转换为十进制数码4,二进制数码101转换为十进制数码5,二进制数码110转换为十进制数码6,二进制数码111转换为十进制数码7。
S204、继续执行提取四个比特的过程,直至该二进制序列码中所有二进制数码均转换成十进制数码。
以二进制序列码10010101111000为例进行说明步骤S202-步骤S203,首先按照预置顺序从序列中提取未转换的四个比特1001,并直接将1001转换成十进制数码9;继续按照预置顺序提取未转换的四个比特0101,该四个比特既不是1000也不是1001,那么按照预置顺序重新提取未转换的三个比特010,并将010转换为十进制数码2;然后继续按照预置顺序从序列中提取未转换的四个比特1111,该四个比特既不是1000也不是1001,那么按照预置顺序重新提取未转换的三个比特111,并将111转换为十进制数码7;再继续按照预置顺序从序列中提取未转换的四个比特1000,并直接将1000转换为十进制数码8。
S205、按照转换的前后顺序对得到的十进制数码进行排列,得到该十进制序列码。
按照转换的前后顺序是将先转换得到的十进制数码排列在前面,后转换得到的十进制数码排列在后面,例如,以上述步骤S204中转换得到的十进制数码为例,按照转换的前后顺序进行排列得到的十进制序列码为:9278。
S206、按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量。
每个片段包含多个十进制数码。十进制序列码中首位到末位的顺序与二进制序列码中首位到末位的顺序两者之间的方向是一致的,例如,十进制序列码为9278,则十进制序列码的首位为9,末位为8。每个片段的容量必须小于或者等于单个二维码的最大容量,例如,假设单个二维码的最大容量为2个数字,十进制序列码为9278,则划分的两个片段分别为:片段A中包括9和2,片段B中包括7和8;假设单个二维码的最大容量是3个数字,则共有两种划分方式,第一种划分方式为:片段A中包括9和2,片段B中包括7和8;第二种划分方式为:片段A中包括9、2和7,片段B中包括8。
S207、将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像。
S208、按照该十进制序列码中各十进制数码的排列顺序,对每个片段对应的二维码插入预置的片段序号,以使在解密时将划分的片段按照该片段序号还原十进制序列码。
一个片段对应转换为一个二维码。片段序号是用于表示片段排列的前后顺序。该片段序号可以是以数字的形式表示,如1、2、3….N,数字越小,排列越往前,该片段序号也可以使用罗马数字,还可以自定义带有排列顺序的字符。例如,十进制序列码为9278,片段A中包括9和2,片段B中包括7和8,则片段A的片段序号为1,片段B的片段序号为2,那么片段A排列在前面,片段B排列在后面。通过片段序号可以确保在解密时由片段生成的十进制序列码中各数码的顺序与加密时的十进制序列码中各数码的顺序一致。
图3为由图像转换为二维码过程的示意图。如图3所示,下面以一个实际例子对上述步骤S201-步骤S208进行说明,具体如下:
步骤1:将待加密图像转换为001110100010011110110010010001000的二进制序列码;
步骤2:按照预置顺序从该二进制序列码中未转换成十进制数码的二进制数码开始提取四个比特0011;
步骤3:该四个比特既非1000也非1001,则重新按照该预置顺序从该二进制序列码中未转换成十进制数码的二进制数码开始提取三个比特001,并依据该进制转十进制规则将该个比特转换为十进制数码1;
步骤4:继续执行步骤1,提取到的四个比特为1101,然后执行步骤3,重新提取到的三个比特为110,并将110转换为十进制数码6;
步骤5:继续执行步骤1,提取到的四个比特为1000,并直接将1000转换为十进制数码8;
步骤6:继续执行步骤1,提取到的四个比特为1001,并直接将1001转换为十进制数码9;
按照上述的过程将步骤1的二进制序列码转换为十进制序列码1689731108;
假设二维码的最大容量为4个数字,则将该十进制序列码划分成的三个片段分别为片段1、片段2和片段3,其中片段1中包括1689,片段2中包括7311,片段3中包括08,满足每个片段均小于单个二维码的最大容量;
然后将片段1转换为二维码A,将片段2转换为二维码B,将片段3转换为二维码C,其中数字1、2和3为片段序号。
需要说明的是,上述划分片段的方式仅仅是一个举例,在满足划分出的每一片段均小于单个二维码的最大容量的情况下,可以选择其他划分方式。
本发明实施例中,将待加密图像转换成二进制序列码,按照预置顺序从该二进制序列码中未转换成十进制数码的二进制数码开始提取四个比特,通过该四个比特的数值确定将二进制数码转换成十进制数码的方式,继续执行提取四个比特的过程,直至该二进制序列码中所有二进制数码均转换成十进制数码,按照转换的前后顺序对得到的十进制数码进行排列,得到该十进制序列码,按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量,将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像,按照该十进制序列码中各十进制数码的排列顺序,对每个片段对应的二维码插入预置的片段序号,以使在解密时将划分的片段按照该片段序号还原十进制序列码,这样将二维码作为图像的载体,再对该二维码进行光学加密,可以防止通过光学解密还原出的图像受到斑点噪声的干扰,进而使得解密出的图像更加清晰完整。
请参阅图4,图4为本发明第三实施例提供基于光学加密和解密技术的图像解密方法的实现流程示意图,可应用于光学加密和解密系统中,图4所示的基于光学加密和解密技术的图像解密方法,主要包括以下步骤:
S401、将待解密二维码进行光学解密,得到已解密的二维码,并将该已解密的二维码转换为包含有十进制数码的片段。
S402、按照该已解密的二维码中预置的片段序号,将转换后的片段进行排列,以生成十进制序列码。
S403、按照预置的转换序列规则,将该十进制序列码转换成二进制序列码;
S404、将已转换的二进制序列码还原为图像。
该步骤S401-步骤S404的解密方法与上述图1和图2所示的实施例中图像加密方法对应,相关内容请参照上述的图1和图2实施例的描述,此处不再赘述。
图5为与图3中图像加密方法对应的图像解密方法的示意图。
本发明实施例中,将待解密二维码进行光学解密,得到已解密的二维码,并将该已解密的二维码转换为包含有十进制数码的片段,按照该已解密的二维码中预置的片段序号,将转换后的片段进行排列,以生成十进制序列码,按照预置的转换序列规则,将该十进制序列码转换成二进制序列码,将已转换的二进制序列码还原为图像,这样先对二维码进行光学解密,再将已解密的二维码还原出图像可以防止斑点噪声的干扰,进而使得解密出的图像更加清晰完整,同时利用片段序号可以更加准确的将片段还原成加密时的十进制序列码。
请参阅图6,图6是本发明第四实施例提供的基于光学加密和解密技术的图像加密装置的结构示意图,为了便于说明,仅示出了与本发明实施例相关的部分。图6示例的基于光学加密和解密技术的图像加密装置可以是前述图1和图2所示实施例提供的基于光学加密和解密技术的图像加密方法的执行主体。图6示例的基于光学加密和解密技术的图像加密装置,主要包括:转换模块601和划分模块602。以上各功能模块详细说明如下:
转换模块601,用于将待加密图像转换成二进制序列码;
转换模块601,还用于按照预置的转换序列规则,将该二进制序列码转换成十进制序列码;
划分模块602,用于按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量;
转换模块601,还用于将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像。
本实施例未尽之细节,请参阅前述图1所示实施例的描述,此处不再赘述。
本发明实施例中,转换模块601将待加密图像转换成二进制序列码,并按照预置的转换序列规则,将该二进制序列码转换成十进制序列码,划分模块602按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量,然后转换模块601将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像,这样将二维码作为图像的载体,再对该二维码进行光学加密,可以防止通过光学解密还原出的图像受到斑点噪声的干扰,进而使得解密出的图像更加清晰完整。
需要说明的是,以上图6示例的基于光学加密和解密技术的图像加密装置的实施方式中,各功能模块的划分仅是举例说明,实际应用中可以根据需要,例如相应硬件的配置要求或者软件的实现的便利考虑,而将上述功能分配由不同的功能模块完成,即将基于光学加密和解密技术的图像加密装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。而且,实际应用中,本实施例中的相应的功能模块可以是由相应的硬件实现,也可以由相应的硬件执行相应的软件完成。本说明书提供的各个实施例都可应用上述描述原则,以下不再赘述。
请参阅图7,图7为本发明第五实施例提供的基于光学加密和解密技术的图像加密装置的结构示意图,为了便于说明,仅示出了与本发明实施例相关的部分。图7示例的基于光学加密和解密技术的图像加密装置可以是前述图1和图2所示实施例提供的基于光学加密和解密技术的图像加密方法的执行主体。图7示例的基于光学加密和解密技术的图像加密装置,主要包括:转换模块701、划分模块702和设置模块703,其中转换模块701包括:提取模块7011、确定模块7012、执行模块7013和排列模块7014;确定模块7012包括:转换子模块70121。以上各功能模块详细说明如下:
转换模块701,用于将待加密图像转换成二进制序列码。
该待加密图像为灰度图像。在计算机中,任何存储格式的待加密图像均可以转换为二进制序列码,该待加密图像的存储格式可以为BMP格式,也可以为PCX格式,也可以为GIF格式,还可以为JPEG 格式,还可以为其他存储格式,此处不做赘述。
转换模块701包括:提取模块7011、确定模块7012、执行模块7013和排列模块7014;确定模块7012包括:转换子模块70121。
提取模块7011,用于按照预置顺序从该二进制序列码中未转换成十进制数码的二进制数码开始提取四个比特。
该预置顺序为该二进制序列码中首位到末位的排列顺序。例如,S201中由图像转换成的二进制序列码为10010101111000,则该二进制序列码的首位为位于整个序列最左侧的二进制数码1,该二进制序列码的末位为位于整个序列最右侧的二进制数码0,从该二进制序列码中提取的四个比特为1001。
确定模块7012,用于通过该四个比特的数值确定将二进制数码转换成十进制数码的方式。
可选地,确定模块7012包括:转换子模块70121。
转换子模块70121,用于若该四个比特为1000或1001,则依据预置的二进制转十进制规则,将为1000的该四个比特转换为十进制数码8,或将为1001的该四个比特转换为十进制数码9;
转换子模块70121,还用于若该四个比特既非1000也非1001,则重新按照该预置顺序从该二进制序列码中未转换成十进制数码的二进制数码开始提取三个比特,并依据该二进制转十进制规则将该三个比特转换为十进制数码。
预置的二进制转十进制规则为:二进制数码1000转换为十进制数码8、二进制数码1001转换为十进制数码9,二进制数码000转换为十进制数码0,二进制数码001转换为十进制数码1,二进制数码010转换为十进制数码2,二进制数码011转换为十进制数码3,二进制数码100转换为十进制数码4,二进制数码101转换为十进制数码5,二进制数码110转换为十进制数码6,二进制数码111转换为十进制数码7。
执行模块7013,用于继续执行提取四个比特的过程,直至该二进制序列码中所有二进制数码均转换成十进制数码。
以二进制序列码10010101111000为例进行说明步骤S202-步骤S203,首先按照预置顺序从序列中提取未转换的四个比特1001,并直接将1001转换成十进制数码9;继续按照预置顺序提取未转换的四个比特0101,该四个比特既不是1000也不是1001,那么按照预置顺序重新提取未转换的三个比特010,并将010转换为十进制数码2;然后继续按照预置顺序从序列中提取未转换的四个比特1111,该四个比特既不是1000也不是1001,那么按照预置顺序重新提取未转换的三个比特111,并将111转换为十进制数码7;再继续按照预置顺序从序列中提取未转换的四个比特1000,并直接将1000转换为十进制数码8。
排列模块7014,用于按照转换的前后顺序对得到的十进制数码进行排列,得到该十进制序列码。
按照转换的前后顺序是将先转换得到的十进制数码排列在前面,后转换得到的十进制数码排列在后面,例如,以上述步骤S204中转换得到的十进制数码为例,按照转换的前后顺序进行排列得到的十进制序列码为:9278。
划分模块702,用于按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量。
每个片段包含多个十进制数码。十进制序列码中首位到末位的顺序与二进制序列码中首位到末位的顺序两者之间的方向是一致的,例如,十进制序列码为9278,则十进制序列码的首位为9,末位为8。每个片段的容量必须小于或者等于单个二维码的最大容量,例如,假设单个二维码的最大容量为2个数字,十进制序列码为9278,则划分的两个片段分别为:片段A中包括9和2,片段B中包括7和8;假设单个二维码的最大容量是3个数字,则共有两种划分方式,第一种划分方式为:片段A中包括9和2,片段B中包括7和8;第二种划分方式为:片段A中包括9、2和7,片段B中包括8。
转换模块701,用于将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像。
设置模块703,用于按照该十进制序列码中各十进制数码的排列顺序,对每个片段对应的二维码插入预置的片段序号,以使在解密时将划分的片段按照该片段序号还原十进制序列码。
一个片段对应转换为一个二维码。片段序号是用于表示片段排列的前后顺序。该片段序号可以是以数字的形式表示,如1、2、3….N,数字越小,排列越往前,该片段序号也可以使用罗马数字,还可以自定义带有排列顺序的字符。例如,十进制序列码为9278,片段A中包括9和2,片段B中包括7和8,则片段A的片段序号为1,片段B的片段序号为2,那么片段A排列在前面,片段B排列在后面。通过片段序号可以确保在解密时由片段生成的十进制序列码中各数码的顺序与加密时的十进制序列码中各数码的顺序一致。
本实施例未尽之细节,请参阅前述图1和图2所示实施例的描述,此处不再赘述。
本发明实施例中,转换模块701将待加密图像转换成二进制序列码,提取模块7011按照预置顺序从该二进制序列码中未转换成十进制数码的二进制数码开始提取四个比特,确定模块7012通过该四个比特的数值确定将二进制数码转换成十进制数码的方式,执行模块7013继续执行提取四个比特的过程,直至该二进制序列码中所有二进制数码均转换成十进制数码,排列模块7014按照转换的前后顺序对得到的十进制数码进行排列,得到该十进制序列码,划分模块702按照该十进制序列码中首位到末位的顺序,将该十进制序列码划分为多个片段,并设置该多个片段中每一片段的容量均小于或者等于单个二维码的最大容量,转换模块701将该片段转换成与该片段对应的二维码,并将该二维码进行光学加密,以使已加密的二维码通过光学解密还原为该待加密图像,设置模块703按照该十进制序列码中各十进制数码的排列顺序,对每个片段对应的二维码插入预置的片段序号,以使在解密时将划分的片段按照该片段序号还原十进制序列码,这样将二维码作为图像的载体,再对该二维码进行光学加密,可以防止通过光学解密还原出的图像受到斑点噪声的干扰,进而使得解密出的图像更加清晰完整。
请参阅图8,图8是本发明第六实施例提供的基于光学加密和解密技术的图像解密装置的结构示意图,为了便于说明,仅示出了与本发明实施例相关的部分。图8示例的基于光学加密和解密技术的图像解密装置可以是前述图3所示实施例提供的基于光学加密和解密技术的图像解密方法的执行主体。图8示例的基于光学加密和解密技术的图像解密装置,主要包括:转换模块801、生成模块802和还原模块803。以上各功能模块详细说明如下:
转换模块801,用于将待解密二维码进行光学解密,得到已解密的二维码,并将该已解密的二维码转换为包含有十进制数码的片段;
生成模块802,用于按照该已解密的二维码中预置的片段序号,将转换后的片段进行排列,以生成十进制序列码;
转换模块801,用于按照预置的转换序列规则,将该十进制序列码转换成二进制序列码;
还原模块803,用于并将已转换的二进制序列码还原为图像。
本实施例未尽之细节,请参阅前述图1、图2和图3所示实施例的描述,此处不再赘述。
需要说明的是,本发明实施例中的基于光学加密和解密技术的图像解密装置与上述图6和图7所示的基于光学加密和解密技术的图像加密装置可以位于一个终端中,也可以位于不同的终端中。
本发明实施例中,转换模块801将待解密二维码进行光学解密,得到已解密的二维码,并将该已解密的二维码转换为包含有十进制数码的片段,生成模块802按照该已解密的二维码中预置的片段序号,将转换后的片段进行排列,以生成十进制序列码,转换模块801按照预置的转换序列规则,将该十进制序列码转换成二进制序列码,还原模块803将已转换的二进制序列码还原为图像,这样先对二维码进行光学解密,再将已解密的二维码还原出图像可以防止斑点噪声的干扰,进而使得解密出的图像更加清晰完整,同时利用片段序号可以更加准确的将片段还原成加密时的十进制序列码。
在本申请所提供的多个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信链接可以是通过一些接口,装置或模块的间接耦合或通信链接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本发明所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
以上为对本发明所提供的基于光学加密和解密技术的图像加密和解密方法及装置的描述,对于本领域的技术人员,依据本发明实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。

Claims (10)

  1. 一种基于光学加密和解密技术的图像加密方法,其特征在于,包括:
    将待加密图像转换成二进制序列码;
    按照预置的转换序列规则,将所述二进制序列码转换成十进制序列码;
    按照所述十进制序列码中首位到末位的顺序,将所述十进制序列码划分为多个片段,并设置所述多个片段中每一片段的容量均小于或者等于单个二维码的最大容量;
    将所述片段转换成与所述片段对应的二维码,并将所述二维码进行光学加密,以使已加密的二维码通过光学解密还原为所述待加密图像。
  2. 根据权利要求1所述的方法,其特征在于,所述按照预置的转换序列规则,将所述二进制序列码转换成十进制序列码包括:
    按照预置顺序从所述二进制序列码中未转换成十进制数码的二进制数码开始提取四个比特,其中所述预置顺序为所述二进制序列码中首位到末位的排列顺序;
    通过所述四个比特的数值确定将二进制数码转换成十进制数码的方式;
    继续执行提取四个比特的过程,直至所述二进制序列码中所有二进制数码均转换成十进制数码;
    按照转换的前后顺序对得到的十进制数码进行排列,得到所述十进制序列码。
  3. 根据权利要求2所述的方法,其特征在于,所述通过所述四个比特的数值确定将二进制数码转换成十进制数码的方式包括:
    若所述四个比特为1000或1001,则依据预置的二进制转十进制规则,将为1000的所述四个比特转换为十进制数码8,或将为1001的所述四个比特转换为十进制数码9;
    若所述四个比特既非1000也非1001,则重新按照所述预置顺序从所述二进制序列码中未转换成十进制数码的二进制数码开始提取三个比特,并依据所述二进制转十进制规则将所述三个比特转换为十进制数码。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述将所述片段转换成与所述片段对应的二维码,并将所述二维码进行光学加密之后,还包括:
    按照所述十进制序列码中各十进制数码的排列顺序,对每个片段对应的二维码插入预置的片段序号,以使在解密时将划分的片段按照所述片段序号还原十进制序列码。
  5. 一种基于光学加密和解密的图像解密方法,其特征在于,所述方法包括:
    将待解密二维码进行光学解密,得到已解密的二维码,并将所述已解密的二维码转换为包含有十进制数码的片段;
    按照所述已解密的二维码中预置的片段序号,将转换后的片段进行排列,以生成十进制序列码;
    按照预置的转换序列规则,将所述十进制序列码转换成二进制序列码;
    并将已转换的二进制序列码还原为图像。
  6. 一种基于光学加密和解密的图像加密装置,其特征在于,所述装置包括:
    转换模块,用于将待加密图像转换成二进制序列码;
    所述转换模块,还用于按照预置的转换序列规则,将所述二进制序列码转换成十进制序列码;
    划分模块,用于按照所述十进制序列码中首位到末位的顺序,将所述十进制序列码划分为多个片段,并设置所述多个片段中每一片段的容量均小于或者等于单个二维码的最大容量;
    所述转换模块,还用于将所述片段转换成与所述片段对应的二维码,并将所述二维码进行光学加密,以使已加密的二维码通过光学解密还原为所述待加密图像。
  7. 根据权利要求6所述的装置,其特征在于,所述转换模块包括:
    提取模块,用于按照预置顺序从所述二进制序列码中未转换成十进制数码的二进制数码开始提取四个比特,其中所述预置顺序为所述二进制序列码中首位到末位的排列顺序;
    确定模块,用于通过所述四个比特的数值确定将二进制数码转换成十进制数码的方式;
    执行模块,用于继续执行提取四个比特的过程,直至所述二进制序列码中所有二进制数码均转换成十进制数码;
    排列模块,用于按照转换的前后顺序对得到的十进制数码进行排列,得到所述十进制序列码。
  8. 根据权利要求7所述的装置,其特征在于,所述确定模块包括:
    转换子模块,用于若所述四个比特为1000或1001,则依据预置的二进制转十进制规则,将为1000的所述四个比特转换为十进制数码8,或将为1001的所述四个比特转换为十进制数码9;
    所述转换子模块,还用于若所述四个比特既非1000也非1001,则重新按照所述预置顺序从所述二进制序列码中未转换成十进制数码的二进制数码开始提取三个比特,并依据所述二进制转十进制规则将所述三个比特转换为十进制数码。
  9. 根据权利要求6-8任一项所述的装置,其特征在于,所述装置还包括:
    设置模块,用于按照所述十进制序列码中各十进制数码的排列顺序,对每个片段对应的二维码插入预置的片段序号,以使在解密时将划分的片段按照所述片段序号还原十进制序列码。
  10. 一种基于光学加密和解密的图像解密装置,其特征在于,所述装置包括:
    转换模块,用于将待解密二维码进行光学解密,得到已解密的二维码,并将所述已解密的二维码转换为包含有十进制数码的片段;
    生成模块,用于按照所述已解密的二维码中预置的片段序号,将转换后的片段进行排列,以生成十进制序列码;
    所述转换模块,用于按照预置的转换序列规则,将所述十进制序列码转换成二进制序列码;
    还原模块,用于将已转换的二进制序列码还原为图像。
PCT/CN2016/105931 2016-11-15 2016-11-15 基于光学加密和解密技术的图像加密和解密方法及装置 WO2018090192A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/105931 WO2018090192A1 (zh) 2016-11-15 2016-11-15 基于光学加密和解密技术的图像加密和解密方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/105931 WO2018090192A1 (zh) 2016-11-15 2016-11-15 基于光学加密和解密技术的图像加密和解密方法及装置

Publications (1)

Publication Number Publication Date
WO2018090192A1 true WO2018090192A1 (zh) 2018-05-24

Family

ID=62146027

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/105931 WO2018090192A1 (zh) 2016-11-15 2016-11-15 基于光学加密和解密技术的图像加密和解密方法及装置

Country Status (1)

Country Link
WO (1) WO2018090192A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783667A (zh) * 2019-01-14 2019-05-21 西安电子科技大学 一种图像存储和检索的方法、客户端及系统
CN112529586A (zh) * 2020-12-15 2021-03-19 深圳市快付通金融网络科技服务有限公司 交易信息管理方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1818935A (zh) * 2006-03-17 2006-08-16 北京紫光捷通科技有限公司 一种基于十六进制编码的构建二维码的方法
US20110053639A1 (en) * 2006-11-03 2011-03-03 Alcoril Holdings Sa Methods and devices for authenticating a product and a two-dimensional code and novel application of a two-dimensional code
CN104616046A (zh) * 2015-02-28 2015-05-13 立德高科(北京)数码科技有限责任公司 一种二维码及其生成方法与识别方法
CN105718978A (zh) * 2014-12-03 2016-06-29 航天信息股份有限公司 Qr码的生成方法、装置及解码方法、装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1818935A (zh) * 2006-03-17 2006-08-16 北京紫光捷通科技有限公司 一种基于十六进制编码的构建二维码的方法
US20110053639A1 (en) * 2006-11-03 2011-03-03 Alcoril Holdings Sa Methods and devices for authenticating a product and a two-dimensional code and novel application of a two-dimensional code
CN105718978A (zh) * 2014-12-03 2016-06-29 航天信息股份有限公司 Qr码的生成方法、装置及解码方法、装置
CN104616046A (zh) * 2015-02-28 2015-05-13 立德高科(北京)数码科技有限责任公司 一种二维码及其生成方法与识别方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783667A (zh) * 2019-01-14 2019-05-21 西安电子科技大学 一种图像存储和检索的方法、客户端及系统
CN109783667B (zh) * 2019-01-14 2023-10-27 西安电子科技大学 一种图像存储和检索的方法、客户端及系统
CN112529586A (zh) * 2020-12-15 2021-03-19 深圳市快付通金融网络科技服务有限公司 交易信息管理方法、装置、设备及存储介质
CN112529586B (zh) * 2020-12-15 2023-07-28 深圳市快付通金融网络科技服务有限公司 交易信息管理方法、装置、设备及存储介质

Similar Documents

Publication Publication Date Title
WO2020022598A1 (ko) 암호문에 대한 근사 연산을 수행하는 장치 및 방법
WO2018149082A1 (zh) 合同生成方法、装置、服务器和存储介质
WO2014069778A1 (ko) 아이디 기반 암호화, 복호화 방법 및 이를 수행하기 위한 장치
JP2012212138A (ja) 暗号化プログラム、復号化プログラム、暗号化方法、復号化方法、システムおよびコンテンツの生成方法
WO2019223583A1 (zh) 数据加密传输方法、终端设备及超晶格混沌器件的使用方法
WO2014063455A1 (zh) 即时通信方法和系统
KR20050035140A (ko) 컨텐츠 처리 장치 및 컨텐츠 보호 프로그램
WO2017063357A1 (zh) 一种数据隐藏方法及隐藏系统
WO2013170653A1 (zh) 一种屏幕锁解锁系统及方法
WO2014003497A1 (ko) 특정 포맷을 가지는 대체 데이터의 생성 및 검증
CN106530206B (zh) 基于光学加密和解密技术的图像加密和解密方法及装置
WO2013149548A1 (zh) 一种手机数据加密方法以及解密方法
WO2018090192A1 (zh) 基于光学加密和解密技术的图像加密和解密方法及装置
WO2016206530A1 (zh) 一种高级安全的移动支付方法、装置及系统
WO2020186775A1 (zh) 业务数据提供方法、装置、设备及计算机可读存储介质
WO2018072261A1 (zh) 信息加密方法及装置、信息解密方法及装置及终端
WO2018093203A1 (ko) 공개키를 이용하여 암호화하는 연산 장치 및 그 암호화 방법
US20080098217A1 (en) Method for efficient and secure data migration between data processing systems
WO2018032583A1 (zh) 一种终端位置信息获取方法及装置
SE508373C2 (sv) Kruptosystem för optiskt lagringsmedia
CN114050915A (zh) 隔离网络下细粒度权限访问同步方法、装置及设备
WO2011111981A2 (ko) 데이터 자동 암복호화 방법 및 장치
WO2023191216A1 (ko) 데이터 암호화 및 복호화 시스템, 방법
JP2018061171A (ja) 暗号化システム、暗号化方法、暗号化装置および暗号化プログラム
WO2023065772A1 (zh) 日志数据处理方法及装置、存储介质和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16921988

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.09.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16921988

Country of ref document: EP

Kind code of ref document: A1