Data encryption method, system, equipment and medium

Through the steps of standardizing, cutting, transforming and encrypting the image, the security problem of failing to effectively protect image data in the prior art is solved, and higher anti-cracking ability and security are achieved.

CN119865559APending Publication Date: 2025-04-22THE SECOND RES INST OF CIVIL AVIATION ADMINISTRATION OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411866200.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-11-14
Filing Date
2024-12-18
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

Existing image encryption technologies fail to fully consider the special structure and properties of the image when processing image data, resulting in information loss or distortion. As computing power increases, malicious attackers can crack encrypted images and expose user privacy and sensitive data.

Method used

By standardizing, cutting, transforming and encrypting the grayscale image to be encrypted, the specific steps include obtaining the image to be encrypted and performing standardization processing, cutting the cut image based on the standardized image, obtaining the transformed image through the image transformation process, and finally encrypting the transformed image to generate an encrypted data block.

Benefits of technology

This method effectively protects the privacy and security of image information, improves the anti-cracking ability of image data, and thus improves the overall security of image data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865559A_ABST
    Figure CN119865559A_ABST
Patent Text Reader

Abstract

The invention discloses a data encryption method, system and device and a medium, and relates to the technical field of data encryption, and the method comprises the steps: obtaining a to-be-encrypted grayscale image, and carrying out the image standardization of the to-be-encrypted grayscale image, and obtaining a standardized image; cutting the standardized image according to the standardized image to obtain at least one cut image; performing image transformation on the cut image according to the cut image to obtain at least one transformed image; and encrypting the transformed image according to the at least one transformed image to obtain at least one encrypted data block. The method and the device have the effect of improving the security of picture encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data encryption, and in particular to a data encryption method, system, device and medium. Background Art

[0002] Data encryption is a key technology in the field of information security, which aims to protect the confidentiality of information by converting plaintext information into unreadable ciphertext through algorithms. In computer networks and digital communications, data encryption plays an important role in ensuring the security of information transmission. With the rapid development of the Internet, various digital media, especially image data, are increasingly used, such as social media, online transactions, cloud storage, etc. At the same time, unencrypted image data faces the risk of being stolen, tampered with, and maliciously attacked, which has prompted the research and development of image data encryption technology.

[0003] Traditional image encryption technology usually includes steps such as scrambling the image and applying encryption algorithms to achieve data protection. Common encryption algorithms include symmetric encryption and asymmetric encryption, but these algorithms often face some limitations. For example, many traditional encryption methods do not take into account the special structure and properties of image data, resulting in possible information loss or distortion during the encryption process. In addition, with the increase in computing power, malicious attackers can use advanced technologies to crack encrypted images, thereby exposing user privacy and sensitive data.

[0004] In recent years, although a variety of emerging image encryption measures have been proposed, such as deep learning models for image encryption, these methods still have some shortcomings in practical applications. The security of many algorithms has not been rigorously evaluated and verified, so it is difficult to gain widespread trust in actual scenarios. Therefore, although image data encryption technology is constantly developing, existing encryption schemes still face the problem of low security, and encrypted data can be easily cracked by third parties. Therefore, improving the security of image data encryption is still an important research direction, and it is urgent to involve multiple parties and explore more effective solutions. Summary of the invention

[0005] In order to improve the security of image data, the present application provides a data encryption method, system, device and medium.

[0006] In the first aspect, the present application provides a data encryption method, which adopts the following technical solution:

[0007] A data encryption method, comprising:

[0008] Acquire a grayscale image to be encrypted, and perform image standardization on the grayscale image to be encrypted to obtain a standardized image;

[0009] Cutting the standardized image according to the standardized image to obtain at least one cut image;

[0010] Performing image transformation on the cut image according to the cut image to obtain at least one transformed image;

[0011] The at least one transformed image is encrypted according to the at least one transformed image to obtain at least one encrypted data block.

[0012] By adopting the above technical scheme, a grayscale image to be encrypted is first obtained, and the grayscale image to be encrypted is standardized to obtain a standardized image, and then the standardized image is cut according to the standardized image to obtain at least one cut image, and then the cut image is transformed according to the cut image to obtain at least one transformed image, and finally at least one transformed image is encrypted according to at least one transformed image to obtain at least one encrypted data block; in the above method, through the steps of standardization, cutting, transformation and encryption, the image data can be effectively encrypted to protect the privacy and security of the image information, improve the anti-cracking ability of the image data, and thus improve the security of the image data.

[0013] Optionally, the step of performing image standardization on the grayscale image to be encrypted to obtain a standardized image includes:

[0014] Obtaining the image size of the grayscale image to be encrypted, and determining the image adjustment method and image adjustment parameters according to the image size and a preset image standard size;

[0015] The grayscale image to be encrypted is processed according to the image adjustment method and the image adjustment parameters to obtain a corresponding standardized image.

[0016] By adopting the above technical solution, in order to obtain a standardized image, the image size of the grayscale image to be encrypted is first obtained, and the image adjustment method and image adjustment parameters are determined according to the image size and a pre-set image standard size, and then the grayscale image to be encrypted is processed according to the image adjustment method and the image adjustment parameters to obtain a corresponding standardized image.

[0017] Optionally, the step of cutting the standardized image according to the standardized image to obtain at least one cut image includes:

[0018] Performing initial cutting on the standardized image according to the standardized image and a preset cutting threshold to obtain at least one initial cutting image;

[0019] For each of the initial cutting images, performing feature recognition on the initial cutting image according to the initial cutting image to obtain feature data of the initial cutting image;

[0020] Determine the feature density corresponding to the initial cutting image according to the feature data, and determine whether the initial cutting image needs to be cut again according to the feature density, and if so, match the feature density in a preset table to obtain corresponding target cutting parameters; the preset table includes feature density data and cutting parameter data, and the preset table is used to represent the mapping relationship between the feature density data and the cutting parameter data;

[0021] The initial cutting image is cut twice according to the target cutting parameters to obtain at least one cutting image.

[0022] By adopting the above technical solution, in order to obtain at least one cutting image, the standardized image is first cut according to the standardized image and the preset cutting threshold to obtain at least one initial cutting image, and then for each initial cutting image, the initial cutting image is feature-recognized according to the initial cutting image to obtain feature data of the initial cutting image, and then the feature density corresponding to the initial cutting image is determined according to the feature data, and it is determined whether the initial cutting image needs to be cut twice according to the feature density. If the initial cutting image needs to be cut twice, the feature density is matched in the preset table to obtain the corresponding target cutting parameters. The preset table includes feature density data and cutting parameter data, and the preset table is used to represent the mapping relationship between feature density data and cutting parameter data. Finally, the initial cutting image is cut twice according to the target cutting parameters to obtain at least one cutting image.

[0023] Optionally, the preset threshold value includes a maximum cutting height and a maximum cutting width, and the step of performing initial cutting on the standardized image according to the standardized image and the preset cutting threshold value to obtain at least one initial cutting image includes:

[0024] Acquire an image width and an image height corresponding to the standardized image, and determine a minimum number of transverse cutting times according to the image width and the maximum cutting width, and determine a minimum number of longitudinal cutting times according to the image height and the maximum cutting height;

[0025] Determine a target transverse cutting size according to the image width and the minimum number of transverse cutting times, and determine a target longitudinal cutting size according to the image height and the minimum number of longitudinal cutting times;

[0026] The standardized image is cut according to the target transverse cutting size and the target longitudinal cutting size to obtain at least one initial cutting image.

[0027] By adopting the above technical solution, in order to obtain at least one initial cutting image, the image width and image height corresponding to the standardized image are obtained, and the minimum number of horizontal cutting times is determined according to the image width and the maximum cutting width, and the minimum number of vertical cutting times is determined according to the image height and the maximum cutting height, and then the target horizontal cutting size is determined according to the image width and the minimum number of horizontal cutting times, and the target vertical cutting size is determined according to the image height and the minimum number of vertical cutting times, and finally the standardized image is cut according to the target horizontal cutting size and the target vertical cutting size to obtain at least one initial cutting image.

[0028] Optionally, the step of performing image transformation on the cut image according to the cut image to obtain at least one transformed image includes:

[0029] For each cutting image, a cutting image matrix corresponding to the cutting image is obtained according to the cutting image, and first coordinate data corresponding to the cutting image matrix and first matrix values ​​corresponding to the first coordinate data are obtained according to the cutting image matrix, and a first mapping relationship between the first coordinate data and the first matrix value is obtained according to the cutting image matrix;

[0030] The first matrix value is input into a preset matrix value formula to obtain a corresponding second matrix value, and a second mapping relationship between the first coordinate data and the second matrix value is constructed according to the first coordinate data, the second matrix value and the first mapping relationship; the output value of the matrix value formula is [0,65535]; the matrix value formula is:

[0031] Y=clamp(A*(X 2 +B*X+C)*e -D*X +E*cos(F*X)+G,0,65535)

[0032] Among them, A represents the scaling factor, B represents the linear adjustment factor, C represents the constant factor, D represents the attenuation factor, E represents the fluctuation amplitude factor, F represents the frequency factor, and G represents the additional offset;

[0033] Acquire the matrix dimension of the cut image matrix, and generate a transformation image matrix according to the matrix dimension, the first coordinate data, the second matrix value and the second mapping relationship;

[0034] A transformed image is generated according to the transformed image matrix.

[0035] By adopting the above technical solution, in order to obtain at least one transformed image, for each cutting image, a cutting image matrix corresponding to the cutting image is obtained according to the cutting image, and first coordinate data corresponding to the cutting image matrix and a first matrix value corresponding to the first coordinate data are obtained according to the cutting image matrix, and a first mapping relationship between the first coordinate data and the first matrix value is obtained according to the cutting image matrix, and then the first matrix value is input into a preset matrix value formula to obtain the corresponding second matrix value, and a second mapping relationship between the first coordinate data and the second matrix value is constructed according to the first coordinate data, the second matrix value and the first mapping relationship, and then the matrix dimension of the cutting image matrix is ​​obtained, and a transformation image matrix is ​​generated according to the matrix dimension, the first coordinate data, the second matrix value and the second mapping relationship, and finally a transformation image is generated according to the transformation image matrix.

[0036] Optionally, the step of generating a transformation image matrix according to the matrix dimension, the first coordinate data, the second matrix value and the second mapping relationship includes:

[0037] Initialize the matrix according to the matrix dimension to obtain a corresponding intermediate matrix;

[0038] Acquire second coordinate data of the intermediate matrix, and construct a third mapping relationship between the second coordinate data and the second matrix value according to the first coordinate data, the second coordinate data and the second mapping relationship;

[0039] Matrix elements of the intermediate matrix are assigned values ​​according to the third mapping relationship and the second matrix value to obtain a corresponding transformed image matrix.

[0040] By adopting the above technical solution, in order to generate a transformation image matrix, the matrix is ​​first initialized according to the matrix dimension to obtain the corresponding intermediate matrix, and then the second coordinate data of the intermediate matrix is ​​obtained, and a third mapping relationship between the second coordinate data and the second matrix value is constructed according to the first coordinate data, the second coordinate data and the second mapping relationship, and finally, the matrix elements of the intermediate matrix are assigned according to the third mapping relationship and the second matrix value to obtain the corresponding transformation image matrix.

[0041] Optionally, the step of encrypting the transformed image according to the at least one transformed image to obtain at least one encrypted data block includes:

[0042] For each of the transformed images, randomly selecting a chaotic mapping type from a preset chaotic mapping set, and using the chaotic mapping type as a target chaotic mapping type corresponding to the transformed image;

[0043] Acquiring pixel values ​​of the transformed image, and determining initial conditions and mapping parameters of the target chaotic mapping according to the pixel values;

[0044] Performing iterative operations according to the initial conditions and mapping parameters to obtain a chaotic sequence corresponding to the transformed image;

[0045] An encryption key is extracted from the chaotic sequence according to the chaotic sequence, and the transformed image is encrypted according to the encryption key to obtain an encrypted data block corresponding to the transformed image.

[0046] By adopting the above technical scheme, in order to obtain at least one encrypted data block, for each transformed image, a chaotic mapping type is randomly selected from a preset chaotic mapping set, and a chaotic mapping type is used as a target chaotic mapping type corresponding to the transformed image, then the pixel value of the transformed image is obtained, and the initial conditions and mapping parameters of the target chaotic mapping are determined according to the pixel value, and then iterative operations are performed according to the initial conditions and mapping parameters to obtain a chaotic sequence corresponding to the transformed image, and finally an encryption key is extracted from the chaotic sequence according to the chaotic sequence, and the transformed image is encrypted according to the encryption key to obtain an encrypted data block corresponding to the transformed image.

[0047] In a second aspect, the present application also provides a data encryption system, which adopts the following technical solution:

[0048] A data encryption system, comprising:

[0049] An image standardization module is used to obtain a grayscale image to be encrypted, and perform image standardization on the grayscale image to be encrypted to obtain a standardized image;

[0050] An image cutting module, used for cutting the standardized image according to the standardized image to obtain at least one cut image;

[0051] An image transformation module, used for performing image transformation on the cut image according to the cut image to obtain at least one transformed image;

[0052] The image encryption module is used to encrypt the at least one transformed image according to the at least one transformed image to obtain at least one encrypted data block.

[0053] In a third aspect, the present application also provides a computer device, which adopts the following technical solution:

[0054] A computer device comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method described in the first aspect when executing the computer program.

[0055] In a fourth aspect, the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0056] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute the method described in the first aspect.

[0057] In summary, the present application includes at least the following beneficial technical effects: first, a grayscale image to be encrypted is obtained, and the grayscale image to be encrypted is normalized to obtain a standardized image, and then the standardized image is cut according to the standardized image to obtain at least one cut image, and then the cut image is transformed according to the cut image to obtain at least one transformed image, and finally at least one transformed image is encrypted according to at least one transformed image to obtain at least one encrypted data block; in the above method, through the steps of standardization, cutting, transformation and encryption, the image data can be effectively encrypted to protect the privacy and security of the image information, improve the anti-cracking ability of the image data, and thus improve the security of the image data. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a schematic diagram of the overall process of an embodiment of the present application.

[0059] Figure 2 It is a schematic diagram of the structure of the system of this application.

[0060] Figure 3 It is a structural block diagram of the computer device of the present application. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-3 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0062] The embodiment of the present application discloses a data encryption method.

[0063] Reference Figure 1 , a data encryption method, comprising:

[0064] Step S11, obtaining a grayscale image to be encrypted, and performing image standardization on the grayscale image to be encrypted to obtain a standardized image.

[0065] It should be noted that a grayscale image is an image that only contains brightness information but not color information. In this type of image, the brightness level of a pixel is represented by a grayscale value. For a grayscale image represented by an 8-bit unsigned integer, its grayscale value is usually a continuous change from black (lowest brightness, grayscale value 0) to white (highest brightness, grayscale value 255); while for a grayscale image represented by a 16-bit unsigned integer, its grayscale value is usually a continuous change from black (lowest brightness, grayscale value 0) to white (highest brightness, grayscale value 65535). Each pixel in a grayscale image only has brightness information, and does not contain hue and saturation, which are common attributes in color images.

[0066] Step S12, cutting the standardized image according to the standardized image to obtain at least one cut image.

[0067] Step S13, performing image transformation on the cut image according to the cut image to obtain at least one transformed image.

[0068] It should be noted that image transformation generally includes geometric transformation, color transformation, filtering operation, transformation matrix operation, etc.; in step S13, the object of image transformation is a cut image, and by performing image transformation on each cut image, a corresponding cut image can be obtained, that is, the number of at least one cut image is equal to the number of at least one transformed image, and the cut image in at least one cut image and the transformed image in at least one transformed image are in a one-to-one correspondence.

[0069] Step S14: encrypt at least one transformed image according to at least one transformed image to obtain at least one encrypted data block.

[0070] It should be noted that, in step S14, the number of the at least one transformed image is equal to the number of the at least one encrypted data block, and the transformed images in the at least one transformed image and the encrypted data blocks in the at least one encrypted data block are in a one-to-one correspondence.

[0071] In the above embodiment, a grayscale image to be encrypted is first obtained, and the grayscale image to be encrypted is standardized to obtain a standardized image, and then the standardized image is cut according to the standardized image to obtain at least one cut image, and then the cut image is transformed according to the cut image to obtain at least one transformed image, and finally at least one transformed image is encrypted according to at least one transformed image to obtain at least one encrypted data block; in the above method, through the steps of standardization, cutting, transformation and encryption, the image data can be effectively encrypted to protect the privacy and security of the image information, improve the anti-cracking ability of the image data, and thus improve the security of the image data.

[0072] As a further implementation of the data encryption method, the step of performing image standardization on the grayscale image to be encrypted to obtain a standardized image includes:

[0073] Step S21, obtaining the image size of the grayscale image to be encrypted, and determining the image adjustment method and image adjustment parameters according to the image size and a preset standard image size.

[0074] It should be noted that image adjustment methods include scaling, cropping, filling, stretching, rotating and other operations.

[0075] Step S22: Process the grayscale image to be encrypted according to the image adjustment method and the image adjustment parameters to obtain a corresponding standardized image.

[0076] In the above embodiment, in order to obtain a standardized image, the image size of the grayscale image to be encrypted is first obtained, and the image adjustment method and image adjustment parameters are determined according to the image size and a pre-set standard image size. Then, the grayscale image to be encrypted is processed according to the image adjustment method and the image adjustment parameters to obtain a corresponding standardized image.

[0077] As a further implementation of the data encryption method, the step of cutting the standardized image according to the standardized image to obtain at least one cut image includes:

[0078] Step S31 , performing initial cutting on the standardized image according to the standardized image and a preset cutting threshold, to obtain at least one initial cutting image.

[0079] Step S32: for each initial cut image, feature recognition is performed on the initial cut image according to the initial cut image to obtain feature data of the initial cut image.

[0080] Step S33, determining the feature density corresponding to the initial cutting image according to the feature data, and determining whether the initial cutting image needs to be cut again according to the feature density, and if so, matching the feature density in the preset table to obtain the corresponding target cutting parameters.

[0081] The preset table includes feature density data and cutting parameter data, and the preset table is used to represent the mapping relationship between the feature density data and the cutting parameter data.

[0082] Specifically, the feature density corresponding to the initial cutting image is determined according to the feature data, and whether the initial cutting image needs to be cut a second time is determined according to the feature density. If the initial cutting image needs to be cut a second time, the feature density is matched in the preset table to obtain the corresponding target cutting parameters. If the initial cutting image does not need to be cut a second time, the corresponding secondary cutting process is not performed.

[0083] Step S34, performing secondary cutting on the initial cutting image according to the target cutting parameters to obtain at least one cutting image.

[0084] It should be noted that, in step S31 to step S34, the combination of primary cutting and secondary cutting can reduce unnecessary computing resource consumption to a certain extent. Through the systematic cutting process, the needs of specific applications, such as target recognition, feature analysis, etc., can be better met.

[0085] In the above embodiment, in order to obtain at least one cutting image, the standardized image is first cut for the first time according to the standardized image and the preset cutting threshold to obtain at least one initial cutting image, and then for each initial cutting image, the initial cutting image is feature recognized according to the initial cutting image to obtain feature data of the initial cutting image, and then the feature density corresponding to the initial cutting image is determined according to the feature data, and it is determined whether the initial cutting image needs to be cut twice according to the feature density. If the initial cutting image needs to be cut twice, the feature density is matched in a preset table to obtain the corresponding target cutting parameters. The preset table includes feature density data and cutting parameter data. The preset table is used to represent the mapping relationship between feature density data and cutting parameter data. Finally, the initial cutting image is cut twice according to the target cutting parameters to obtain at least one cutting image.

[0086] As a further implementation of the data encryption method, the preset threshold includes a maximum cutting height and a maximum cutting width, and the standardized image is initially cut according to the standardized image and the preset cutting threshold to obtain at least one initial cutting image, including:

[0087] Step S41, obtaining the image width and image height corresponding to the standardized image, and determining the minimum number of transverse cutting times according to the image width and the maximum cutting width, and determining the minimum number of longitudinal cutting times according to the image height and the maximum cutting height.

[0088] It should be noted that, in step S41, assuming that the image width is W, the image height is H, and the maximum cutting width is W max , the maximum cutting height is H max , minimum number of transverse cuts N x The calculation formula is:

[0089]

[0090] Minimum number of longitudinal cuts N y The calculation formula is:

[0091]

[0092] Step S42, determining a target horizontal cutting size according to the image width and the minimum number of horizontal cutting times, and determining a target vertical cutting size according to the image height and the minimum number of vertical cutting times.

[0093] It should be noted that, in this embodiment, the target transverse cutting size W t The calculation formula is:

[0094]

[0095] Target longitudinal cutting size H t The calculation formula is:

[0096]

[0097] Step S43, cutting the standardized image according to the target transverse cutting size and the target longitudinal cutting size to obtain at least one initial cutting image.

[0098] It should be noted that in step S43, the cutting logic is: cutting the normalized image into N x Each copy has a width of W t , cut the normalized image into N y Each piece has a width of H t .

[0099] In the above embodiment, in order to obtain at least one initial cutting image, the image width and image height corresponding to the standardized image are obtained, and the minimum number of horizontal cutting times is determined according to the image width and the maximum cutting width, and the minimum number of vertical cutting times is determined according to the image height and the maximum cutting height. Then, the target horizontal cutting size is determined according to the image width and the minimum number of horizontal cutting times, and the target vertical cutting size is determined according to the image height and the minimum number of vertical cutting times. Finally, the standardized image is cut according to the target horizontal cutting size and the target vertical cutting size to obtain at least one initial cutting image.

[0100] As a further implementation of the data encryption method, the step of performing image transformation on the cut image according to the cut image to obtain at least one transformed image includes:

[0101] Step S51, for each cutting image, obtain a cutting image matrix corresponding to the cutting image according to the cutting image, obtain first coordinate data corresponding to the cutting image matrix and first matrix values ​​corresponding to the first coordinate data according to the cutting image matrix, and obtain a first mapping relationship between the first coordinate data and the first matrix value according to the cutting image matrix.

[0102] Step S52, inputting the first matrix value into a preset matrix value formula to obtain a corresponding second matrix value, and constructing a second mapping relationship between the first coordinate data and the second matrix value according to the first coordinate data, the second matrix value and the first mapping relationship.

[0103] Among them, the output value of the matrix value formula is [0,65535]; the matrix value formula is:

[0104] Y=clamp(A*(X 2 +B*X+C)*e -D*X +E*cos(F*X)+G,0,65535)

[0105] Among them, A represents the scaling factor, B represents the linear adjustment factor, C represents the constant factor, D represents the attenuation factor, E represents the fluctuation amplitude factor, F represents the frequency factor, and G represents the additional offset;

[0106] It should be noted that the scaling factor A is used to control the amplification factor of the output; the linear adjustment factor B is used to control the contribution of the input value to the output value. Setting a reasonable value (such as B=10) can increase and improve the output; the constant factor C is a constant term used to adjust the overall brightness. It is set to C=0 or other constants that seem to have less impact on the result; the attenuation factor D is used to control the attenuation rate of the input matrix value, such as D=0.001; the fluctuation amplitude factor E is used to control the amplitude of the cosine fluctuation. It is set to an appropriate value to ensure smooth changes, such as E=20; the frequency factor F is used to control the period of the cosine part and can be set as needed; the additional offset G is used to provide an additional basic offset to control the offset of the final output. The setting may be G=0 or adjusted according to the result.

[0107] Step S53, obtaining the matrix dimension of the cut image matrix, and generating a transformed image matrix according to the matrix dimension, the first coordinate data, the second matrix value and the second mapping relationship.

[0108] Step S54: generating a transformed image according to the transformed image matrix.

[0109] In the above embodiment, in order to obtain at least one transformed image, for each cutting image, a cutting image matrix corresponding to the cutting image is obtained according to the cutting image, and first coordinate data corresponding to the cutting image matrix and a first matrix value corresponding to the first coordinate data are obtained according to the cutting image matrix, and a first mapping relationship between the first coordinate data and the first matrix value is obtained according to the cutting image matrix, and then the first matrix value is input into a preset matrix value formula to obtain the corresponding second matrix value, and a second mapping relationship between the first coordinate data and the second matrix value is constructed according to the first coordinate data, the second matrix value and the first mapping relationship, and then the matrix dimension of the cutting image matrix is ​​obtained, and a transformation image matrix is ​​generated according to the matrix dimension, the first coordinate data, the second matrix value and the second mapping relationship, and finally a transformation image is generated according to the transformation image matrix.

[0110] As a further implementation of the data encryption method, the step of generating a transformation image matrix according to the matrix dimension, the first coordinate data, the second matrix value and the second mapping relationship includes:

[0111] Step S61, initializing the matrix according to the matrix dimension to obtain the corresponding intermediate matrix.

[0112] Step S62, obtaining the second coordinate data of the intermediate matrix, and constructing a third mapping relationship between the second coordinate data and the second matrix value according to the first coordinate data, the second coordinate data and the second mapping relationship.

[0113] Step S63, assigning matrix elements to the intermediate matrix according to the third mapping relationship and the second matrix value to obtain a corresponding transformed image matrix.

[0114] In the above-mentioned embodiment, in order to generate a transformation image matrix, the matrix is ​​first initialized according to the matrix dimension to obtain the corresponding intermediate matrix, and then the second coordinate data of the intermediate matrix is ​​obtained, and the third mapping relationship between the second coordinate data and the second matrix value is constructed according to the first coordinate data, the second coordinate data and the second mapping relationship. Finally, the matrix elements of the intermediate matrix are assigned according to the third mapping relationship and the second matrix value to obtain the corresponding transformation image matrix.

[0115] As a further implementation of the data encryption method, the step of encrypting the transformed image according to at least one transformed image to obtain at least one encrypted data block includes:

[0116] Step S71: for each transformed image, randomly select a chaotic mapping type from a preset chaotic mapping set, and use the chaotic mapping type as a target chaotic mapping type corresponding to the transformed image.

[0117] Step S72, obtaining pixel values ​​of the transformed image, and determining initial conditions and mapping parameters of the target chaotic mapping according to the pixel values.

[0118] Step S73, performing iterative operations according to the initial conditions and mapping parameters to obtain a chaotic sequence corresponding to the transformed image.

[0119] Step S74, extracting an encryption key from the chaotic sequence according to the chaotic sequence, and encrypting the transformed image according to the encryption key to obtain an encrypted data block corresponding to the transformed image.

[0120] In the above-mentioned embodiment, in order to obtain at least one encrypted data block, for each transformed image, a chaotic mapping type is randomly selected from a preset chaotic mapping set, and a chaotic mapping type is used as a target chaotic mapping type corresponding to the transformed image, and then the pixel value of the transformed image is obtained, and the initial conditions and mapping parameters of the target chaotic mapping are determined according to the pixel value, and then iterative operations are performed according to the initial conditions and mapping parameters to obtain a chaotic sequence corresponding to the transformed image, and finally an encryption key is extracted from the chaotic sequence according to the chaotic sequence, and the transformed image is encrypted according to the encryption key to obtain an encrypted data block corresponding to the transformed image.

[0121] The embodiment of the present application also discloses a data encryption system.

[0122] refer to Figure 3 , a data encryption system, comprising:

[0123] An image standardization module is used to obtain a grayscale image to be encrypted and perform image standardization on the grayscale image to be encrypted to obtain a standardized image;

[0124] An image cutting module, used for cutting the standardized image according to the standardized image to obtain at least one cut image;

[0125] An image transformation module, used for performing image transformation on the cut image according to the cut image to obtain at least one transformed image;

[0126] The image encryption module is used to encrypt at least one transformed image according to at least one transformed image to obtain at least one encrypted data block.

[0127] A data encryption system of the present invention can implement any one of the data encryption methods, and the specific working process of a data encryption system of the present invention can refer to the corresponding process in the above-mentioned data encryption method.

[0128] The embodiment of the present application also discloses a computer device.

[0129] refer to Figure 3A computer device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, any one of the above-mentioned data encryption methods is implemented.

[0130] The embodiment of the present application also discloses a computer-readable storage medium.

[0131] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any one of the above-mentioned data encryption methods.

[0132] Among them, computer-readable storage media can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus or device; the program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0133] The above are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.

Claims

1. A data encryption method, characterized in that: include: Acquire a grayscale image to be encrypted, and perform image standardization on the grayscale image to be encrypted to obtain a standardized image; Cutting the standardized image according to the standardized image to obtain at least one cut image; Performing image transformation on the cut image according to the cut image to obtain at least one transformed image; The at least one transformed image is encrypted according to the at least one transformed image to obtain at least one encrypted data block.

2. A data encryption method according to claim 1, characterized in that: The step of performing image standardization on the grayscale image to be encrypted to obtain a standardized image comprises: Obtaining the image size of the grayscale image to be encrypted, and determining the image adjustment method and image adjustment parameters according to the image size and a preset image standard size; The grayscale image to be encrypted is processed according to the image adjustment method and the image adjustment parameters to obtain a corresponding standardized image.

3. A data encryption method according to claim 1, characterized in that: The step of cutting the standardized image according to the standardized image to obtain at least one cut image comprises: Performing initial cutting on the standardized image according to the standardized image and a preset cutting threshold to obtain at least one initial cutting image; For each of the initial cutting images, performing feature recognition on the initial cutting image according to the initial cutting image to obtain feature data of the initial cutting image; Determine the feature density corresponding to the initial cutting image according to the feature data, and determine whether the initial cutting image needs to be cut again according to the feature density, and if so, match the feature density in a preset table to obtain corresponding target cutting parameters; the preset table includes feature density data and cutting parameter data, and the preset table is used to represent the mapping relationship between the feature density data and the cutting parameter data; The initial cutting image is cut twice according to the target cutting parameters to obtain at least one cutting image.

4. A data encryption method according to claim 3, characterized in that: The preset threshold value includes a maximum cutting height and a maximum cutting width. The step of performing a primary cutting on the standardized image according to the standardized image and the preset cutting threshold value to obtain at least one initial cutting image includes: Acquire an image width and an image height corresponding to the standardized image, and determine a minimum number of transverse cutting times according to the image width and the maximum cutting width, and determine a minimum number of longitudinal cutting times according to the image height and the maximum cutting height; Determine a target transverse cutting size according to the image width and the minimum number of transverse cutting times, and determine a target longitudinal cutting size according to the image height and the minimum number of longitudinal cutting times; The standardized image is cut according to the target transverse cutting size and the target longitudinal cutting size to obtain at least one initial cutting image.

5. A data encryption method according to claim 1, characterized in that: The step of performing image transformation on the cut image according to the cut image to obtain at least one transformed image comprises: For each cutting image, a cutting image matrix corresponding to the cutting image is obtained according to the cutting image, and first coordinate data corresponding to the cutting image matrix and first matrix values ​​corresponding to the first coordinate data are obtained according to the cutting image matrix, and a first mapping relationship between the first coordinate data and the first matrix value is obtained according to the cutting image matrix; The first matrix value is input into a preset matrix value formula to obtain a corresponding second matrix value, and a second mapping relationship between the first coordinate data and the second matrix value is constructed according to the first coordinate data, the second matrix value and the first mapping relationship; the output value of the matrix value formula is [0,65535]; the matrix value formula is: Y=clamp(A*(X 2 +B*X+C)*e -D*X +E*cos(F*X)+G,0,65535) Among them, A represents the scaling factor, B represents the linear adjustment factor, C represents the constant factor, D represents the attenuation factor, E represents the fluctuation amplitude factor, F represents the frequency factor, and G represents the additional offset; Acquire the matrix dimension of the cut image matrix, and generate a transformation image matrix according to the matrix dimension, the first coordinate data, the second matrix value and the second mapping relationship; A transformed image is generated according to the transformed image matrix.

6. A data encryption method according to claim 5, characterized in that: The step of generating a transformation image matrix according to the matrix dimension, the first coordinate data, the second matrix value and the second mapping relationship comprises: Initialize the matrix according to the matrix dimension to obtain a corresponding intermediate matrix; Acquire second coordinate data of the intermediate matrix, and construct a third mapping relationship between the second coordinate data and the second matrix value according to the first coordinate data, the second coordinate data and the second mapping relationship; Matrix elements of the intermediate matrix are assigned values ​​according to the third mapping relationship and the second matrix value to obtain a corresponding transformed image matrix.

7. A data encryption method according to claim 1, characterized in that: The step of encrypting the transformed image according to the at least one transformed image to obtain at least one encrypted data block comprises: For each of the transformed images, randomly selecting a chaotic mapping type from a preset chaotic mapping set, and using the chaotic mapping type as a target chaotic mapping type corresponding to the transformed image; Acquiring pixel values ​​of the transformed image, and determining initial conditions and mapping parameters of the target chaotic mapping according to the pixel values; Performing iterative operations according to the initial conditions and mapping parameters to obtain a chaotic sequence corresponding to the transformed image; An encryption key is extracted from the chaotic sequence according to the chaotic sequence, and the transformed image is encrypted according to the encryption key to obtain an encrypted data block corresponding to the transformed image.

8. A data encryption system, characterized in that: include: An image standardization module is used to obtain a grayscale image to be encrypted, and perform image standardization on the grayscale image to be encrypted to obtain a standardized image; An image cutting module, used for cutting the standardized image according to the standardized image to obtain at least one cut image; An image transformation module, used for performing image transformation on the cut image according to the cut image to obtain at least one transformed image; The image encryption module is used to encrypt the at least one transformed image according to the at least one transformed image to obtain at least one encrypted data block.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.