CN116611986B - Data encryption method, system, computer equipment and storage medium - Google Patents
Data encryption method, system, computer equipment and storage medium Download PDFInfo
- Publication number
- CN116611986B CN116611986B CN202310886556.4A CN202310886556A CN116611986B CN 116611986 B CN116611986 B CN 116611986B CN 202310886556 A CN202310886556 A CN 202310886556A CN 116611986 B CN116611986 B CN 116611986B
- Authority
- CN
- China
- Prior art keywords
- image
- channel
- random
- encrypted
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 238000007781 pre-processing Methods 0.000 claims abstract description 28
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 14
- 238000000605 extraction Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 8
- 238000013500 data storage Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 239000003086 colorant Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000013075 data extraction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/0021—Image watermarking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6209—Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Studio Devices (AREA)
- Closed-Circuit Television Systems (AREA)
Abstract
The invention is applicable to the technical field of data processing, and particularly relates to a data encryption method, a system, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring an image to be encrypted; determining the size of a random image based on the pixel proportion of the image, and randomly acquiring a group of random images through a network camera; preprocessing the random image to obtain a preprocessed image, and carrying out batch encryption processing on the image to be encrypted through the preprocessed image and storing the image; the preprocessing image is converted into three groups of different channel images, and the three groups of channel images are respectively stored in three groups of different storage devices. According to the invention, the image acquisition is carried out through the random algorithm and the network camera, the image to be encrypted is subjected to superposition processing based on the acquired image, and the image subjected to superposition processing is encrypted, so that the original information of the image is covered, the acquired random image is independently stored as a plurality of groups of channel parameters, and the safety of data is ensured.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data encryption method, a data encryption system, a computer device, and a storage medium.
Background
Data encryption is a technology with long history, which means that plaintext is converted into ciphertext through an encryption algorithm and an encryption key, and ciphertext is recovered into plaintext through a decryption algorithm and a decryption key. Its core is cryptography; data encryption is still one of the most reliable ways for computer systems to protect information. The information is encrypted by utilizing a password technology, so that information concealment is realized, and the effect of protecting the safety of the information is achieved.
Image data is one of important kinds of data, and in the conventional field, key management and key distribution of conventional encryption are difficult and inefficient.
Disclosure of Invention
The embodiment of the invention aims to provide a data encryption method, which aims to solve the problems that the encryption process of image data serving as one of important types of data is complex and the efficiency is low.
The embodiment of the invention is realized in such a way that a data encryption method comprises the following steps:
acquiring an image to be encrypted, and extracting basic information of the image to be encrypted, wherein the basic information at least comprises pixel proportion of the image;
determining the size of a random image based on the pixel proportion of the image, and randomly acquiring a group of random images through a network camera;
preprocessing the random image to obtain a preprocessed image, and carrying out batch encryption processing on the image to be encrypted through the preprocessed image and storing the image;
the preprocessing image is converted into three groups of different channel images, and the three groups of channel images are respectively stored in three groups of different storage devices.
Preferably, the step of determining the size of the random image based on the pixel proportion of the image and randomly collecting a group of random images by the network camera specifically includes:
basic information of an image to be encrypted is read, and the number of horizontal pixels and the number of vertical pixels of the random image are determined;
extracting image acquisition data of each network camera, and determining the network cameras for image acquisition according to the image acquisition data;
and sending a graph acquisition instruction to the network camera based on the determined time of the network camera to obtain a group of random images.
Preferably, the preprocessing the random image to obtain a preprocessed image, and performing batch encryption processing on the image to be encrypted through the preprocessed image, and storing the image, specifically including:
cutting the random image according to the set size of the random image to obtain a preprocessed image;
three channel parameter values of each pixel in the preprocessed image and the image to be encrypted are read;
and carrying out superposition processing on the extracted two groups of three-channel parameter values to complete batch encryption and storing, wherein the superposition processing comprises summation processing or difference processing.
Preferably, the step of converting the preprocessed image into three different sets of channel images, and storing the three sets of channel images in three different sets of storage devices respectively, specifically includes:
extracting parameter values corresponding to each pixel in the preprocessed image according to the red channel, the green channel and the blue channel;
extracting a storage device list, generating a random number through a random algorithm, and designating three groups of storage devices from the storage device list based on the random number;
and respectively storing parameter values corresponding to the red channel, the green channel and the blue channel in three groups of storage devices.
It is another object of an embodiment of the present invention to provide a data encryption system, the system including:
the basic information extraction module is used for acquiring an image to be encrypted and extracting basic information of the image to be encrypted, wherein the basic information at least comprises pixel proportion of the image;
the image acquisition module is used for determining the size of the random image based on the pixel proportion of the image and randomly acquiring a group of random images through the network camera;
the image encryption module is used for preprocessing the random image to obtain a preprocessed image, and carrying out batch encryption processing on the image to be encrypted through the preprocessed image and storing the image;
and the encryption data storage module is used for converting the preprocessed image into three groups of different channel images and respectively storing the three groups of channel images in three groups of different storage devices.
Preferably, the image acquisition module includes:
the image size determining unit is used for reading basic information of the image to be encrypted and determining the number of horizontal pixels and the number of vertical pixels of the random image;
the image acquisition equipment selection unit is used for extracting image acquisition data of each network camera and determining the network camera for image acquisition according to the image acquisition data;
the random image acquisition unit is used for sending a graph acquisition instruction to the network camera based on the determined time of the network camera to obtain a group of random images.
Preferably, the image encryption module includes:
the image clipping unit is used for clipping the random image according to the set size of the random image to obtain a preprocessed image;
the channel parameter extraction unit is used for reading three channel parameter values of each pixel in the preprocessed image and the image to be encrypted;
and the superposition encryption unit is used for performing superposition processing on the two groups of three-channel parameter values obtained by extraction, completing batch encryption and storing, wherein the superposition processing comprises summation processing or difference processing.
Preferably, the encrypted data storage module includes:
the parameter extraction unit is used for extracting parameter values corresponding to each pixel in the preprocessed image according to the red channel, the green channel and the blue channel;
a storage device selection unit for extracting a storage device list, generating a random number by a random algorithm, and designating three groups of storage devices from the storage device list based on the random number;
and the data independent storage unit is used for respectively storing the parameter values corresponding to the red channel, the green channel and the blue channel in three groups of storage devices.
It is a further object of an embodiment of the present invention to provide a computer device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the data encryption method as described above.
It is a further object of embodiments of the present invention to provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of the data encryption method as described above.
According to the data encryption method provided by the embodiment of the invention, the image acquisition is carried out through the random algorithm and the network camera, the image to be encrypted is subjected to superposition processing based on the acquired image, the image subjected to superposition processing is encrypted, so that the original information of the image is covered, the acquired random image is independently stored as a plurality of groups of channel parameters, and the safety of the data is ensured.
Drawings
FIG. 1 is a flow chart of a data encryption method according to an embodiment of the present invention;
FIG. 2 is a flowchart showing steps for determining a size of a random image based on a pixel ratio of the image, and randomly collecting a group of random images by a network camera according to an embodiment of the present invention;
FIG. 3 is a flowchart of the steps for preprocessing a random image to obtain a preprocessed image, performing batch encryption processing on an image to be encrypted through the preprocessed image, and storing the processed image;
FIG. 4 is a flowchart illustrating steps for converting a preprocessed image into three different sets of channel images and storing the three sets of channel images in three different sets of storage devices, respectively, according to an embodiment of the present invention;
FIG. 5 is a block diagram of a data encryption system according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an image acquisition module according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an image encryption module according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an encrypted data storage module according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
It will be understood that the terms "first," "second," and the like, as used herein, may be used to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another element. For example, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script, without departing from the scope of the present application.
As shown in fig. 1, a flowchart of a data encryption method according to an embodiment of the present invention is provided, where the method includes:
s100, obtaining an image to be encrypted, and extracting basic information of the image to be encrypted, wherein the basic information at least comprises pixel proportion of the image.
In this step, an image to be encrypted is obtained, and the image to be encrypted may be one image or multiple groups of images, specifically, all the images to be encrypted are collected together and classified according to the pixel size of the images, for example, 500 pixels by 500 pixels are put together, 600 pixels by 600 pixels are put together, 700 pixels by 700 pixels are put together, so that only one type of image to be encrypted with one size is processed at a time, the same type of image to be encrypted may be encrypted at the same time, and basic information of the image to be encrypted is extracted, where the basic information at least includes the pixel proportion of the image.
S200, determining the size of a random image based on the pixel proportion of the image, and randomly collecting a group of random images through a network camera.
In this step, the size of the random image is determined based on the pixel ratio of the image, where the pixel ratio records the number of pixels in the width direction and the number of pixels in the height direction of the image to be stored, for example, 500 pixels×600 pixels, where the number of pixels in the width direction is 500 and the number of pixels in the height direction is 600, then the callable network cameras are identified according to the pixel size, a set of network cameras with the same or similar acquisition size as the pixel size is determined, and the time of image acquisition is determined by a random algorithm, at which time the network cameras acquire a set of images, so as to obtain the random image.
S300, preprocessing the random image to obtain a preprocessed image, and carrying out batch encryption processing on the image to be encrypted through the preprocessed image and storing the image.
In this step, the random image is preprocessed, and because the size of the image acquired by the network camera is fixed, the size of the image is possibly different from the size of the image to be encrypted, after the random image is acquired, the random image is cut according to the size of the image to be encrypted, so that the random image and the image to be encrypted have the same size, and the preprocessed image is superimposed on the image to be encrypted, so as to change the content of the image to be encrypted, and the batch encryption is performed, so that all the images to be encrypted in the batch are processed, and then the images to be encrypted are stored.
S400, converting the preprocessed image into three groups of different channel images, and respectively storing the three groups of channel images in three groups of different storage devices.
In this step, the preprocessing image is converted into three groups of different channel images, specifically, the preprocessing image is converted through an RGB mode, and data extraction is performed through colors of three channels, so that three groups of different channel images, namely, a red channel image, a green channel image and a blue channel image, are obtained.
As shown in fig. 2, as a preferred embodiment of the present invention, the step of determining the size of the random image based on the pixel ratio of the image, and randomly collecting a set of random images by the webcam, specifically includes:
s201, basic information of an image to be encrypted is read, and the number of horizontal pixels and the number of vertical pixels of the random image are determined.
In this step, the basic information of the image to be encrypted is read, and the image format of the image to be encrypted and the number of pixels in each direction are all used as the basic information, specifically, at least the number of horizontal pixels and the number of vertical pixels of the random image need to be extracted.
S202, extracting image acquisition data of each network camera, and determining the network camera for image acquisition according to the image acquisition data.
In this step, the image acquisition data of each network camera is extracted, and each network camera is different in setting and hardware, so that the acquired images are also different, and in order to match the acquired images with the image to be encrypted as much as possible, the pixel sizes of the acquired images and the image to be encrypted are compared, and a group of network cameras with the closest sizes is selected.
S203, based on the determined time of the network camera, sending a graph acquisition instruction to the network camera to obtain a group of random images.
In this step, based on the determined time of the network camera, when the network camera is selected, the time is recorded, the time is added with a preset duration as the time for capturing images, and the time is sent to the network camera to capture a group of random images.
As shown in fig. 3, as a preferred embodiment of the present invention, the preprocessing of the random image to obtain a preprocessed image, and the batch encryption processing of the image to be encrypted by the preprocessed image, and the storing specifically includes:
s301, cutting the random image according to the set size of the random image to obtain a preprocessed image.
In this step, the random image is cut according to the set size of the random image, and although the network camera is selected, it is difficult to ensure that the size of the image acquired by the network camera is completely consistent with the size of the image to be encrypted, so that the network camera is cut to completely conform to the sizes of the two images.
S302, three channel parameter values of all pixels in the preprocessed image and the image to be encrypted are read.
S303, performing superposition processing on the two groups of three-channel parameter values obtained by extraction, completing batch encryption, and storing, wherein the superposition processing comprises summation processing or difference processing.
In this step, three channel parameter values of each pixel in the pre-processed image and the image to be encrypted, namely, the red channel value, the green channel value and the blue channel value are read, and taking a pixel as an example, a and b are a group of pixels in corresponding positions in the pre-processed image and the image to be encrypted, wherein a is from the pre-processed image, b is from the image to be encrypted, three channel parameters of a pixel are a1, a2 and a3 respectively, three channel parameters of b pixel are b1, b2 and b3 respectively, and a is calculated by n And b n Summing, if the sum of the two does not exceed the upper parameter limit of the channel, then the sum is a n +b n As the parameter value of the channel corresponding to the position pixel after encryption, if a n +b n If the sum exceeds the upper parameter limit, then the sum is represented by |a n -b n And I is taken as a parameter value of a channel corresponding to the pixel in the position after encryption, the former is summed to be subjected to sum processing, and the latter is subjected to difference processing, so that three channel parameters of each pixel of the image after encryption are determined.
As shown in fig. 4, as a preferred embodiment of the present invention, the step of converting the preprocessed image into three different sets of channel images, and storing the three sets of channel images in three different sets of storage devices respectively, specifically includes:
s401, extracting parameter values corresponding to each pixel in the preprocessed image according to the red channel, the green channel and the blue channel.
In this step, information extraction is performed according to the red channel, the green channel and the blue channel, and each pixel has three channels, so that three sets of channel parameter values are obtained, and the parameter values are packed to be three independent sets of data.
S402, extracting a storage device list, generating a random number through a random algorithm, and designating three groups of storage devices from the storage device list based on the random number.
And S403, respectively storing parameter values corresponding to the red channel, the green channel and the blue channel in three groups of storage devices.
In this step, a storage device list is extracted, all devices that can be used for storing data are recorded in the storage device list, the devices are numbered, then a random number is generated through a random algorithm, and three groups of devices are selected for storing parameter values corresponding to three channels.
As shown in fig. 5, an architecture diagram of a data encryption system according to an embodiment of the present invention is provided, where the system includes:
the basic information extraction module 100 is configured to obtain an image to be encrypted, and extract basic information of the image to be encrypted, where the basic information includes at least a pixel ratio of the image.
In the system, the basic information extraction module 100 acquires an image to be encrypted, wherein the image to be encrypted is an image to be encrypted at this time, and may be one image or multiple groups of images, specifically, all the images to be encrypted are summarized together and classified according to the pixel size of the images, for example, 500 pixels of the images are put together, 600 pixels of the images are put together, 700 pixels of the images are put together, thus only one type of image to be encrypted is processed at a time, the same type of image to be encrypted can be simultaneously encrypted, and basic information of the image to be encrypted is extracted, and the basic information at least comprises the pixel proportion of the image.
The image acquisition module 200 is configured to determine a size of a random image based on a pixel ratio of the image, and randomly acquire a set of random images through the network camera.
In the system, the image acquisition module 200 determines the size of the random image based on the pixel proportion of the image, the pixel proportion records the number of pixels in the width direction of the image to be stored and the number of pixels in the height direction, for example, 500 pixels×600 pixels, wherein the number of pixels in the width direction is 500 and the number of pixels in the height direction is 600, and then according to the pixel size, the network cameras which can be called are identified, a group of network cameras with the acquisition size identical to or similar to the pixel size are determined, the time of one image acquisition is determined through a random algorithm, and at the moment, the network cameras acquire a group of images, namely, the random image is obtained.
The image encryption module 300 is configured to perform preprocessing on the random image to obtain a preprocessed image, and perform batch encryption processing on the image to be encrypted through the preprocessed image, and store the encrypted image.
In the present system, the image encryption module 300 performs preprocessing on the random image, and since the size of the image acquired by the network camera is fixed, it may be different from the size of the image to be encrypted, after the random image is acquired, the image to be encrypted is cut according to the size of the image to be encrypted, so that the image to be encrypted and the random image have the same size, so that the subsequent encryption processing is performed, specifically, the preprocessed image is superimposed on the image to be encrypted, so as to change the content of the image to be encrypted, and by performing batch encryption, the image to be encrypted of the present batch is processed, and then stored.
The encryption data storage module 400 is configured to convert the preprocessed image into three different sets of channel images, and store the three sets of channel images in three different sets of storage devices respectively.
In the system, the encryption data storage module 400 converts the preprocessed image into three groups of different channel images, specifically, converts the preprocessed image through an RGB mode, and extracts data through colors of three channels to obtain three groups of different channel images, namely a red channel image, a green channel image and a blue channel image, so as to ensure the safety of the preprocessed image, the three groups of obtained channel images are respectively stored in different storage devices, and the image to be encrypted cannot be acquired as long as one group of channel images in the three groups of channel images is not acquired, thereby ensuring the safety of data.
As shown in fig. 6, as a preferred embodiment of the present invention, the image acquisition module 200 includes:
an image size determining unit 201 for reading the basic information of the image to be encrypted, and determining the number of horizontal pixels and the number of vertical pixels of the random image.
In this module, the image size determining unit 201 reads the basic information of the image to be encrypted, and the image format of the image to be encrypted and the number of pixels in each direction are all the basic information, specifically, at least the number of horizontal pixels and the number of vertical pixels of the random image need to be extracted.
The image capturing device selecting unit 202 is configured to extract image capturing data of each network camera, and determine a network camera for image capturing according to the image capturing data.
In this module, the image capturing device selecting unit 202 extracts the image capturing data of each network camera, and each network camera is different in setting and hardware, so that the captured images are also different, and in order to match the captured images with the image to be encrypted as much as possible, the pixel sizes of the captured images and the image to be encrypted are compared, and a group of network cameras with the closest size is selected.
The random image acquisition unit 203 is configured to send a graphic acquisition instruction to the network camera based on the determined time of the network camera, so as to obtain a set of random images.
In this module, the random image acquisition unit 203 records the time when the network camera is selected based on the determined time of the network camera, adds a preset duration to the time as the time for acquiring the image, and sends the time to the network camera to acquire a group of random images.
As shown in fig. 7, as a preferred embodiment of the present invention, the image encryption module 300 includes:
the image clipping unit 301 is configured to clip the random image according to the set size of the random image, so as to obtain a preprocessed image.
In this module, the image clipping unit 301 clips the random image according to the set size of the random image, and although the network camera is selected, it is difficult to ensure that the size of the image acquired by the network camera is completely consistent with the size of the image to be encrypted, so that the size of the image to be encrypted is completely consistent with the size of the image to be encrypted.
The channel parameter extraction unit 302 is configured to read three channel parameter values of each pixel in the preprocessed image and the image to be encrypted.
And the superposition encryption unit 303 is configured to perform superposition processing on the two sets of three-channel parameter values obtained by extraction, complete batch encryption, and store the two sets of three-channel parameter values, where the superposition processing includes summation processing or difference processing.
In the module, three channel parameter values of each pixel in the pre-processing image and the image to be encrypted, namely a red channel value, a green channel value and a blue channel value are read, taking a pixel as an example, in the pre-processing image and the image to be encrypted, a and b are a group of pixels at corresponding positions, wherein a is from the pre-processing image, b is from the image to be encrypted, three channel parameters of a pixel are respectively a1, a2 and a3, three channel parameters of b pixel are respectively b1, b2 and b3, and a is taken as an example n And b n Summing, if the sum of the two does not exceed the upper parameter limit of the channel, then the sum is a n +b n As the parameter value of the channel corresponding to the position pixel after encryption, if a n +b n If the sum exceeds the upper parameter limit, then the sum is represented by |a n -b n And I is taken as a parameter value of a channel corresponding to the pixel in the position after encryption, the former is summed to be subjected to sum processing, and the latter is subjected to difference processing, so that three channel parameters of each pixel of the image after encryption are determined.
As shown in fig. 8, as a preferred embodiment of the present invention, the encrypted data storage module 400 includes:
the parameter extraction unit 401 is configured to extract parameter values corresponding to each pixel in the preprocessed image according to the red channel, the green channel and the blue channel.
In this module, the parameter extraction unit 401 performs information extraction according to the red channel, the green channel and the blue channel, and each pixel has three channels, so that three sets of channel parameter values will be obtained, and the parameter values are packaged as three independent sets of data.
The storage device selecting unit 402 is configured to extract a storage device list, generate a random number by a random algorithm, and designate three groups of storage devices from the storage device list based on the random number.
And the data independent storage unit 403 is configured to store parameter values corresponding to the red channel, the green channel and the blue channel in three sets of storage devices respectively.
In the module, a storage device list is extracted, all devices which can be used for storing data are recorded in the storage device list, the devices are numbered, then a random number is generated through a random algorithm, and three groups of devices are selected for storing parameter values corresponding to three channels.
In one embodiment, a computer device is presented, the computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring an image to be encrypted, and extracting basic information of the image to be encrypted, wherein the basic information at least comprises pixel proportion of the image;
determining the size of a random image based on the pixel proportion of the image, and randomly acquiring a group of random images through a network camera;
preprocessing the random image to obtain a preprocessed image, and carrying out batch encryption processing on the image to be encrypted through the preprocessed image and storing the image;
the preprocessing image is converted into three groups of different channel images, and the three groups of channel images are respectively stored in three groups of different storage devices.
In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which when executed by a processor causes the processor to perform the steps of:
acquiring an image to be encrypted, and extracting basic information of the image to be encrypted, wherein the basic information at least comprises pixel proportion of the image;
determining the size of a random image based on the pixel proportion of the image, and randomly acquiring a group of random images through a network camera;
preprocessing the random image to obtain a preprocessed image, and carrying out batch encryption processing on the image to be encrypted through the preprocessed image and storing the image;
the preprocessing image is converted into three groups of different channel images, and the three groups of channel images are respectively stored in three groups of different storage devices.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in various embodiments may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the invention and are described in detail herein without thereby limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.
Claims (6)
1. A method of encrypting data, the method comprising:
acquiring an image to be encrypted, and extracting basic information of the image to be encrypted, wherein the basic information at least comprises pixel proportion of the image;
determining the size of a random image based on the pixel proportion of the image, and randomly acquiring a group of random images through a network camera;
preprocessing the random image to obtain a preprocessed image, and carrying out batch encryption processing on the image to be encrypted through the preprocessed image and storing the image;
converting the preprocessed image into three groups of different channel images, and respectively storing the three groups of channel images in three groups of different storage devices;
the random image is preprocessed to obtain a preprocessed image, the preprocessed image is used for carrying out batch encryption processing on the image to be encrypted, and the method specifically comprises the following steps:
cutting the random image according to the set size of the random image to obtain a preprocessed image;
three channel parameter values of each pixel in the preprocessed image and the image to be encrypted are read;
superposing the extracted two groups of three-channel parameter values to finish batch encryption and storing, wherein the superposition comprises summation or difference;
the step of converting the preprocessed image into three groups of different channel images and storing the three groups of channel images in three groups of different storage devices respectively specifically includes:
extracting parameter values corresponding to each pixel in the preprocessed image according to the red channel, the green channel and the blue channel;
extracting a storage device list, generating a random number through a random algorithm, and designating three groups of storage devices from the storage device list based on the random number;
respectively storing parameter values corresponding to a red channel, a green channel and a blue channel in three groups of storage devices;
reading three channel parameter values of each pixel in the pre-processing image and the image to be encrypted, namely the value of a red channel, the value of a green channel and the value of a blue channel, taking a pixel as an example, wherein a and b are a group of pixels at corresponding positions in the pre-processing image and the image to be encrypted, wherein a is from the pre-processing image, b is from the image to be encrypted, three channel parameters of a pixel are a1, a2 and a3 respectively, three channel parameters of b pixel are b1, b2 and b3 respectively, and a is obtained by n And b n Summing, if the sum of the two does not exceed the upper parameter limit of the channel, then the sum is a n +b n As the parameter value of the channel corresponding to the position pixel after encryption,if a is n +b n If the sum exceeds the upper parameter limit, then the sum is represented by |a n -b n And I is taken as a parameter value of a channel corresponding to the pixel in the position after encryption, the former is summed to be subjected to sum processing, and the latter is subjected to difference processing, so that three channel parameters of each pixel of the image after encryption are determined.
2. The data encryption method according to claim 1, wherein the step of determining the size of the random image based on the pixel ratio of the image, and randomly collecting a set of random images by the network camera, comprises:
basic information of an image to be encrypted is read, and the number of horizontal pixels and the number of vertical pixels of the random image are determined;
extracting image acquisition data of each network camera, and determining the network cameras for image acquisition according to the image acquisition data;
and sending a graph acquisition instruction to the network camera based on the determined time of the network camera to obtain a group of random images.
3. A data encryption system, the system comprising:
the basic information extraction module is used for acquiring an image to be encrypted and extracting basic information of the image to be encrypted, wherein the basic information at least comprises pixel proportion of the image;
the image acquisition module is used for determining the size of the random image based on the pixel proportion of the image and randomly acquiring a group of random images through the network camera;
the image encryption module is used for preprocessing the random image to obtain a preprocessed image, and carrying out batch encryption processing on the image to be encrypted through the preprocessed image and storing the image;
the encryption data storage module is used for converting the preprocessed image into three groups of different channel images, and respectively storing the three groups of channel images in three groups of different storage devices;
the image encryption module includes:
the image clipping unit is used for clipping the random image according to the set size of the random image to obtain a preprocessed image;
the channel parameter extraction unit is used for reading three channel parameter values of each pixel in the preprocessed image and the image to be encrypted;
the superposition encryption unit is used for performing superposition processing on the two groups of three-channel parameter values obtained by extraction, completing batch encryption and storing, wherein the superposition processing comprises summation processing or difference processing;
the encrypted data storage module includes:
the parameter extraction unit is used for extracting parameter values corresponding to each pixel in the preprocessed image according to the red channel, the green channel and the blue channel;
a storage device selection unit for extracting a storage device list, generating a random number by a random algorithm, and designating three groups of storage devices from the storage device list based on the random number;
the data independent storage unit is used for respectively storing parameter values corresponding to the red channel, the green channel and the blue channel in three groups of storage devices;
reading three channel parameter values of each pixel in the pre-processing image and the image to be encrypted, namely the value of a red channel, the value of a green channel and the value of a blue channel, taking a pixel as an example, wherein a and b are a group of pixels at corresponding positions in the pre-processing image and the image to be encrypted, wherein a is from the pre-processing image, b is from the image to be encrypted, three channel parameters of a pixel are a1, a2 and a3 respectively, three channel parameters of b pixel are b1, b2 and b3 respectively, and a is obtained by n And b n Summing, if the sum of the two does not exceed the upper parameter limit of the channel, then the sum is a n +b n As the parameter value of the channel corresponding to the position pixel after encryption, if a n +b n If the sum exceeds the upper parameter limit, then the sum is represented by |a n -b n And I is taken as a parameter value of a channel corresponding to the pixel in the position after encryption, the former is summed to be subjected to sum processing, and the latter is subjected to difference processing, so that three channel parameters of each pixel of the image after encryption are determined.
4. A data encryption system according to claim 3, wherein the image acquisition module comprises:
the image size determining unit is used for reading basic information of the image to be encrypted and determining the number of horizontal pixels and the number of vertical pixels of the random image;
the image acquisition equipment selection unit is used for extracting image acquisition data of each network camera and determining the network camera for image acquisition according to the image acquisition data;
the random image acquisition unit is used for sending a graph acquisition instruction to the network camera based on the determined time of the network camera to obtain a group of random images.
5. A computer device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the data encryption method of any one of claims 1 to 2.
6. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of the data encryption method according to any one of claims 1 to 2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310886556.4A CN116611986B (en) | 2023-07-19 | 2023-07-19 | Data encryption method, system, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310886556.4A CN116611986B (en) | 2023-07-19 | 2023-07-19 | Data encryption method, system, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116611986A CN116611986A (en) | 2023-08-18 |
CN116611986B true CN116611986B (en) | 2024-01-02 |
Family
ID=87682206
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310886556.4A Active CN116611986B (en) | 2023-07-19 | 2023-07-19 | Data encryption method, system, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116611986B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110532793A (en) * | 2019-08-30 | 2019-12-03 | 首都师范大学 | Image encryption method, image encrypting apparatus, electronic equipment and readable storage medium storing program for executing |
CN114398647A (en) * | 2021-12-08 | 2022-04-26 | 安徽电信规划设计有限责任公司 | Data encryption storage method, encryption terminal and decryption terminal |
CN114418825A (en) * | 2022-03-10 | 2022-04-29 | 太平金融科技服务(上海)有限公司深圳分公司 | Image processing method, image processing device, computer equipment and storage medium |
CN115205089A (en) * | 2022-07-22 | 2022-10-18 | 中国电信股份有限公司 | Image encryption method, network model training method and device and electronic equipment |
CN116228508A (en) * | 2023-05-10 | 2023-06-06 | 深圳奥联信息安全技术有限公司 | Password generation and authentication system and method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040096058A1 (en) * | 2001-04-27 | 2004-05-20 | Young-Sun Cho | Apparatus and method for encrypting/decrypting information on basic element by element basis and encryption/decryption system using the same |
-
2023
- 2023-07-19 CN CN202310886556.4A patent/CN116611986B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110532793A (en) * | 2019-08-30 | 2019-12-03 | 首都师范大学 | Image encryption method, image encrypting apparatus, electronic equipment and readable storage medium storing program for executing |
CN114398647A (en) * | 2021-12-08 | 2022-04-26 | 安徽电信规划设计有限责任公司 | Data encryption storage method, encryption terminal and decryption terminal |
CN114418825A (en) * | 2022-03-10 | 2022-04-29 | 太平金融科技服务(上海)有限公司深圳分公司 | Image processing method, image processing device, computer equipment and storage medium |
CN115205089A (en) * | 2022-07-22 | 2022-10-18 | 中国电信股份有限公司 | Image encryption method, network model training method and device and electronic equipment |
CN116228508A (en) * | 2023-05-10 | 2023-06-06 | 深圳奥联信息安全技术有限公司 | Password generation and authentication system and method |
Non-Patent Citations (2)
Title |
---|
Blockchain-Based UAV-Assisted Forest Supervision and Data Sharing;Chen Lipan et al.;《Communications in Computer and Information Science》;第1679卷;第 251–264页 * |
提取明文信息耦合多混沌像素混乱的彩图RGB分量同步无损加密算法;潘强 等;《计算机应用研究》;第32卷(第5期);第1512-1515页 * |
Also Published As
Publication number | Publication date |
---|---|
CN116611986A (en) | 2023-08-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100878579B1 (en) | Watermarking Method, Watermark Validation Method, Watermarking Device and Watermark Validation Device | |
CN110620891B (en) | Imaging system and video processing method | |
US8850299B2 (en) | Processing of biometric data by transformation | |
CN110610456A (en) | Imaging system and video processing method | |
US11520931B2 (en) | Privacy masking method using format-preserving encryption in image security system and recording medium for performing same | |
CN111241938A (en) | Face recognition method and device based on image verification and computer equipment | |
US20210357533A1 (en) | Runtime Signature Integrity | |
CN115187439A (en) | Comprehensive operation management method and system for intelligent park | |
CN110572604B (en) | Imaging system and video processing method | |
EP2139221A1 (en) | Verification / authentification of images with pixels derived from capturing and later interpolation processes | |
CN113742765A (en) | Intelligent cloud data security protection system and method based on block chain | |
CN116611986B (en) | Data encryption method, system, computer equipment and storage medium | |
CN110023987B (en) | Image processing apparatus and method | |
EP2139220A2 (en) | Information processing apparatus and information processing method | |
CN117354064B (en) | Distributed multi-party privacy processing method and system based on blockchain | |
CN113194334B (en) | Privacy-protecting image processing method, privacy-protecting image processing device, terminal and storage medium | |
CN116228508B (en) | Password generation and authentication system and method | |
EP2009639A1 (en) | Video copy prevention if the difference betweeen the fingerprints before and after its modification is above a threshold | |
CN116980534A (en) | Image processing method and system for video communication | |
CN115659383B (en) | Electronic file secure sharing method and system | |
CN115225771B (en) | Method and device for hiding reversible information of encrypted image and computer equipment | |
CN114398647A (en) | Data encryption storage method, encryption terminal and decryption terminal | |
CN116208394A (en) | Image processing method, system, image capturing apparatus, server, and storage medium | |
CN114567878A (en) | Internet of things base station, data return processing system and data return processing method | |
CN113206926B (en) | Method for balancing privacy and usability of image based on three-pixel-point encryption |
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 |