Data encryption method and apparatus, data decryption method and apparatus, and storage medium
By converting the coordinates of vector data into polar coordinates and randomly rotating the polar angle coordinates, the watermark information is embedded in the effective bits of the polar diameter coordinates, solving the problem of low data encryption and decryption efficiency in the prior art, and achieving efficient, secure encryption and decryption of data.
Patent Information
- Application Number
- PCT/CN2024/103130
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-10
- Filing Date
- 2024-07-02
- Publication Date
- 2025-05-15
AI Technical Summary
The prior art is difficult to achieve efficient encryption and decryption of data on the basis of taking into account data security, especially in cloud computing environments, where the data encryption and decryption process is inefficient.
By converting the coordinates of vector data into polar coordinates and randomly rotating the polar angle coordinates, the watermark information is embedded in the effective bits of the polar diameter coordinates, efficient encryption and decryption of the data.
This method realizes convenient and efficient encryption of data and embedding of watermark information, ensuring data security and reliability, and is suitable for data transactions in cloud computing environments.
Smart Images

Figure CN2024103130_15052025_PF_FP_ABST
Abstract
Description
Data encryption method, data decryption method, device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on November 10, 2023, with application number 202311498435.9 and application name “A data encryption method, data decryption method, device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of data processing technology and provides a data encryption method, a data decryption method, a device and a storage medium. Background Art
[0004] With the increasing prevalence of cloud computing technology, data providers are deploying data trading services on third-party cloud servers, which provide the computing power to embed digital watermarks to protect data copyright. However, to ensure data security and prevent the theft of plaintext data by malicious cloud service providers, these transaction data must be encrypted. Furthermore, during the data transaction process, the legitimate rights and interests of both parties must be protected to prevent false accusations by the seller and denials by the buyer. Therefore, the data must be encrypted jointly by both the buyer and the seller, requiring at least two encryption steps.
[0005] In related technologies, it is impossible to achieve efficient encryption and decryption of data while taking data security into consideration.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a data encryption method, a data decryption method, an apparatus, and a storage medium for conveniently and efficiently encrypting and decrypting data.
[0008] The specific technical solutions provided in this application are as follows:
[0009] In a first aspect, an embodiment of the present application provides a data encryption method, comprising:
[0010] Convert the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to the at least one vertex;
[0011] For any polar coordinate, the following operations are performed: rotating the polar coordinate in sequence by at least two encryption angles along a first direction to obtain an encrypted polar coordinate, and adding preset watermark information to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key;
[0012] The encrypted vector data is obtained based on the encrypted polar coordinates and the polar coordinates containing the watermark.
[0013] Optionally, converting the coordinates of each vector data in the vector data set into polar coordinates includes:
[0014] Determining a convex polygon based on the coordinates of each vertex included in each vector data in the vector data set, wherein the coordinates of each vertex are located inside the convex polygon or on the edge of the convex polygon;
[0015] Select the two vertices on the edge of the convex polygon that are the farthest apart, determine the minimum enclosing circle based on any point on the perpendicular bisector and the two vertices, and establish a polar coordinate system with the center of the minimum enclosing circle as the pole and the horizontal ray from the center as the polar axis;
[0016] The coordinates of each vector data in the vector data set are converted into polar coordinates in the polar coordinate system according to the conversion formula.
[0017] Optionally, if the at least two encrypted angles include a first encrypted angle and a second encrypted angle, rotating the polar coordinates by the at least two encrypted angles in sequence according to the first direction to obtain encrypted polar coordinates includes:
[0018] If the coordinates of the vertex corresponding to the polar coordinate are not on the edge of the convex polygon, rotating the polar coordinate in the first direction by an angle value corresponding to the first encryption angle to obtain the preselected encrypted polar coordinate, and rotating the preselected encrypted polar coordinate in the first direction by an angle value corresponding to the second encryption angle to obtain the encrypted polar coordinate;
[0019] If the coordinates of the vertex corresponding to the polar coordinate are on the edge of the convex polygon, the polar coordinate is rotated by zero degrees along the first direction to obtain the encrypted polar coordinate.
[0020] Optionally, the preset watermark information is added to the valid bits of the polar coordinates to obtain the polar coordinates containing the watermark, including:
[0021] Normalizing the polar coordinates to obtain normalized polar coordinates, wherein the length represented by the polar coordinates is less than half the length of the line segment;
[0022] Binarizing the normalized polar coordinates to obtain multiple significant digits of the polar coordinates;
[0023] Adding the preset watermark information to any valid bit of multiple valid bits to obtain the embedded polar coordinates;
[0024] The embedded polar coordinates are inversely normalized to obtain the polar coordinates containing the watermark.
[0025] Optionally, generate a random rotation sequence by:
[0026] Generate a chaotic sequence from each key in a preset key set according to a preset chaotic mapping algorithm;
[0027] Each numerical value in the chaotic sequence is converted into an angle value ranging from 0 to 360 degrees, and a random rotation sequence is generated based on the converted angle values.
[0028] In a second aspect, an embodiment of the present application provides a data decryption method, comprising:
[0029] For any received encrypted vector data, the following operations are performed: rotating the polar coordinates of the vector data by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and extracting watermark information from the valid bits of the polar coordinates of the vector data, and removing the watermark information from the polar coordinates to obtain polar coordinates without the watermark, wherein the second direction is opposite to the first direction, the rotation order of the at least two decryption angles is the same as or opposite to the rotation order of the at least two encryption angles, and the decryption angles have the same angular value as the encryption angles;
[0030] Decrypted vector data is obtained based on the decrypted polar coordinates and the polar coordinates without watermark.
[0031] Optionally, if the at least two decryption angles include a first decryption angle and a second decryption angle, rotating the polar coordinates of the vector data by the at least two decryption angles according to the second direction to obtain the decrypted polar coordinates includes:
[0032] If the polar coordinates of the vector data are the same as the encrypted polar coordinates, rotating the polar coordinates by zero degrees along the second direction to obtain the decrypted polar coordinates;
[0033] If the polar coordinates of the vector data are different from the polar coordinates after encryption, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the first pre-selected decrypted polar coordinates, and the first pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the decrypted polar coordinates; or, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the second pre-selected decrypted polar coordinates, and the second pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the decrypted polar coordinates.
[0034] In a third aspect, an embodiment of the present application further provides a data encryption and decryption system, comprising:
[0035] The server encrypts each vector data in the vector data set by performing the following operations to obtain encrypted vector data: converting the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to the at least one vertex; and
[0036] For any polar coordinate, the following operations are performed: rotating the polar coordinate in sequence by at least two encryption angles along a first direction to obtain an encrypted polar coordinate, and adding preset watermark information to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key; and
[0037] Based on the encrypted polar coordinates and the polar coordinates containing the watermark, encrypted vector data is obtained;
[0038] A client and / or another server connected to the server decrypts the encrypted vector data to obtain decrypted vector data by performing the following operations: for any received encrypted vector data, performing the following operations: rotating the polar coordinates of the vector data by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and extracting watermark information from valid bits of the polar coordinates of the vector data, and removing the watermark information from the polar coordinates to obtain polar coordinates without the watermark, wherein the second direction is opposite to the first direction, the rotation order of the at least two decryption angles is the same as or opposite to the rotation order of the at least two encryption angles, and the angular value of the decryption angle is the same as that of the encryption angle; and
[0039] Decrypted vector data is obtained based on the decrypted polar coordinates and the polar coordinates without watermark.
[0040] In a fourth aspect, an embodiment of the present application further provides a data encryption device, comprising:
[0041] a conversion unit, configured to convert the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to the at least one vertex;
[0042] an encryption unit configured to perform the following operations on any polar coordinate: rotating the polar coordinate in sequence by at least two encryption angles along a first direction to obtain an encrypted polar coordinate; and adding preset watermark information to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on a respective key;
[0043] The synthesis unit is used to obtain encrypted vector data based on the encrypted polar coordinates and the polar coordinates containing the watermark.
[0044] Optionally, the coordinates of each vector data in the vector data set are converted into polar coordinates, and the conversion unit is used to:
[0045] Determining a convex polygon based on the coordinates of each vertex included in each vector data in the vector data set, wherein the coordinates of each vertex are located inside the convex polygon or on the edge of the convex polygon;
[0046] Select the two vertices on the edge of the convex polygon that are the farthest apart, determine the minimum enclosing circle based on any point on the perpendicular bisector and the two vertices, and establish a polar coordinate system with the center of the minimum enclosing circle as the pole and the horizontal ray from the center as the polar axis;
[0047] The coordinates of each vector data in the vector data set are converted into polar coordinates in the polar coordinate system according to the conversion formula.
[0048] Optionally, if the at least two encrypted angles include a first encrypted angle and a second encrypted angle, the polar coordinates are rotated sequentially by the at least two encrypted angles along the first direction to obtain encrypted polar coordinates, and the encryption unit is configured to:
[0049] If the coordinates of the vertex corresponding to the polar coordinate are not on the edge of the convex polygon, rotating the polar coordinate in the first direction by an angle value corresponding to the first encryption angle to obtain the preselected encrypted polar coordinate, and rotating the preselected encrypted polar coordinate in the first direction by an angle value corresponding to the second encryption angle to obtain the encrypted polar coordinate;
[0050] If the coordinates of the vertex corresponding to the polar coordinate are on the edge of the convex polygon, the polar coordinate is rotated by zero degrees along the first direction to obtain the encrypted polar coordinate.
[0051] Optionally, a preset watermark information is added to the valid bits of the polar coordinates to obtain polar coordinates containing the watermark, and the encryption unit is used to:
[0052] Normalizing the polar coordinates to obtain normalized polar coordinates, wherein the length represented by the polar coordinates is less than half the length of the line segment;
[0053] Binarizing the normalized polar coordinates to obtain multiple significant digits of the polar coordinates;
[0054] Adding the preset watermark information to any valid bit of multiple valid bits to obtain the embedded polar coordinates;
[0055] The embedded polar coordinates are inversely normalized to obtain the polar coordinates containing the watermark.
[0056] Optionally, generate a random rotation sequence by:
[0057] Generate a chaotic sequence from each key in a preset key set according to a preset chaotic mapping algorithm;
[0058] Each numerical value in the chaotic sequence is converted into an angle value ranging from 0 to 360 degrees, and a random rotation sequence is generated based on the converted angle values.
[0059] In a fifth aspect, an embodiment of the present application further provides a data decryption device, comprising:
[0060] a decryption unit configured to perform the following operations for any received encrypted vector data: rotating the polar coordinates of the vector data by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and extracting watermark information from the valid bits of the polar coordinates of the vector data, and removing the watermark information from the polar coordinates to obtain polar coordinates without the watermark, wherein the second direction is opposite to the first direction, the rotation order of the at least two decryption angles is the same as or opposite to the rotation order of the at least two encryption angles, and the decryption angles have the same angular value as the encryption angles;
[0061] The merging unit is used to obtain decrypted vector data based on the decrypted polar coordinates and the polar coordinates without watermark.
[0062] Optionally, if the at least two decryption angles include a first decryption angle and a second decryption angle, the polar coordinates of the vector data are rotated by at least two decryption angles according to the second direction to obtain decrypted polar coordinates, and the decryption unit is configured to:
[0063] If the polar coordinates of the vector data are the same as the encrypted polar coordinates, rotating the polar coordinates by zero degrees along a second direction to obtain the decrypted polar coordinates;
[0064] If the polar coordinates of the vector data are different from the encrypted polar coordinates, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the first pre-selected decrypted polar coordinates, and the first pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the decrypted polar coordinates; or, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the second pre-selected decrypted polar coordinates, and the second pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the decrypted polar coordinates.
[0065] In a sixth aspect, a computer-readable storage medium, when instructions in the storage medium are executed by a processor, enables the processor to execute any one of the methods described in the above-mentioned data encryption method and data decryption method.
[0066] The beneficial effects of this application are as follows:
[0067] In summary, in an embodiment of the present application, a data encryption method, a data decryption method, an apparatus and a storage medium are provided. The encryption method includes: converting the coordinates of each vector data in a vector data set into polar coordinates, each vector data includes at least one vertex, and the polar coordinates include polar coordinates and polar coordinates corresponding to at least one vertex, and performing the following operations for any polar coordinate: rotating the polar coordinates in a first direction by at least two encryption angles in sequence to obtain encrypted polar coordinates, adding preset watermark information to the valid bits of the polar coordinates to obtain polar coordinates containing watermarks, at least two encrypted angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key, and based on the encrypted polar coordinates and the polar coordinates containing watermarks, the encrypted vector data is obtained. The above method conveniently and efficiently realizes the encryption of data and the embedding of watermark information.
[0068] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0070] FIG1 is a schematic diagram of a flow chart of a data encryption method in an embodiment of the present application;
[0071] FIG2 is a schematic diagram of a process for converting the coordinates of each vector data in a vector data set into polar coordinates in an embodiment of the present application;
[0072] FIG3 is a schematic diagram of establishing a polar coordinate system in an embodiment of the present application;
[0073] FIG4 is a schematic diagram of a specific process for encrypting polar angle coordinates in an embodiment of the present application;
[0074] FIG5 is a schematic diagram of encrypting polar coordinates in an embodiment of the present application;
[0075] FIG6 is a schematic diagram of a specific process for encrypting polar coordinates in an embodiment of the present application;
[0076] FIG7 is a flow chart of a data decryption method according to an embodiment of the present application;
[0077] FIG8 is a schematic diagram of a process for decrypting encrypted vector data in an embodiment of the present application;
[0078] FIG9 is a schematic diagram of the system architecture of a data encryption and decryption system according to an embodiment of the present application;
[0079] FIG10 is a schematic diagram of a processing flow of a data encryption and decryption system according to an embodiment of the present application;
[0080] FIG11 is a schematic diagram of the logical architecture of a data encryption device according to an embodiment of the present application;
[0081] FIG12 is a schematic diagram of the logical architecture of a data decryption device according to an embodiment of the present application. DETAILED DESCRIPTION
[0082] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of the technical solutions of this application, but not all of them. Based on the embodiments described in this application document, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the technical solutions of this application.
[0083] The terms "first," "second," and the like in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present invention described herein can be practiced using orders other than those illustrated or described herein.
[0084] The preferred embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0085] The following first introduces the data encryption method. Referring to FIG1 , in an embodiment of the present application, a specific process of data encryption is as follows:
[0086] Step 201: Convert the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to at least one vertex.
[0087] First, let's discuss vector data. Vector data is internal data stored in a computer using a vector structure. Within the structure of vector data, points, lines, and surfaces are used to describe stored entities and their relationships. Using vector data in computers offers advantages such as reduced storage requirements and the ability to extract topological relationships between data items from certain features derived from point coordinate chains. However, its disadvantages include the complexity of data editing, updating, and processing.
[0088] In the embodiment of the present application, the data that needs to be encrypted are the vector data in the vector data set. It should be noted that each of the above-mentioned vector data includes at least one vertex, that is, each vector data is composed of multiple vertex coordinates, and the vector data set includes multiple vector data, that is, a vector data set is composed of a combination of multiple vertex coordinates.
[0089] Usually, the coordinate system of vector data is a Cartesian coordinate system, and each vector data is represented by different coordinates. During the implementation process, each vector data needs to be converted from the current coordinate system to the polar coordinate system for processing.
[0090] The above-mentioned conversion of the coordinates of each vector data in the vector data set into polar coordinates, as shown in FIG2 , includes:
[0091] Step 2011: Determine a convex polygon based on the coordinates of each vertex included in each vector data in the vector data set, wherein the coordinates of each vertex are located inside the convex polygon or on the edge of the convex polygon.
[0092] In an embodiment of the present application, a method for constructing a polar coordinate system based on the minimum enclosing circle of vector data is proposed. In the Cartesian coordinate system, the coordinates of each vertex included in each vector data in the vector data set are represented by points. The outermost vertices of the above vertices constitute a minimum enclosing circle, and then a convex polygon is constructed based on the above multiple points based on the principle that the minimum enclosing circle remains unchanged.
[0093] The principle of constructing a convex polygon is that the coordinates of each vertex in the vector data set are located inside the convex polygon, or the coordinates of each vertex in the vector data set are located on each edge of the convex polygon. In other words, the area where the convex polygon is located can cover all the vertices in the vector data set.
[0094] Step 2012: Select two vertices on the edge of the convex polygon that are farthest apart, determine the minimum enclosing circle based on any point on the perpendicular bisector and the above two vertices, and establish a polar coordinate system with the center of the minimum enclosing circle as the pole and the ray along the horizontal direction of the center as the polar axis.
[0095] After the convex polygon is determined, the two vertices with the farthest distance from each other are selected on each side of the convex polygon. That is, the lengths of the line segments between any two vertices on the side are compared, and the two vertices corresponding to the line segment with the longest length are selected.
[0096] After determining the above two vertices, determine a line segment based on the above two vertices, make a perpendicular bisector of the above line segment, and make a pre-selected radius line segment from any point on the perpendicular bisector and the above two vertices. When the circle with the pre-selected radius line segment as the radius can just contain all the vector data in the vector data set, the above any point is determined to be the center of the minimum enclosing circle. When establishing the polar coordinate system, the center of the circle is used as the pole of the polar coordinate system, and the ray along the horizontal direction of the center of the circle is taken as the polar axis, and then the polar coordinate system is established based on the pole and the polar axis, as shown in Figure 3.
[0097] Step 2013: Convert the coordinates of each vector data in the vector data set into polar coordinates in a polar coordinate system according to a conversion formula.
[0098] After the polar coordinate system is established, the coordinates of each vector data in the vector data set are converted into polar coordinates under the polar coordinate system according to the conversion formula.
[0099] Assume that the coordinates of vector data a in the Cartesian coordinate system are (x, y), and the coordinates of the pole in the above polar coordinate system are (x0, y0). The vector data a is converted to the polar coordinates (ρ, θ) in the polar coordinate system using the following conversion formulas (1) and (2).
[0100] Step 202: For any polar coordinate, perform the following operations: rotate the polar coordinate in sequence by at least two encryption angles in a first direction to obtain an encrypted polar coordinate, and add preset watermark information to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key.
[0101] During implementation, considering that the polar angle in polar coordinates can be rotated clockwise or counterclockwise around the pole to any angle value, and the final angle value is independent of the order in which the angles are rotated, the polar angle is selected as the encryption target. This means that the key used in transmission is converted into an angle form and added to the polar angle coordinates. The polar diameter in polar coordinates can remain relatively stable under geometric attacks, meaning that the polar diameter is effectively resistant to geometric attacks. Therefore, watermark information is added to the polar diameter.
[0102] First, let's introduce the process of converting the above keys into angles, that is, the process of generating random rotation sequences for each key. The random rotation sequences are generated in the following way:
[0103] (1) Generate a chaotic sequence from each key in the preset key set according to the preset chaotic mapping algorithm.
[0104] During the implementation process, before each vector data in the vector data set is transmitted, each vector data needs to be encrypted using each key in the preset key set. Considering that the data encrypted for polar coordinates needs to be angle values, during the implementation process, each key in the key set is first converted into a chaotic sequence sθ={sθ1,sθ2,…,sθ n}, the formula (3) to be used in the conversion is as follows:
[0105] Among them, X n is the specific value of the key to be converted, X n+1 is the specific value of the converted key, α is a random number in the range of (0,2], and dp is a random number in the range of (0,1). In the embodiment of the present application, the combination of parameter α, parameter dp and initial value X0 is the key for generating the chaotic sequence.
[0106] (2) Each numerical value in the chaotic sequence is converted into an angle value from 0 to 360 degrees, and a random rotation sequence is generated based on the converted angle values.
[0107] During the implementation process, after using formula (3) to generate chaotic sequences from each vector data, the chaotic sequences are integerized and converted into integer sequences Sθ={Sθ1, Sθ2,…, Sθn}, its value range is in the interval [0,360), and the conversion formula (4) is:
[0108] If the at least two encrypted angles include a first encrypted angle and a second encrypted angle, the polar coordinates are rotated in sequence by at least two encrypted angles according to the first direction to obtain encrypted polar coordinates, as shown in FIG4 , including:
[0109] In order to ensure that the minimum enclosing circle remains unchanged, the following two situations are handled for the vertices corresponding to the polar coordinates during implementation:
[0110] Step 2021: If the coordinates of the vertex corresponding to the polar coordinates are not on the edge of the convex polygon, the polar coordinates are rotated in the first direction by the angle value corresponding to the first encryption angle to obtain the pre-selected encrypted polar coordinates, and the pre-selected encrypted polar coordinates are rotated in the first direction by the angle value corresponding to the second encryption angle to obtain the encrypted polar coordinates.
[0111] Case 1: If the coordinates of the vertex corresponding to the polar coordinates are not on the edge of the convex polygon, the polar coordinates are rotated in the first direction by the angle value corresponding to the first encryption angle, that is, the polar coordinates are encrypted once first, and the result after this encryption is the pre-selected encrypted polar coordinates. On this basis, the pre-selected encrypted polar coordinates are continued to be rotated in the first direction by the second encryption angle, that is, the polar coordinates are encrypted for the second time, and the result after this encryption is the encrypted polar coordinates. The process of encrypting the polar coordinates each time is shown in Figure 5.
[0112] It should be noted that the first direction is either clockwise or counterclockwise. The above example illustrates the encryption of polar coordinates twice using the first and second encryption angles. In actual applications, there is no specific limit on the number of times polar coordinates are encrypted. Typically, the buyer and seller involved in a data transaction may each encrypt polar coordinates at least once.
[0113] Step 2022: If the coordinates of the vertex corresponding to the polar coordinates are on the edge of the convex polygon, the polar coordinates are rotated by zero degrees along the first direction to obtain encrypted polar coordinates.
[0114] Case 2: If the coordinates of the vertex corresponding to the polar coordinate are on the edge of the convex polygon, in order to ensure that the above minimum enclosing circle remains unchanged, the polar coordinate is rotated by zero degrees along the first direction, that is, the polar coordinate is not encrypted, and the current polar coordinate is used as the encrypted polar coordinate.
[0115] The preset watermark information is added to the valid bits of the polar coordinates to obtain the polar coordinates containing the watermark, as shown in FIG6 , including:
[0116] Step 2021 ′: normalize the polar coordinates to obtain normalized polar coordinates, wherein the length represented by the polar coordinates is less than half the length of the line segment.
[0117] First of all, it should be explained that since the radius of the above-mentioned minimum circumscribed circle is half the length of the above-mentioned line segment, when the polar coordinate is greater than the radius of the minimum circumscribed circle, it means that the polar coordinate is an invalid coordinate. In the embodiment of the present application, only the valid coordinates within the minimum circumscribed circle, that is, the polar coordinates whose length is less than half the length of the line segment, are processed.
[0118] During the implementation process, the polar coordinates are first normalized according to the transformation formula (5), which is as follows:
[0119] Among them, r min Represents the minimum value in polar coordinates, r max Represents the maximum value in polar coordinates, r i Represents the polar coordinate to be normalized, r' i Represents the normalized polar coordinates.
[0120] Step 2022 ′: binarize the normalized polar coordinates to obtain multiple significant digits of the polar coordinates.
[0121] Considering that the watermark information is data composed of 0 and 1, during the implementation process, it is necessary to perform binarization on the normalized polar coordinates, that is, convert the normalized polar coordinates into information composed of 0 and 1, and extract multiple valid bits from the polar coordinates, that is, extract 1 from the binarized polar coordinates.
[0122] Step 2023 ′: Add the preset watermark information to any valid bit of the multiple valid bits to obtain the embedded polar coordinates.
[0123] After obtaining multiple valid bits of the polar coordinates, the preset watermark information is added to any one of the multiple valid bits. It should be noted that when the watermark information includes multiple bits, the watermark information is added to any one of the multiple valid bits in turn, that is, the watermark information is dispersed to each valid bit of the polar coordinates, thereby obtaining the embedded polar coordinates.
[0124] During the implementation, in order to quickly obtain the watermark information, the watermark bit index index can be established through formula (6), which is as follows: index = int(r′ i *10 k-1 )mod n formula (6)
[0125] Then the watermark information to be embedded W={w1,w2,…,w n} is embedded into the k-th significant bit of r′, and the k-th significant bit is determined according to formula (7), which is as follows:
[0126] Step 2024 ′: perform inverse normalization on the embedded polar coordinates to obtain polar coordinates containing the watermark.
[0127] During the implementation process, after obtaining the embedded polar coordinates, the embedded polar coordinates are further inversely normalized using formula (8), which is as follows:
[0128] The polar coordinates after inverse normalization are used as the polar coordinates containing the watermark.
[0129] Step 203: obtaining watermarked vector data based on the encrypted polar coordinates and the watermarked polar coordinates.
[0130] Since the encrypted vector data is transmitted as a whole, during the implementation process, the encrypted polar angle coordinates and the polar diameter coordinates containing the watermark are recombined to form the encrypted vector data.
[0131] Generally, before the encrypted polar coordinates and the watermarked polar coordinates are recombined, the polar coordinates and the polar coordinates need to be converted from the polar coordinate system to the original coordinate system, such as the Cartesian coordinate system.
[0132] After introducing the data encryption method, the data decryption method is introduced next. Referring to FIG7 , in an embodiment of the present application, a specific process of data decryption is as follows:
[0133] Step 301: Perform the following operations for any encrypted vector data received: rotate the polar coordinates of the vector data by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and extract watermark information from the valid bits of the polar coordinates of the vector data, and remove the watermark information from the polar coordinates to obtain polar coordinates without watermark, wherein the second direction is opposite to the first direction, the rotation order of at least two decryption angles is the same as or opposite to the rotation order of at least two encryption angles, and the angle value of the decryption angle is the same as that of the encryption angle.
[0134] The decryption process includes decrypting the polar coordinates and the polar coordinates separately.
[0135] When decrypting the polar coordinates, first determine the encrypted polar coordinates from the received encrypted vector data. Since the polar angle is rotated according to the first direction during the encryption process of the polar coordinates, the polar coordinates of the vector data need to be rotated according to the second direction by at least two decryption angles during the decryption process.
[0136] It should be noted that the second direction is opposite to the first direction. When the first direction is clockwise, the second direction is counterclockwise; when the first direction is counterclockwise, the second direction is clockwise. Furthermore, when the decryption angle includes at least two decryption angles, the order in which the decryption angles are used is not specifically limited. For example, the first decryption angle can be used first, followed by the second decryption angle; or the second decryption angle can be used first, followed by the first decryption angle. Typically, the first decryption angle and the first encryption angle have the same value, meaning they correspond to the same key. The second decryption angle and the second encryption angle have the same value, meaning they correspond to the same key.
[0137] In a specific implementation, if the at least two decryption angles include a first decryption angle and a second decryption angle, the polar coordinates of the vector data are rotated by at least two decryption angles according to the second direction to obtain decrypted polar coordinates, as shown in FIG8 , including:
[0138] Since only the coordinates of the vertices corresponding to the polar coordinates that are not on the edge of the convex polygon are encrypted during the encryption process, only the polar coordinates that are not on the edge of the convex polygon need to be decrypted here, that is, the decryption situations include the first decryption situation and the second decryption situation described below.
[0139] Step 3011: If the polar coordinates of the vector data are the same as the encrypted polar coordinates, the polar coordinates are rotated by zero degrees along the second direction to obtain the decrypted polar coordinates.
[0140] The first decryption situation: compare the polar coordinates of the vector data with the encrypted polar coordinates to see if they are the same. If they are the same, it means that the corresponding polar coordinates are on the edge of the convex polygon. In this case, rotate the polar coordinates by zero degrees in the second direction, that is, do not decrypt the polar coordinates, and use the polar coordinates of the received vector data as the decrypted polar coordinates.
[0141] Step 3012: If the polar coordinates of the vector data are different from the encrypted polar coordinates, rotate the polar coordinates of the vector data in the second direction by the angle value corresponding to the first decryption angle to obtain the first pre-selected decrypted polar coordinates, and rotate the first pre-selected decrypted polar coordinates in the second direction by the angle value corresponding to the second decryption angle to obtain the decrypted polar coordinates; or rotate the polar coordinates of the vector data in the second direction by the angle value corresponding to the second decryption angle to obtain the second pre-selected decrypted polar coordinates, and rotate the second pre-selected decrypted polar coordinates in the second direction by the angle value corresponding to the first decryption angle to obtain the decrypted polar coordinates.
[0142] The second decryption situation: If, after comparison, it is found that the polar coordinates of the vector data are different from the polar coordinates after encryption, it means that the corresponding polar coordinates are not on the edge of the convex polygon. In this case, the polar coordinates of the vector data are rotated by the corresponding angle value in the second direction to obtain the decrypted polar coordinates.
[0143] For vector data obtained through two encryptions, the encryption process is unique and predefined, but two decryption methods can be used during the decryption process. The first decryption method involves first rotating the polar coordinates of the vector data along the second direction by the angle corresponding to the first decryption angle to obtain the first pre-selected decrypted polar coordinates, and then rotating the first pre-selected decrypted polar coordinates along the second direction by the angle corresponding to the second decryption angle to obtain the decrypted polar coordinates. Specifically, during the decryption process, the polar coordinates are first rotated by the angle corresponding to the first decryption angle, and then, on this basis, the polar coordinates are rotated by the angle corresponding to the second decryption angle to obtain the decrypted polar coordinates.
[0144] The second decryption method is to rotate the polar coordinates of the vector data by the angle value corresponding to the second decryption angle in the second direction to obtain the second pre-selected decrypted polar coordinates, and to rotate the second pre-selected decrypted polar coordinates by the angle value corresponding to the first decryption angle in the second direction to obtain the decrypted polar coordinates. That is, during the decryption process, the polar coordinates are first rotated by the angle value corresponding to the second decryption angle, and then, on this basis, the polar coordinates are rotated by the angle value corresponding to the first decryption angle to obtain the decrypted polar coordinates. Typically, the decrypted polar coordinates are converted from the polar coordinate system to the original coordinate system using formula (9), which is as follows:
[0145] α′ i =(α i +θ i )mod 2π formula (9)
[0146] It should be noted that the above-mentioned second direction is the opposite direction of the first direction involved in the encryption process, that is, when the first direction is clockwise, the second direction is counterclockwise; when the first direction is counterclockwise, the second direction is clockwise.
[0147] In the implementation process, when the number of decrypted angles is greater, the corresponding decryption steps are also more, which will not be described in detail here. Generally, the buyer and seller involved in the data transaction process can each decrypt the polar coordinates of the vector data at least once.
[0148] After obtaining the decrypted polar coordinates, the watermark information is further extracted from the valid bits of the polar coordinates of the vector data, and the watermark information is removed from the polar coordinates to obtain polar coordinates without watermark. The above-mentioned method of removing the watermark information includes but is not limited to clearing the valid bits where the watermark information is located.
[0149] Step 302: Obtain decrypted vector data based on the decrypted polar coordinates and the polar coordinates without watermark.
[0150] During implementation, after obtaining the decrypted polar coordinates and the polar coordinates without the watermark, the decrypted polar coordinates and the polar coordinates without the watermark are combined to obtain the decrypted vector data. Typically, the decrypted vector data is also converted to the original coordinate system such as the Cartesian coordinate system.
[0151] Next, the data encryption and decryption system will be introduced. Referring to FIG. 9 , an embodiment of the present application provides a data encryption and decryption system comprising at least one server. The sender of the vector data is the at least one server. Before sending the vector data, the at least one server encrypts the vector data according to, for example, the angle value corresponding to the key specified by the buyer and the key specified by the seller, and then transmits the encrypted vector data to at least one client and / or server. The at least one server is connected to at least one client and / or server. Upon receiving the encrypted vector data, the at least one client and / or server decrypts the data accordingly, thereby obtaining the decrypted vector data.
[0152] Specifically, the server encrypts each vector data in the vector data set by performing the following operations to obtain encrypted vector data: converting the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to the at least one vertex; and
[0153] For any polar coordinate, the following operations are performed: the polar coordinate is rotated in sequence by at least two encryption angles in a first direction to obtain an encrypted polar coordinate, and the preset watermark information is added to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key; the above encryption process is represented by the following formula (10):
[0154] as well as
[0155] Based on the encrypted polar coordinates and the polar coordinates containing the watermark, encrypted vector data is obtained;
[0156] The client and / or another server connected to the server decrypts the encrypted vector data by performing the following operations to obtain the decrypted vector data: for any received encrypted vector data, performing the following operations: rotating the polar coordinates of the vector data by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and extracting watermark information from the valid bits of the polar coordinates of the vector data, and removing the watermark information from the polar coordinates to obtain polar coordinates without the watermark, wherein the second direction is opposite to the first direction, the rotation order of the at least two decryption angles is the same as or opposite to the rotation order of the at least two encryption angles, and the angle value of the decryption angle is the same as that of the encryption angle; the above decryption process is represented by the following formula (11):
[0157] as well as
[0158] Decrypted vector data is obtained based on the decrypted polar coordinates and the polar coordinates without watermark.
[0159] The encryption and decryption processes of the vector data in the above system are shown in FIG10 .
[0160] Based on the same inventive concept, referring to FIG11 , an embodiment of the present application provides a data encryption device, including:
[0161] The conversion unit 1101 is configured to convert the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to at least one vertex.
[0162] The encryption unit 1102 is configured to perform the following operations for any polar coordinate: rotating the polar coordinate in sequence by at least two encryption angles in a first direction to obtain an encrypted polar coordinate, and adding preset watermark information to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key.
[0163] The synthesis unit 1103 is configured to obtain encrypted vector data based on the encrypted polar coordinates and the polar coordinates containing the watermark.
[0164] Optionally, the coordinates of each vector data in the vector data set are converted into polar coordinates, and the conversion unit 1101 is used to:
[0165] Determining a convex polygon based on the coordinates of each vertex included in each vector data in the vector data set, wherein the coordinates of each vertex are located inside the convex polygon or on the edge of the convex polygon;
[0166] Select the two vertices on the edge of the convex polygon that are the farthest apart, determine the minimum enclosing circle based on any point on the perpendicular bisector and the two vertices, and establish a polar coordinate system with the center of the minimum enclosing circle as the pole and the horizontal ray from the center as the polar axis;
[0167] The coordinates of each vector data in the vector data set are converted into polar coordinates in the polar coordinate system according to the conversion formula.
[0168] Optionally, if the at least two encrypted angles include a first encrypted angle and a second encrypted angle, the polar coordinates are rotated sequentially by the at least two encrypted angles along the first direction to obtain encrypted polar coordinates. The encryption unit 1102 is configured to:
[0169] If the coordinates of the vertex corresponding to the polar coordinate are not on the edge of the convex polygon, rotating the polar coordinate in the first direction by an angle value corresponding to the first encryption angle to obtain the preselected encrypted polar coordinate, and rotating the preselected encrypted polar coordinate in the first direction by an angle value corresponding to the second encryption angle to obtain the encrypted polar coordinate;
[0170] If the coordinates of the vertex corresponding to the polar coordinate are on the edge of the convex polygon, the polar coordinate is rotated by zero degrees along the first direction to obtain the encrypted polar coordinate.
[0171] Optionally, a preset watermark information is added to the valid bits of the polar coordinates to obtain polar coordinates containing the watermark, and the encryption unit 1102 is used to:
[0172] Normalizing the polar coordinates to obtain normalized polar coordinates, wherein the length represented by the polar coordinates is less than half the length of the line segment;
[0173] Binarizing the normalized polar coordinates to obtain multiple significant digits of the polar coordinates;
[0174] Adding the preset watermark information to any valid bit of multiple valid bits to obtain the embedded polar coordinates;
[0175] The embedded polar coordinates are inversely normalized to obtain the polar coordinates containing the watermark.
[0176] Optionally, generate a random rotation sequence by:
[0177] Generate a chaotic sequence from each key in a preset key set according to a preset chaotic mapping algorithm;
[0178] Each numerical value in the chaotic sequence is converted into an angle value ranging from 0 to 360 degrees, and a random rotation sequence is generated based on the converted angle values.
[0179] Based on the same inventive concept, referring to FIG12 , an embodiment of the present application provides a data decryption device, including:
[0180] The decryption unit 1201 is used to perform the following operations on any encrypted vector data received: rotating the polar coordinates of the vector data by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and extracting watermark information from the valid bits of the polar coordinates of the vector data, and removing the watermark information from the polar coordinates to obtain polar coordinates without the watermark, wherein the second direction is opposite to the first direction, the rotation order of the at least two decryption angles is the same as or opposite to the rotation order of the at least two encryption angles, and the decryption angles have the same angle value as the encryption angles.
[0181] The merging unit 1202 is configured to obtain decrypted vector data based on the decrypted polar coordinates and the polar coordinates without the watermark.
[0182] Optionally, if the at least two decryption angles include a first decryption angle and a second decryption angle, the polar coordinates of the vector data are rotated by at least two decryption angles according to the second direction to obtain decrypted polar coordinates, and the decryption unit 1201 is configured to:
[0183] If the polar coordinates of the vector data are the same as the encrypted polar coordinates, rotating the polar coordinates by zero degrees along a second direction to obtain the decrypted polar coordinates;
[0184] If the polar coordinates of the vector data are different from the encrypted polar coordinates, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the first pre-selected decrypted polar coordinates, and the first pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the decrypted polar coordinates; or, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the second pre-selected decrypted polar coordinates, and the second pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the decrypted polar coordinates.
[0185] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor, the processor is enabled to execute any one of the above-mentioned data encryption method and data decryption method.
[0186] In summary, in an embodiment of the present application, a data encryption method, a data decryption method, an apparatus and a storage medium are provided. The encryption method includes: converting the coordinates of each vector data in a vector data set into polar coordinates, each vector data includes at least one vertex, and the polar coordinates include polar coordinates and polar coordinates corresponding to at least one vertex, and performing the following operations for any polar coordinate: rotating the polar coordinates in a first direction by at least two encryption angles in sequence to obtain encrypted polar coordinates, adding preset watermark information to the valid bits of the polar coordinates to obtain polar coordinates containing watermarks, at least two encrypted angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key, and based on the encrypted polar coordinates and the polar coordinates containing watermarks, the encrypted vector data is obtained. The above method conveniently and efficiently realizes the encryption of data and the embedding of watermark information.
[0187] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program product systems. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product system implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0188] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program product systems according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an add-in processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0189] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0191] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A data encryption method, characterized in that: The method comprises: Convert the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to the at least one vertex; For any polar coordinate, the following operations are performed: the polar angular coordinate is rotated in sequence by at least two encryption angles in a first direction to obtain an encrypted polar angular coordinate, and the preset watermark information is added to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key; Encrypted vector data is obtained based on the encrypted polar angle coordinates and the watermarked polar coordinates.
2. The method according to claim 1, characterized in that The step of converting the coordinates of each vector data in the vector data set into polar coordinates comprises: Determine a convex polygon based on the coordinates of each vertex included in each vector data in the vector data set, wherein the coordinates of each vertex are located inside the convex polygon or on the edge of the convex polygon; Select two vertices with the farthest distance on the edge of the convex polygon, determine a minimum enclosing circle based on any point on the perpendicular bisector and the two vertices, and establish a polar coordinate system with the center of the minimum enclosing circle as the pole and the ray along the horizontal direction of the center as the polar axis; The coordinates of each vector data in the vector data set are converted into polar coordinates in the polar coordinate system according to the conversion formula.
3. The method according to claim 2, characterized in that If the at least two encrypted angles include a first encrypted angle and a second encrypted angle, the step of rotating the polar coordinates in the first direction by at least two encrypted angles in sequence to obtain encrypted polar coordinates includes: If the coordinates of the vertex corresponding to the polar coordinates are not on the edge of the convex polygon, rotating the polar coordinates in a first direction by an angle value corresponding to the first encryption angle to obtain the pre-selected encrypted polar coordinates, and rotating the pre-selected encrypted polar coordinates in the first direction by an angle value corresponding to the second encryption angle to obtain the encrypted polar coordinates; If the coordinates of the vertex corresponding to the polar coordinates are on the edge of the convex polygon, the polar coordinates are rotated by zero degrees in a first direction to obtain the encrypted polar coordinates.
4. The method according to claim 2, characterized in that The step of adding the preset watermark information to the valid bits of the polar coordinates to obtain the polar coordinates containing the watermark includes: Normalizing the polar coordinates to obtain normalized polar coordinates, wherein the length represented by the polar coordinates is less than half the length of the line segment; Binarizing the normalized polar coordinates to obtain multiple valid digits of the polar coordinates; Adding the preset watermark information to any valid bit of the multiple valid bits to obtain the embedded polar coordinates; The embedded polar coordinates are subjected to inverse normalization processing to obtain the watermarked polar coordinates.
5. The method according to claim 1, characterized in that The random rotation sequence is generated in the following way: Generate a chaotic sequence using each key in a preset key set according to a preset chaotic mapping algorithm; Each numerical value in the chaotic sequence is converted into an angle value ranging from 0 to 360 degrees, and the random rotation sequence is generated based on the converted angle values.
6. A data decryption method, characterized in that: The method comprises: The following operations are performed for any one of the encrypted vector data received: the polar coordinates of the vector data are rotated by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and the watermark information is extracted from the valid bits of the polar coordinates of the vector data, and the watermark information is removed from the polar coordinates to obtain polar coordinates without the watermark, wherein the second direction is opposite to the first direction, the rotation order of the at least two decryption angles is the same as or opposite to the rotation order of the at least two encryption angles, and the angles of the decryption angles and the encryption angles are the same as or opposite to each other. The degree value is the same; Decrypted vector data is obtained based on the decrypted polar angle coordinates and the polar coordinates without watermark.
7. The method according to claim 6, characterized in that If the at least two decryption angles include a first decryption angle and a second decryption angle, rotating the polar coordinates of the vector data by at least two decryption angles according to the second direction to obtain the decrypted polar coordinates includes: If the polar coordinates of the vector data are the same as the encrypted polar coordinates, rotating the polar coordinates by zero degrees along a second direction to obtain the decrypted polar coordinates; If the polar coordinates of the vector data are different from the encrypted polar coordinates, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the first pre-selected decrypted polar coordinates, and the first pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the decrypted polar coordinates; or, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the second pre-selected decrypted polar coordinates, and the second pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the decrypted polar coordinates.
8. A data encryption and decryption system, characterized in that: The system comprises: The server encrypts each vector data in the vector data set by performing the following operations to obtain encrypted vector data: converting the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to the at least one vertex; and For any polar coordinate, the following operations are performed: rotating the polar angular coordinate in sequence by at least two encryption angles in a first direction to obtain an encrypted polar angular coordinate, and adding preset watermark information to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key; and Obtaining encrypted vector data based on the encrypted polar angle coordinates and the watermarked polar coordinates; A client and / or another server connected to the server decrypts the encrypted vector data by performing the following operations to obtain the decrypted vector data: performing the following operations for any one of the received encrypted vector data: rotating the polar coordinates of the vector data by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and extracting watermark information from valid bits of the polar coordinates of the vector data, and removing the watermark information from the polar coordinates to obtain polar coordinates without a watermark, wherein the second direction is opposite to the first direction, the rotation order of the at least two decryption angles is the same as or opposite to the rotation order of the at least two encryption angles, and the angle value of the decryption angle is the same as that of the encryption angle; and Decrypted vector data is obtained based on the decrypted polar angle coordinates and the polar coordinates without watermark.
9. A data encryption device, characterized in that: include: A conversion unit, used to convert the coordinates of each vector data in the vector data set into polar coordinates, wherein each vector data includes at least one vertex, and the polar coordinates include polar angle coordinates and polar diameter coordinates corresponding to the at least one vertex; An encryption unit is used to perform the following operations for any one of the polar coordinates: rotating the polar coordinate in sequence by at least two encryption angles in a first direction to obtain an encrypted polar coordinate, and adding preset watermark information to the valid bits of the polar coordinate to obtain a watermarked polar coordinate, wherein the at least two encryption angles are angle values corresponding to at least two keys in a random rotation sequence, and each angle value in the random rotation sequence is generated based on each key; The synthesis unit is used to obtain encrypted vector data based on the encrypted polar angle coordinates and the polar coordinates containing the watermark.
10. The device according to claim 9, characterized in that The coordinates of each vector data in the vector data set are converted into polar coordinates, and the conversion unit is used to: A convex polygon is determined based on the coordinates of each vertex included in each vector data in the vector data set, wherein , the coordinates of each vertex are located inside the convex polygon or on the edge of the convex polygon; Select two vertices with the farthest distance on the edge of the convex polygon, determine a minimum enclosing circle based on any point on the perpendicular bisector and the two vertices, and establish a polar coordinate system with the center of the minimum enclosing circle as the pole and the ray along the horizontal direction of the center as the polar axis; The coordinates of each vector data in the vector data set are converted into polar coordinates in the polar coordinate system according to the conversion formula.
11. The device according to claim 10, characterized in that If the at least two encrypted angles include a first encrypted angle and a second encrypted angle, the polar coordinates are rotated in sequence by at least two encrypted angles in a first direction to obtain encrypted polar coordinates, and the encryption unit is used to: If the coordinates of the vertex corresponding to the polar coordinates are not on the edge of the convex polygon, rotating the polar coordinates in a first direction by an angle value corresponding to the first encryption angle to obtain the pre-selected encrypted polar coordinates, and rotating the pre-selected encrypted polar coordinates in the first direction by an angle value corresponding to the second encryption angle to obtain the encrypted polar coordinates; If the coordinates of the vertex corresponding to the polar coordinates are on the edge of the convex polygon, the polar coordinates are rotated by zero degrees in a first direction to obtain the encrypted polar coordinates.
12. The device according to claim 10, characterized in that The preset watermark information is added to the valid bits of the polar coordinates to obtain the polar coordinates containing the watermark, and the encryption unit is used for: Normalizing the polar coordinates to obtain normalized polar coordinates, wherein the length represented by the polar coordinates is less than half the length of the line segment; Binarizing the normalized polar coordinates to obtain multiple valid digits of the polar coordinates; Adding the preset watermark information to any valid bit of the multiple valid bits to obtain the embedded polar coordinates; The embedded polar coordinates are subjected to inverse normalization processing to obtain the watermarked polar coordinates.
13. The device according to claim 9, characterized in that The random rotation sequence is generated in the following way: Generate a chaotic sequence using each key in a preset key set according to a preset chaotic mapping algorithm; Each numerical value in the chaotic sequence is converted into an angle value ranging from 0 to 360 degrees, and the random rotation sequence is generated based on the converted angle values.
14. A data decryption device, characterized in that: include: A decryption unit, configured to perform the following operations for any one of the encrypted vector data received: rotating the polar coordinates of the vector data by at least two decryption angles in a second direction to obtain decrypted polar coordinates, and extracting watermark information from valid bits of the polar coordinates of the vector data, and removing the watermark information from the polar coordinates to obtain polar coordinates without watermark, wherein the second direction is opposite to the first direction, the rotation order of the at least two decryption angles is the same as or opposite to the rotation order of the at least two encryption angles, and the decryption angle has the same angle value as the encryption angle; The merging unit is used to obtain the decrypted vector data based on the decrypted polar angle coordinates and the polar coordinates without watermark.
15. The device according to claim 14, characterized in that If the at least two decryption angles include a first decryption angle and a second decryption angle, the polar coordinates of the vector data are rotated by at least two decryption angles according to the second direction to obtain decrypted polar coordinates, and the decryption unit is used to: If the polar coordinates of the vector data are the same as the encrypted polar coordinates, rotating the polar coordinates by zero degrees along a second direction to obtain the decrypted polar coordinates; If the polar coordinates of the vector data are different from the encrypted polar coordinates, the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the first decryption angle to obtain the first pre-selected decrypted polar coordinates, and the first pre-selected decrypted polar coordinates are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the decrypted polar coordinates; or the polar coordinates of the vector data are rotated in the second direction by the angle value corresponding to the second decryption angle to obtain the second pre-selected decrypted polar coordinates, and The second pre-selected decrypted polar coordinate is rotated by an angle value corresponding to the first decrypted angle to obtain the decrypted polar coordinate.
16. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor, the processor is enabled to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Physical layer encryption method based on multi-dimensional constellation rotation
CN108574574A
Data encryption method and device, data decryption method and device and storage medium
CN117499117A
Method and device for embedding electronic watermark, method and device for reading electronic watermark, storage medium storing electronic watermark embedding program and storage medium storing electronic watermark read program
JP2001078019A
A harmonic based encryption and decryption system for waveform signals
WO2015097312A1
Encryption processing device, encryption processing method, and encryption processing program
WO2023084895A1