The present application is based on, and claims priority from, China Patent Application No. 202110398917.1, filed Apr. 14, 2021, the disclosure of which is hereby incorporated by reference herein in its entirety.
1.Field of the Invention
The present invention relates to an encryption method, in particular to an encryption method which increases data encryption efficiency.
2. The Related Art
In some products, such as scanners, the scanned data is sent out directly as soon as the file is scanned due to the limited temporary memory space of the scanner. And in the data transmission process, a third party can intercept the file through wireless network or wired transmission line. If a confidential document is intercepted by others, it will cause great loss to the user.
Referring to
However, the quantity of blocks 11′ increases as the data size increases or the quantity of files increases, and thus it requires more computation time for the conventional encryption method to encrypt every single block 11. For devices with less computational performance such as scanners, this will cause the encryption time to become too long and thus delays the transmission efficiency. In the situations that needs to transmit confidential files to other device quickly, this method is inconvenient.
Therefore, it is necessary to provide an encryption method which increases data encryption efficiency without losing file confidentiality.
The objective of the present invention is to provide an encryption method which increases data encryption efficiency.
A machine readable storage medium having stored thereon machine readable steps to cause a processor to: (a) segment a data stream into a plurality of equal length blocks, wherein each equal length block of the plurality of equal length blocks has a fixed length; (b) verify the readability of the plurality of blocks segmented form the data stream, and then to perform step (c) if any of blocks segmented from the data stream is sorted to be readable, and to perform step (d) if the blocks segmented from the data stream are all un-readable; (c) encrypt the block that is readable; (d) encrypt the block in specific order in the sequence.
In a preferred embodiment, wherein the instructions to cause a processor to perform the step (b) verifying the readability of the blocks by measuring the data size of the data stream, and identifying the block as readable if the block contains a data stream which is shorter than the fixed block length.
In a preferred embodiment, wherein the instructions to cause a processor to perform the step (b) verifying the readability of the blocks by examine the data formation of the data stream, and identifying the first block of the data stream as readable if the data formation of the data stream contains a header.
A method comprising: (a) segmenting a data stream into a plurality of equal length blocks, wherein each equal length block of the plurality of equal length blocks has a fixed length; (b) verifying the readability of the plurality of blocks segmented form the data stream, and then performing step (c) if any of blocks segmented from the data stream is sorted to be readable, and performing step (d) if the blocks segmented from the data stream are all un-readable; (c) encrypting the block that is readable; (d) encrypting the block in specific order in the sequence.
In a preferred embodiment, wherein the step (b) further comprising verifying the readability of the blocks by measuring the data size of the data stream, and identifying the block as readable if the block contains a data stream which is shorter than the fixed block length.
In a preferred embodiment, wherein the step (b) further comprising verifying the readability of the blocks by examine the data formation of the data stream, and identifying the first block of the data stream as readable if the data formation of the data stream contains a header.
A system comprising: a processor; and a memory storing machine readable instructions to cause the processor to: (a) segment a data stream into a plurality of equal length blocks, wherein each equal length block of the plurality of equal length blocks has a fixed length; (b) verify the readability of the plurality of blocks segmented form the data stream, and then to perform step (c) if any of blocks segmented from the data stream is sorted to be readable, and to perform step (d) if the blocks segmented from the data stream are all un-readable; (c) encrypt the block that is readable; (d) encrypt the block in specific order in the sequence.
The present invention will be apparent to those skilled in the art by reading the following description, with reference to the attached drawings, in which:
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be apparent to one of ordinary skill in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the embodiments.
Instructions A01 stored on transmitting device memory are to cause transmitting device processor to segment a data stream into a plurality of blocks. The term “data stream” as used herein can, for example, refer to a plaintext message or information that is readable and meaningful to humans or to a computer. For example, such a data stream can be in the form of a textual message, computer code (e.g., to run a program, produce an image, etc.), image data, or any other suitable information to be communicated between entities. The term “plaintext” as used herein can generally refer to a representation of data before any action has been taken to conceal, compress, or digest it. The term “block” as used herein can, for example, refer to a fixed-length groups of bits of the largest protocol data unit that the network layer can transfer. Referring to
In some implementations, most of the data streams become un-readable as they are segmented into blocks, because not a single block contains enough information that is meaningful to human or to a computer, but in some situation, the segmented blocks may still be readable. For example, the data stream is shorter than a block size so the whole data stream is contained in a single block (e.g., a command code for control the receiving device), or the data stream is consisted of a sequence of fixed segments, and the block contains a certain segment which can be interpreted independently without reference to other segments (e.g., header of a JPEG file, a textual message, protocol parameters between devices, etc.).
Instructions A02 to A04 stored on transmitting device memory are to cause transmitting device processor to encrypt the blocks that meet the predefined conditions to ensure at least one block of the data stream is encrypted. Referring to
Instructions A05 stored on transmitting device memory are to cause data transmitting unit to transmit the blocks to the receiving device, and instructions B01 stored on receiving device memory are to cause data receiving unit to receive the blocks from the transmitting device. In some implementations, referring to
Instructions B02 stored on receiving device memory are to cause receiving device processor to decrypt blocks that meet the predefined conditions, and the rule for choosing which block to decrypt in the instructions B02 is same as the rule for choosing which block to encrypt in the instructions A01 to ensure every encrypted block are decrypted before concatenating. In some implementations, the receiving device processor decrypts the blocks that contains a whole data stream. In some implementations, the receiving device processor decrypts the blocks that contains readable information. As an example, the data stream is a JPEG image of which the first block contains a readable header 111, so the receiving device processor decrypts the information first block of the data stream. In some implementations, the receiving device processor counts the quantity of blocks of the data stream, and decrypts the blocks in specific order in the sequence. As an example, the receiving device processor counts the quantity of received blocks, and decrypts every second block in sequence. It is appreciated that any suitable block of data from each data stream can be used. As another example, in some implementations, the receiving device processor decrypts the last block in sequence.
Instructions B03 stored on receiving device memory are to cause receiving device processor to concatenate all blocks of the data stream into a single plaintext.
In some implementations, the transmitting device is a scanning device, the receiving device is an electronical device, the data streams are images scanned by the transmitting device, the transmitting device processor is a MPU of the scanning device, the receiving device processor is a MPU of the electronical device, and the instructions that when executed by the transmitting device processor and the receiving device processor are to encrypt the data streams and to transmit the data streams are stored in the scanning device and the electronical device. In some implementations, the transmitting device is an electronical device, the receiving device is an exporting device (e.g., a printer) for exporting data of images. The electronical device encrypts the data streams and transmits the data stream to the exporting device, and the exporting device decrypts the data streams and prints it out. In some implementations, the transmitting device and the receiving device are both electronical devices, so that the transmitting device encrypts the data streams and transmits the data streams to the receiving device, and the receiving device decrypts the data streams for further processing (e.g., store the data, display the data, etc.).
In some implementations, the encryption method in this invention is applicated on a scanner of which the scan rate is 60 image per minute (ipm), and the quantity of images to be scanned are 60. The images to be scanned are scanned in three different image quality (e.g., high, medium, and low quality) and the total data size of each scanning results are 548 MB, 325 MB, and 172 MB. If the scanning results are encrypted with the conventional encryption method and each block size is set to 0.5 MB, then the number of encryptions would be 1096 times for high quality images, 650 times for medium quality images and 344 times for low quality images. However, if the scanning results are encrypted with the encryption method in this invention and the block size remains 0.5 MB, then the number of encryptions would be 60 times no matter what kind of image quality the images are, since the encryption method in this invention only encrypts the blocks that contains header. Therefore, images can be encrypted in only 20 seconds and only takes 60 encryptions for the encryption method in this invention while still providing acceptable security in comparing to the conventional encryption method that takes roughly 361 seconds and 1096 encryptions to encrypt all the images. The encryption method of the present disclosure is far more efficient than conventional methods.
In summary, the encryption method in this invention encrypts the blocks that meet the predefined conditions to save time on encryption while still providing acceptable security.
Number | Date | Country | Kind |
---|---|---|---|
202110398917.1 | Apr 2021 | CN | national |