A geographic position graphical encryption method
By dividing geographic graphic data into unprotected and protected areas, and performing interval encryption on the protected areas, the encrypted data is then restored to plaintext, solving the problem of protecting high-precision map data in existing technologies and achieving data security, shape preservation, and correct restoration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN OLYM INFORMATION SECURITY TECHOLOGY CO LTD
- Filing Date
- 2022-01-04
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies, when protecting high-precision map data, cannot effectively prevent unauthorized users from obtaining the original data, maintain the shape of the graphics and the data format, and cannot correctly restore the high-precision data.
Geographic data is divided into non-protected and protected areas. The data in the protected areas are encrypted using an interval encryption method to generate ciphertext, and then restored to plaintext after decryption, thus preserving the data format and graphic shape.
It achieves security and unpredictability of high-precision map data, maintains the basic shape of the graphics, and can correctly restore the original data under authorized conditions, reducing storage space and management complexity.
Smart Images

Figure CN116436623B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geolocation data encryption and protection technology, specifically a geolocation graphic encryption method. Background Technology
[0002] High-precision map data is a sensitive type of data and requires protection to prevent unauthorized users from obtaining it. One direct protection method in existing technology is to reduce the precision of the high-precision map data before providing it to users. Specifically, when expressing geographical locations using latitude and longitude in a standard coordinate system, a floating-point number with 7 decimal places can express centimeter-level precision. A simple way to reduce precision is to set the high-precision numerical part to 0. For example, when the latitude and longitude floating-point number has only 5 significant decimal places, the map precision is reduced to the meter level. The drawback of this method is that the high-precision data cannot be restored. Another method is to add perturbations to the high-precision numerical part to deflect it, thus making the high-precision location no longer accurate. Summary of the Invention
[0003] The purpose of this invention is to provide a geographic location graphic encryption method to solve the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] A geographic location image encryption method, the method comprising:
[0006] Geographic data is divided into unprotected and protected areas, and the corresponding values for the unprotected and protected areas are obtained.
[0007] Perform interval encryption on the corresponding values of the protected area to form the protected area ciphertext;
[0008] The corresponding values of the protected areas and the corresponding values of the optional non-protected areas are replaced with protected area ciphertext to form geographic graphic data ciphertext;
[0009] Obtain the values of the non-protected areas and the corresponding encrypted values of the protected areas from the encrypted geographic graphic data;
[0010] Perform interval decryption on the corresponding ciphertext of the protected area to form the plaintext of the protected area;
[0011] The protected area ciphertext and the corresponding values for optional non-protected areas are replaced with the protected area plaintext to form the geographic graphic data plaintext.
[0012] As a further aspect of the present invention: dividing the geographic graphic data into non-protected areas and protected areas, and obtaining the corresponding values for the non-protected areas and the corresponding values for the protected areas includes:
[0013] The geographic data undergoes type conversion; wherein the geographic data includes integers and floating-point numbers; the type conversion includes converting floating-point numbers to integers;
[0014] Determine the precision range that needs to be protected, which contains precision boundary lines, and obtain the precision of the geographic graphic data after type conversion;
[0015] Compare the accuracy of the geographic graphic data after the type conversion with the accuracy boundary line;
[0016] When the accuracy of the converted geographic graphic data is lower than the accuracy threshold, the corresponding geographic graphic data is used as the corresponding value for the non-protected area; when the accuracy of the converted geographic graphic data is higher than the accuracy threshold, the corresponding geographic graphic data is used as the corresponding value for the protected area.
[0017] As a further aspect of the present invention, the type conversion also includes converting an integer into an expression of a specific cardinality.
[0018] As a further aspect of the present invention: the step of performing interval encryption on the corresponding values of the protected area to form the protected area ciphertext includes:
[0019] Based on the interval encryption method with determined basic parameters, the corresponding values of the protected area are encrypted to form encrypted ciphertext.
[0020] The corresponding values of the protected area are encrypted using a format-preserving encryption method; wherein the encrypted ciphertext includes the ciphertext of the format-preserving encryption method and optional parameter tuning.
[0021] Random perturbation values are generated based on a preset probability distribution, and the encrypted ciphertext includes the calculated values of the protected area; wherein, the calculated values include the sum of the corresponding numerical value and the random perturbation value, the difference between the subtraction and addition, the modulo addition result, the modulo subtraction result, and optional power adjustment;
[0022] The corresponding value of the protected area is encrypted using the order-preserving encryption method. The encrypted ciphertext is the ciphertext of the order-preserving encryption method, which uses the corresponding value of the non-protected area as a parameter for adjustment.
[0023] As a further aspect of the present invention: the step of performing interval encryption operation on the corresponding values of the protected area based on the interval encryption method with determined basic parameters to form encrypted ciphertext includes:
[0024] The corresponding values of the non-protected areas are used as parameters for the interval preservation encryption method, and the corresponding values of the protected areas are encrypted in the interval. The ciphertext is the ciphertext of the interval encryption.
[0025] As a further aspect of the present invention: the step of performing interval encryption operation on the corresponding values of the protected area based on the interval encryption method with determined basic parameters to form encrypted ciphertext includes:
[0026] A random number of a preset length is randomly selected. The random number and the corresponding value of the optional non-protected area are used as parameters for interval encryption. The corresponding value of the protected area is then encrypted in the interval. The ciphertext is the ciphertext of the interval encryption and the transformed value of the random number.
[0027] The ciphertext for interval encryption and the transformation value of the random number can be a transformation value with the ciphertext for interval encryption as the most significant bit and the random number as the least significant bit after selecting a specific base, or a transformation value with the random number as the most significant bit and the ciphertext for interval encryption as the least significant bit.
[0028] As a further aspect of the present invention: the encryption operation performed on the corresponding value of the protected area using the format-preserving encryption method includes:
[0029] The corresponding values of the non-protected areas are used as parameters for format preservation encryption, and the corresponding values of the protected areas are format preserved encryption, with the ciphertext being the format preserved encryption ciphertext.
[0030] As a further aspect of the present invention: the encryption operation performed on the corresponding value of the protected area using the format-preserving encryption method includes:
[0031] A random number of a certain length is randomly selected. The random number and the corresponding value of the non-protected area are used as parameters for format preservation encryption. The corresponding value of the protected area is format preserved and encrypted. The ciphertext is the ciphertext of the format preservation encryption and the transformed value of the random number.
[0032] The format retains the encrypted ciphertext and the transformation value of the random number. This can be achieved by selecting a specific base and using the format retains the encrypted ciphertext as the most significant bit and the random number as the least significant bit, or by using the random number as the most significant bit and the format retains the encrypted ciphertext as the least significant bit.
[0033] As a further aspect of the present invention: the step of generating random perturbation values based on a preset probability distribution, and encrypting the ciphertext including the calculated values of the protected area, includes:
[0034] Using the corresponding values of the non-protected area as parameters, a pseudo-random number string is generated using a pseudo-random number generation method with the key combined with the parameter tuning.
[0035] The pseudo-random number string is used as the random input to the probability sampling function, and random perturbation values are generated by sampling in a specified interval according to the specified probability distribution.
[0036] The random disturbance value and the corresponding value of the protected area are used to perform a modulo addition or modulo subtraction operation with a specified modulus, and the result of the operation is used as encrypted ciphertext;
[0037] A random number of a certain length is randomly selected. The random number and the corresponding value of the optional non-protected area are used as parameters for tuning. A pseudo-random number string is generated by using a pseudo-random number generation method with a key and the parameter tuning.
[0038] The pseudo-random number string is used as the random input to the probability sampling function, and random perturbation values are generated by sampling in a specified interval according to the specified probability distribution.
[0039] The random disturbance value and the corresponding value of the protected area are used to perform a modulo addition or modulo subtraction operation or an addition or subtraction operation with a specified modulus, and the operation result and the transformed value of the random number are used as encrypted ciphertext.
[0040] The calculation result and the transformation value of the random number can be a transformation value where the calculation result is the most significant bit and the random number is the least significant bit after selecting a specific base, or a transformation value where the random number is the most significant bit and the calculation result is the least significant bit.
[0041] As a further aspect of the present invention: the step of performing interval encryption on the corresponding values of the protected area to form the protected area ciphertext includes:
[0042] Merge and encrypt at least one point, two or three points of a line segment, or at least two points of a surface in a geographic location map;
[0043] The merging encryption process involves simultaneously converting the latitude and longitude data of a point to obtain the corresponding values of the longitude data for both the unprotected and protected areas, as well as the corresponding values of the latitude data for both the unprotected and protected areas. The corresponding values of the longitude and latitude data for both the unprotected and protected areas, along with other optional data including coordinate system identifiers and map generation time, are used as parameters for interval encryption. Random numbers are generated for the longitude and latitude data, and these two random numbers are merged to form the random number for interval encryption. The merged parameters and the random number are used to generate a pseudo-random number for interval encryption, while simultaneously encrypting the corresponding values of the longitude and latitude protected areas.
[0044] The merged encryption also includes generating pseudo-random numbers by simultaneously performing random number selection and interval encryption on two or more points, and encrypting the corresponding values of multiple sets of longitude and latitude protected areas.
[0045] As a further limitation of the technical solution of the present invention: the merging encryption also includes pseudo-random number generation for simultaneously performing random number selection and interval encryption on two or more points, and the encryption operation steps for the corresponding values of multiple sets of longitude and latitude protected areas include:
[0046] Use the longitude or latitude of these points, or the longest consecutive identical portion of the most significant bits of the longitude and latitude values outside the protected area, or their transformed values, as the parameters for encryption.
[0047] Use the longitude or latitude of these points, or the longest consecutive identical portion of the most significant bits of the longitude and latitude values outside the protected area, or their transformed values, along with the random numbers generated for the longitude data and the random numbers generated for the latitude data, as the encryption parameters.
[0048] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention possesses a certain degree of security: the deflected data has good unpredictability; even based on some auxiliary data, including some original data and deflected result data, it should not be possible (with a high probability) to calculate the original data corresponding to other deflected data. This invention maintains the basic shape of the graphic: in order to support the use of deflected result data by GIS data processing systems, including shape selection, the deflected data should basically maintain the shape of the original graphic. Furthermore, to use existing software, the encrypted data should maintain the original data format, including the use of double-precision floating-point numbers. This invention correctly restores the original data: in some scenarios, users wish to obtain high-precision data through authorization. If the system can use a dynamic restoration method to provide authorized users with correctly restored original data, it will effectively save high-precision data storage space and the complexity of map data management. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention.
[0050] Figure 1 A flowchart of a geographic location-based image encryption method.
[0051] Figure 2 A flowchart of the sub-processes for the geographic location graph encryption method. Detailed Implementation
[0052] High-precision map data is a sensitive type of data and requires protection to prevent unauthorized users from obtaining it. One direct protection method in existing technology is to reduce the precision of the high-precision map data before providing it to users. Specifically, when expressing geographical locations using latitude and longitude in a standard coordinate system, a floating-point number with 7 decimal places can express centimeter-level precision. A simple way to reduce precision is to set the high-precision numerical part to 0. For example, when the latitude and longitude floating-point number has only 5 significant decimal places, the map precision is reduced to the meter level. The drawback of this method is that the high-precision data cannot be restored. Another method is to add perturbations to the high-precision numerical part to deflect it, thus making the high-precision location no longer accurate.
[0053] To improve encryption effectiveness, the second method should ideally possess the following properties:
[0054] a. Possesses a certain degree of security: The deflected data has good unpredictability. Even based on some auxiliary data, including some original data and deflected result data, it should not be possible (with a high probability) to calculate the original data corresponding to other deflected data.
[0055] b. Maintain the basic shape of the graphic: In order to support the use of deflected data by GIS data processing systems, including shape selection, the deflected data should basically maintain the shape of the original graphic. In addition, to use existing software, the encrypted data should maintain the original data format, including the use of double-precision floating-point numbers.
[0056] c. Correctly Restore Original Data: In some scenarios, users may wish to obtain high-precision data through authorization. If the system can use a dynamic restoration method to provide authorized users with correctly restored original data, it will effectively save high-precision data storage space and reduce the complexity of map data management.
[0057] Figure 1 A flowchart of a geographic location graphic encryption method is shown. In this embodiment of the invention, a geographic location graphic encryption method includes:
[0058] Geographic data is divided into unprotected and protected areas, and the corresponding values for the unprotected and protected areas are obtained.
[0059] An interval encryption operation is performed on the corresponding values of the protected area to form the protected area ciphertext; wherein, interval encryption is a type of encryption method where the ciphertext value belongs to a specified area. Block encryption is a type of general interval encryption method, where the ciphertext value belongs to a block value space.
[0060] The corresponding values of the protected areas and the corresponding values of the optional non-protected areas are replaced with protected area ciphertext to form geographic graphic data ciphertext;
[0061] Obtain the values of the non-protected areas and the corresponding encrypted values of the protected areas from the encrypted geographic graphic data;
[0062] Perform interval decryption on the corresponding ciphertext of the protected area to form the plaintext of the protected area;
[0063] The protected area ciphertext and the corresponding values for optional non-protected areas are replaced with the protected area plaintext to form the geographic graphic data plaintext.
[0064] Furthermore, the step of dividing the geographic graphic data into non-protected areas and protected areas, and obtaining the corresponding values for the non-protected areas and the protected areas includes:
[0065] The geographic data undergoes type conversion; wherein the geographic data includes integers and floating-point numbers; the type conversion includes converting floating-point numbers to integers;
[0066] Determine the precision range that needs to be protected, which contains precision boundary lines, and obtain the precision of the geographic graphic data after type conversion;
[0067] Compare the accuracy of the geographic graphic data after the type conversion with the accuracy boundary line;
[0068] When the accuracy of the converted geographic graphic data is lower than the accuracy threshold, the corresponding geographic graphic data is used as the corresponding value for the non-protected area; when the accuracy of the converted geographic graphic data is higher than the accuracy threshold, the corresponding geographic graphic data is used as the corresponding value for the protected area.
[0069] Specifically, the type conversion also includes converting integers to expressions of a specific cardinality.
[0070] In one example of the technical solution of this invention, the type conversion process is described as follows:
[0071] Example 1: Given geographic location data points expressed in standard latitude and longitude (88.1234567, 40.7654321), convert it to (881234567, 407654321). Let the protected area be the lower 4 decimal digits of the data. Then, the corresponding value for the non-protected area is (88123, 40765), and the corresponding value for the protected area is (1234, 4321).
[0072] Example 2: Given geographic location data points expressed in standard latitude and longitude (88.1234567, 40.7654321), convert them to (881234567, 407654321). Let the protected area be [0, 2048). Using 2048 as the base, the corresponding values for non-protected areas converted to decimal are (430290, 199049), and the corresponding values for protected areas are (647, 1969).
[0073] Figure 2 The flowchart illustrates a sub-process of a geographic location graphic encryption method. The step of performing interval encryption on the corresponding values of the protected area to form the protected area ciphertext includes:
[0074] Based on the interval encryption method with determined basic parameters, the corresponding values of the protected area are encrypted to form encrypted ciphertext.
[0075] The corresponding values of the protected area are encrypted using a format-preserving encryption method; wherein the encrypted ciphertext includes the ciphertext of the format-preserving encryption method and optional parameter tuning.
[0076] Random perturbation values are generated based on a preset probability distribution, and the encrypted ciphertext includes the calculated values of the protected area; wherein, the calculated values include the sum of the corresponding numerical value and the random perturbation value, the difference between the subtraction and addition, the modulo addition result, the modulo subtraction result, and optional power adjustment;
[0077] The corresponding value of the protected area is encrypted using the order-preserving encryption method. The encrypted ciphertext is the ciphertext of the order-preserving encryption method, which uses the corresponding value of the non-protected area as a parameter for adjustment.
[0078] Furthermore, the step of performing interval encryption on the corresponding values of the protected area based on the interval encryption method with determined basic parameters to form encrypted ciphertext includes:
[0079] The corresponding values of the non-protected areas are used as parameters for the interval preservation encryption method, and the corresponding values of the protected areas are encrypted in the interval. The ciphertext is the ciphertext of the interval encryption.
[0080] As a preferred embodiment of the technical solution of the present invention, the step of performing interval encryption operation on the corresponding value of the protected area based on the interval encryption method with determined basic parameters to form encrypted ciphertext includes:
[0081] A random number of a preset length is randomly selected. The random number and the corresponding value of the optional non-protected area are used as parameters for interval encryption. The corresponding value of the protected area is then encrypted in the interval. The ciphertext is the ciphertext of the interval encryption and the transformed value of the random number.
[0082] The ciphertext for interval encryption and the transformation value of the random number can be a transformation value with the ciphertext for interval encryption as the most significant bit and the random number as the least significant bit after selecting a specific base, or a transformation value with the random number as the most significant bit and the ciphertext for interval encryption as the least significant bit.
[0083] In one embodiment of the technical solution of the present invention, four steps are provided to perform interval encryption operations on the corresponding values of the protected area based on the determined basic parameters to form encrypted ciphertext. Specifically, the above content is illustrated with examples:
[0084] Method 1:
[0085] 1. Let B1 = 1234, B2 = 4321;
[0086] 2. Using (88123||40765||AUX) as the counter T, and a 128-bit random key KEY as the key, a block cipher algorithm such as SM4 in counter mode CTR is called to generate the key stream SKEY, where AUX is auxiliary information, including coordinate system identifier, etc.
[0087] 2. Calculate E1 = SKEY[0,13] ⊕ B1; calculate E2 = SKEY[64,77] ⊕ B2; where SKEY[a,b] refers to bits a to b in SKEY.
[0088] 3. If E1>=10000 or E2>=10000, change the counter T (counter), set B1=E1, B2=E2, and go to step 2;
[0089] 4. Output the ciphertext interval C1=E1. C2=E2.
[0090] Method 2:
[0091] 1. Let B1 = 647, B2 = 1969;
[0092] 2. Generate a random number for longitude RND1 and a random number for latitude RND2;
[0093] 3. Using (430290||199049||RND1||RND2||AUX) as the counter and a 128-bit random key KEY as the key, the key stream SKEY is generated by calling the counter mode CTR of a block cipher algorithm such as SM4, where the exponent values are concatenated.
[0094] 4. Calculate E1 = SKEY[0,10]⊕B1; calculate E2 = SKEY[64,74]⊕B2;
[0095] 5. If E1>=2048 or E2>=2048, change the counter T (counter), set B1=E1, B2=E2, and go to step 3;
[0096] 6. Output the ciphertext of the interval C1=E1*MAXRND+RND1,C2=E2*MAXRND+RND2 or C1=RND1*2048+E1,C2=RND2*2048+E2, where MAXRND is the largest value of the random number +1.
[0097] It should be noted that since the protection range selected here is [0, 2047), step 5 will never lead to step 3, but for other choices, it may be necessary to lead to step 3.
[0098] Method 3:
[0099] 1. Let B1 = 1234, B2 = 4321;
[0100] 2. Generate a random number for longitude RND1 and a random number for latitude RND2;
[0101] 3. Calculate Z = B1 * 10000 + B2; the purpose of this step is to convert the protected area values to latitude and longitude.
[0102] 4. Using (RND1||88123||40765||RND2||AUX) as the counter T, and a 128-bit random key KEY as the key, the counter mode CTR of a block cipher algorithm such as SM4 is called to generate the key stream SKEY, where AUX is auxiliary information, including coordinate system identifier, etc.
[0103] 5. Calculate E = SKEY[0,27]⊕Z;
[0104] 6. If E>=10000*10000, change the counter T (counter), set Z=E, and go to step 2;
[0105] 7. Calculate E1 = E / 10000 and E2 = E%10000;
[0106] 8. Output the ciphertext of the interval C1=E1*MAXRND+RND1,C2=E2*MAXRND+RND2 or C1=RND1*2048+E1,C2=RND2*2048+E2, where MAXRND is the maximum value of the random number +1.
[0107] It should be noted that the method of generating the key stream SKEY is not limited to the counter mode of block cipher algorithms, but may also include the ciphertext feedback mode, output feedback mode, electronic codebook mode, stream cipher algorithms, chaotic cipher algorithms, etc.
[0108] Method 4:
[0109] 1. Let B1 = 647, B2 = 1969;
[0110] 2. Generate a random number for longitude RND1 and a random number for latitude RND2;
[0111] 3. Using (430290||199049||RND1||RND2||AUX) as the counter and a 128-bit random key KEY as the key, the key stream SKEY is generated by calling the counter mode CTR of a block cipher algorithm such as SM4, where the exponent values are concatenated.
[0112] 4. Calculate E1 = ((SKEY[0,31]%2048) + B1)%2048;
[0113] Calculate E2 = ((SKEY[64,95]%2048) + B2)%2048;
[0114] 5. Output the ciphertext of the interval C1=E1*MAXRND+RND1,C2=E2*MAXRND+RND2 or C1=RND1*2048+E1,C2=RND2*2048+E2, where MAXRND is the maximum value of the random number +1.
[0115] It is clear that the above encryption method is reversible when a key is available; the decryption method will not be described in detail here.
[0116] In a preferred embodiment of the technical solution of the present invention, the step of performing encryption operation on the corresponding value of the protected area using the format-preserving encryption method is specifically defined as follows:
[0117] The corresponding values of the non-protected areas are used as parameters for format preservation encryption, and the corresponding values of the protected areas are format preserved encryption, with the ciphertext being the format preserved encryption ciphertext.
[0118] Furthermore, the step of encrypting the corresponding value of the protected area using the format-preserving encryption method may also include:
[0119] A random number of a certain length is randomly selected. The random number and the corresponding value of the non-protected area are used as parameters for format preservation encryption. The corresponding value of the protected area is format preserved and encrypted. The ciphertext is the ciphertext of the format preservation encryption and the transformed value of the random number.
[0120] The format retains the encrypted ciphertext and the transformation value of the random number. This can be achieved by selecting a specific base and using the format retains the encrypted ciphertext as the most significant bit and the random number as the least significant bit, or by using the random number as the most significant bit and the format retains the encrypted ciphertext as the least significant bit.
[0121] In one example of the technical solution of this invention, three steps are provided for performing encryption operations on the corresponding values of the protected area using a format-preserving encryption method. Specifically, the above content is illustrated with examples:
[0122] Method 1:
[0123] 1. Let B1 = 1234, B2 = 4321;
[0124] 2. Using (88123||40765||AUX) as the tuning parameter T, and a 128-bit random key KEY as the key, call the format-preserving encryption C1=FPE.ENC(KEY,T,B1), C2=FPE(KEY,T,B2); where C=FPE.ENC(KEY,T,D) is the encryption process of a format-preserving encryption algorithm (such as FF1, FF3-1, etc. in NIST SP800-38), using KEY as the key, T as the tuning parameter, and D as the input. The output ciphertext CC has the same range as the D range.
[0125] 4. Output the ciphertext interval C1=E1. C2=E2
[0126] Method 2:
[0127] 1. Let B1 = 647, B2 = 1969;
[0128] 2. Generate a random number for longitude RND1 and a random number for latitude RND2;
[0129] 3. Use (88123||40765||RND1||RND2||AUX) as the tuning parameter T, and a 128-bit random key KEY as the key. The calling format preserves encryption: C1=FPE.ENC(KEY,T,B1), C2=FPE(KEY,T,B2);
[0130] 4. Output the ciphertext of the interval C1=E1*MAXRND+RND1,C2=E2*MAXRND+RND2 or C1=RND1*2048+E1,C2=RND2*2048+E2.
[0131] Method 3:
[0132] 1. Let B1 = 647, B2 = 1969;
[0133] 2. Generate a random number for longitude RND1 and a random number for latitude RND2;
[0134] 3. Use (88123||40765||RND1||RND2||AUX) as the tuning parameter T, and a 128-bit random key KEY as the key. The calling format is encrypted: C=FPE.ENC(KEY,T,[B1,B2]).
[0135] 4. Output the ciphertext of the interval C1=C[0]*MAXRND+RND1,C2=C[1]*MAXRND+RND2 or C1=RND1*2048+C[0],C2=RND2*2048+C[1].
[0136] The difference between Method 2 and Method 3 is that B1 and B2 are used as inputs for a single FPE encryption, with a base of 2048, and the output is also two integers between [0, 2048). Calling FPE once is more efficient, and the data field of FPE is larger (from [0, 2048) to [0, 2048 * 2048)), thus providing higher security.
[0137] As a preferred embodiment of the technical solution of the present invention, the step of generating random perturbation values based on a preset probability distribution and encrypting ciphertext including the calculated values of the protected area includes:
[0138] Using the corresponding values of the non-protected area as parameters, a pseudo-random number string is generated using a pseudo-random number generation method with the key combined with the parameter tuning.
[0139] The pseudo-random number string is used as the random input to the probability sampling function, and random perturbation values are generated by sampling in a specified interval according to the specified probability distribution.
[0140] The random disturbance value and the corresponding value of the protected area are used to perform a modulo addition or modulo subtraction operation with a specified modulus, and the result of the operation is used as encrypted ciphertext;
[0141] A random number of a certain length is randomly selected. The random number and the corresponding value of the optional non-protected area are used as parameters for tuning. A pseudo-random number string is generated by using a pseudo-random number generation method with a key and the parameter tuning.
[0142] The pseudo-random number string is used as the random input to the probability sampling function, and random perturbation values are generated by sampling in a specified interval according to the specified probability distribution.
[0143] The random disturbance value and the corresponding value of the protected area are used to perform a modulo addition or modulo subtraction operation or an addition or subtraction operation with a specified modulus, and the operation result and the transformed value of the random number are used as encrypted ciphertext.
[0144] The calculation result and the transformation value of the random number can be a transformation value where the calculation result is the most significant bit and the random number is the least significant bit after selecting a specific base, or a transformation value where the random number is the most significant bit and the calculation result is the least significant bit.
[0145] Examples of the above content are provided below:
[0146] Method 1:
[0147] 1. Let B1 = 1234, B2 = 4321;
[0148] 2. Use (88123||40765||AUX) as the parameter T, use a 128-bit random key KEY as the key, and call a pseudo-random number generation method such as the key derivation function KDF to generate a pseudo-random number string based on KEY and T;
[0149] 1. Generate random perturbation values t1 and t2 on the interval [0, 9999) based on a specified probability distribution, such as a normal distribution;
[0150] 3. Calculate E1 = t1 + B1 mod 10000; calculate E2 = E1 = t2 + B2 mod 10000;
[0151] 4. Output the ciphertext interval C1=E1. C2=E2
[0152] Method 2:
[0153] 2. Let B1 = 647, B2 = 1969;
[0154] 3. Generate a random number for longitude RND1 and a random number for latitude RND2;
[0155] 4. Use (430290||199049||RND1||RND2||AUX) as the parameter T, use a 128-bit random key KEY as the key, and call a pseudo-random number generation method such as the key derivation function KDF to generate a pseudo-random number string based on KEY and T;
[0156] 5. Generate random perturbation values t1 and t2 in the interval [0, 1024) based on the specified probability distribution, such as a uniform distribution, and the operation indicator bit f;
[0157] 6. If f=1, calculate E1=t1+B1, and calculate E2=E1=t2+B2; if f=0, calculate E1=B1-t1, and calculate E2=E1=B2-t2.
[0158] 7. Output the ciphertext interval C1=E1. C2=E2.
[0159] As a preferred embodiment of the technical solution of the present invention, the step of performing interval encryption operation on the corresponding value of the protected area to form the protected area ciphertext includes:
[0160] Merge and encrypt at least one point, two or three points of a line segment, or at least two points of a surface in a geographic location map;
[0161] The merging encryption process involves simultaneously converting the latitude and longitude data of a point to obtain the corresponding values of the longitude data for both the unprotected and protected areas, as well as the corresponding values of the latitude data for both the unprotected and protected areas. The corresponding values of the longitude and latitude data for both the unprotected and protected areas, along with other optional data including coordinate system identifiers and map generation time, are used as parameters for interval encryption. Random numbers are generated for the longitude and latitude data, and these two random numbers are merged to form the random number for interval encryption. The merged parameters and the random number are used to generate a pseudo-random number for interval encryption, while simultaneously encrypting the corresponding values of the longitude and latitude protected areas.
[0162] The merged encryption also includes generating pseudo-random numbers by simultaneously performing random number selection and interval encryption on two or more points, and encrypting the corresponding values of multiple sets of longitude and latitude protected areas.
[0163] In one example of the technical solution of the present invention, the above content is specifically described as follows:
[0164] For the three points of the line segment, the latitude and longitude are A = (88.1234567, 40.7654321), B = (88.1234568, 40.7654322), and C = (88.1234569, 40.7654323). The converted decimal protection interval is (647, 1969), (648, 1970), and (649, 1971).
[0165] 1. Let B1=647, B2=1969, B3=648, B4=1970, B5=649, B6=1971;
[0166] 2. Generate longitude random numbers RND1, RND3, RND5 and latitude random numbers RND2, RND4, RND6, each with a length of 20 bits;
[0167] 3. Using (RND1||RND2||RND3||RND4||RND5||RND6||AUX) as a counter, and a 128-bit random key KEY as the key, a block cipher algorithm such as SM4 in counter mode CTR is called to generate the key stream SKEY;
[0168] 4. Calculate E1=SKEY[0,10]⊕B1; E2=SKEY[30,40]⊕B2; E3=SKEY[50,60]⊕B3; E4=SKEY[64,74]⊕B4, E5=SKEY[94,104]⊕B5; E6=SKEY[114,124]⊕B6;
[0169] 5. Output the ciphertext interval C1 = E1 * MAXRND + RND1;
[0170] C2 = E2 * MAXRND + RND2;
[0171] C3 = E3 * MAXRND + RND3;
[0172] C4 = E4 * MAXRND + RND4;
[0173] C5 = E5 * MAXRND + RND5;
[0174] C6 = E6 * MAXRND + RND6 or:
[0175] C1 = RND1 * 2048 + E1;
[0176] C2 = RND2 * 2048 + E2;
[0177] C3 = RND3 * 2048 + E3;
[0178] C4 = RND4 * 2048 + E4;
[0179] C5 = RND5 * 2048 + E5;
[0180] C6 = RND6 * 2048 + E6;
[0181] MAXRND is 1024*1024.
[0182] Using the above-described method of merging encryption, the point encryption process uses a 120-bit random number as a counter, which is more secure than using a 40-bit random number for sampling a single point.
[0183] Use the longitude or latitude of these points, or the longest consecutive identical portion of the most significant bits of the longitude and latitude values outside the protected area, or their transformed values, as the parameters for encryption.
[0184] Use the longitude or latitude of these points, or the longest consecutive identical portion of the most significant bits of the longitude and latitude values outside the protected area, or their transformed values, along with the random numbers generated for the longitude data and the random numbers generated for the latitude data, as the encryption parameters.
[0185] In one example of the technical solution of the present invention, the above content is specifically described as follows:
[0186] For the three points of the line segment, with latitude and longitude A = (88.1234567, 40.7654321), B = (88.1234568, 40.7654322), and C = (88.1234569, 40.7654323), the converted decimal protection interval is (647, 1969), (648, 1970), and (649, 1971).
[0187] 1. Let B1=647, B2=1969, B3=648, B4=1970, B5=649, B6=1971;
[0188] 2. Calculate the longest consecutive identical high-significant bits of the unencrypted longitude data for three points: 647, 649, 649. One transformation value is 81. Another transformation value is 492. The longest consecutive identical high-significant bits of the unencrypted latitude data for three points are: 1969, 1970, 1971. One transformation value for the longest consecutive identical high-significant bits of the unencrypted latitude and longitude values is 81||492, and another transformation value is 81⊕492.
[0189] 3. Generate longitude random numbers RND1, RND3, RND5 and latitude random numbers RND2, RND4, RND6, each with a length of 16 bits;
[0190] 4. Using (81||492||RND1||RND2||RND3||RND4||RND5||RND6||AUX) as a counter, and using a 128-bit random key KEY as the key, a block cipher algorithm such as SM4 in counter mode CTR is called to generate the key stream SKEY;
[0191] 5. Calculate E1=SKEY[0,10]⊕B1; E2=SKEY[30,40]⊕B2; E3=SKEY[50,60]⊕B3; E4=SKEY[64,74]⊕B4, E5=SKEY[94,104]⊕B5; E6=SKEY[114,124]⊕B6;
[0192] 6. Output the ciphertext interval C1 = E1 * MAXRND + RND1;
[0193] C2 = E2 * MAXRND + RND2;
[0194] C3 = E3 * MAXRND + RND3;
[0195] C4 = E4 * MAXRND + RND4;
[0196] C5 = E5 * MAXRND + RND5;
[0197] C6 = E6 * MAXRND + RND6 or:
[0198] C1 = RND1 * 2048 + E1;
[0199] C2 = RND2 * 2048 + E2;
[0200] C3 = RND3 * 2048 + E3;
[0201] C4 = RND4 * 2048 + E4;
[0202] C5 = RND5 * 2048 + E5;
[0203] C6 = RND6 * 2048 + E6;
[0204] MAXRND is 1024*1024.
[0205] Similarly, if the plaintext interval size is not a power of 2, a subset of bits can be selected from SKEY, the number of which is a certain multiple of the number of bits in the plaintext interval, such as 5 / 4. For example, if the plaintext interval is [0, 1000), then ⌈10*5 / 4⌉=13 bits are selected from SKEY to encrypt plaintext data. Calculate E1=(SKEY[0,12]%1000+B1)%1000; E2=(SKEY[13,25]%1000+B2)%1000; ..., E6=(SKEY[65,77]%1000+B6)%1000.
[0206] Similarly, the interval encryption method that uses format-preserving encryption can combine B1, B2, B3, B4, B5, and B6 as the input for one encryption of FPE, with a base of 2048, which is more efficient and has better security.
[0207] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for encrypting geographic location graphics, characterized in that, The method includes: Geographic data is divided into unprotected and protected areas, and the corresponding values for the unprotected and protected areas are obtained. Perform interval encryption on the corresponding values of the protected area to form the protected area ciphertext; The corresponding values of the protected areas and the corresponding values of the optional non-protected areas are replaced with protected area ciphertext to form geographic graphic data ciphertext; Obtain the values of the non-protected areas and the corresponding encrypted values of the protected areas from the encrypted geographic graphic data; Perform interval decryption on the corresponding ciphertext of the protected area to form the plaintext of the protected area; The protected area ciphertext and the corresponding values of the optional unprotected areas are replaced with the protected area plaintext to form the geographic graphic data plaintext; the step of dividing the geographic graphic data into unprotected and protected areas and obtaining the corresponding values of the unprotected and protected areas includes: The geographic data undergoes type conversion; wherein the geographic data includes integers and floating-point numbers; the type conversion includes converting floating-point numbers to integers; Determine the precision range that needs to be protected, which contains precision boundary lines, and obtain the precision of the geographic graphic data after type conversion; Compare the accuracy of the geographic graphic data after the type conversion with the accuracy boundary line; When the accuracy of the converted geographic graphic data is lower than the accuracy threshold, the corresponding geographic graphic data is used as the corresponding value for the non-protected area; when the accuracy of the converted geographic graphic data is higher than the accuracy threshold, the corresponding geographic graphic data is used as the corresponding value for the protected area.
2. The geographic location graphic encryption method according to claim 1, characterized in that, The type conversion also includes converting integers to expressions with a specific cardinality.
3. The geographic location graphic encryption method according to claim 1, characterized in that, The step of performing interval encryption on the corresponding values of the protected area to form the protected area ciphertext includes: Based on the interval encryption method with determined basic parameters, the corresponding values of the protected area are encrypted to form encrypted ciphertext. The corresponding values of the protected area are encrypted using a format-preserving encryption method; wherein the encrypted ciphertext includes the ciphertext of the format-preserving encryption method and optional parameter tuning. Random perturbation values are generated based on a preset probability distribution, and the encrypted ciphertext includes the calculated values of the protected area; wherein, the calculated values include the sum of the corresponding numerical value and the random perturbation value, the difference between the subtraction and addition, the modulo addition result, the modulo subtraction result, and optional power adjustment; The corresponding value of the protected area is encrypted using the order-preserving encryption method. The encrypted ciphertext is the ciphertext of the order-preserving encryption method, which uses the corresponding value of the non-protected area as a parameter for adjustment.
4. The geographic location graphic encryption method according to claim 3, characterized in that, The steps of performing interval encryption on the corresponding values of the protected area based on the interval encryption method with determined basic parameters to form encrypted ciphertext include: The corresponding values of the non-protected areas are used as parameters for the interval preservation encryption method, and the corresponding values of the protected areas are encrypted in the interval. The ciphertext is the ciphertext of the interval encryption.
5. The geographic location graphic encryption method according to claim 4, characterized in that, The steps of performing interval encryption on the corresponding values of the protected area based on the interval encryption method with determined basic parameters to form encrypted ciphertext include: A random number of a preset length is randomly selected. The random number and the corresponding value of the optional non-protected area are used as parameters for interval encryption. The corresponding value of the protected area is then encrypted in the interval. The ciphertext is the ciphertext of the interval encryption and the transformed value of the random number. The ciphertext for interval encryption and the transformation value of the random number can be a transformation value with the ciphertext for interval encryption as the most significant bit and the random number as the least significant bit after selecting a specific base, or a transformation value with the random number as the most significant bit and the ciphertext for interval encryption as the least significant bit.
6. The geographic location graphic encryption method according to claim 5, characterized in that, The encryption operation performed on the corresponding values of the protected area using the format-preserving encryption method includes: The corresponding values of the non-protected areas are used as parameters for format preservation encryption, and the corresponding values of the protected areas are format preserved encryption, with the ciphertext being the format preserved encryption ciphertext.
7. The geographic location graphic encryption method according to claim 6, characterized in that, The encryption operation performed on the corresponding values of the protected area using the format-preserving encryption method includes: A random number of a certain length is randomly selected. The random number and the corresponding value of the non-protected area are used as parameters for format preservation encryption. The corresponding value of the protected area is format preserved and encrypted. The ciphertext is the ciphertext of the format preservation encryption and the transformed value of the random number. The format retains the encrypted ciphertext and the transformation value of the random number. This can be achieved by selecting a specific base and using the format retains the encrypted ciphertext as the most significant bit and the random number as the least significant bit, or by using the random number as the most significant bit and the format retains the encrypted ciphertext as the least significant bit.
8. The geographic location graphic encryption method according to claim 7, characterized in that, The step of generating random perturbation values based on a preset probability distribution, and encrypting the ciphertext including the calculated values of the protected area, includes: Using the corresponding values of the non-protected area as parameters, a pseudo-random number string is generated using a pseudo-random number generation method with the key combined with the parameter tuning. The pseudo-random number string is used as the random input to the probability sampling function, and random perturbation values are generated by sampling in a specified interval according to the specified probability distribution. The random disturbance value and the corresponding value of the protected area are used to perform a modulo addition or modulo subtraction operation with a specified modulus, and the result of the operation is used as encrypted ciphertext; A random number of a certain length is randomly selected. The random number and the corresponding value of the optional non-protected area are used as parameters for tuning. A pseudo-random number string is generated by using a pseudo-random number generation method with a key and the parameter tuning. The pseudo-random number string is used as the random input to the probability sampling function, and random perturbation values are generated by sampling in a specified interval according to the specified probability distribution. The random disturbance value and the corresponding value of the protected area are used to perform a modulo addition or modulo subtraction operation or an addition or subtraction operation with a specified modulus, and the operation result and the transformed value of the random number are used as encrypted ciphertext. The calculation result and the transformation value of the random number can be a transformation value where the calculation result is the most significant bit and the random number is the least significant bit after selecting a specific base, or a transformation value where the random number is the most significant bit and the calculation result is the least significant bit.
9. The geographic location graphic encryption method according to claim 8, characterized in that, The step of performing interval encryption on the corresponding values of the protected area to form the protected area ciphertext includes: Merge and encrypt at least one point, two or three points of a line segment, or at least two points of a surface in a geographic location map; The merging encryption process involves simultaneously converting the latitude and longitude data of a point to obtain the corresponding values of the longitude data for both the unprotected and protected areas, as well as the corresponding values of the latitude data for both the unprotected and protected areas. The corresponding values of the longitude and latitude data for both the unprotected and protected areas, along with other optional data including coordinate system identifiers and map generation time, are used as parameters for interval encryption. Random numbers are generated for the longitude and latitude data, and these two random numbers are merged to form the random number for interval encryption. The merged parameters and the random number are used to generate a pseudo-random number for interval encryption, while simultaneously encrypting the corresponding values of the longitude and latitude protected areas. The merged encryption also includes generating pseudo-random numbers by simultaneously performing random number selection and interval encryption on two or more points, and encrypting the corresponding values of multiple sets of longitude and latitude protected areas.
10. The geographic location graphic encryption method according to claim 9, characterized in that, The merged encryption also includes pseudo-random number generation that simultaneously performs random number selection and interval encryption on two or more points, and the encryption operation steps for the corresponding values of multiple sets of longitude and latitude protected areas include: Use the longitude or latitude of these points, or the longest consecutive identical portion of the most significant bits of the longitude and latitude values outside the protected area, or their transformed values, as the parameters for encryption. Use the longitude or latitude of these points, or the longest consecutive identical portion of the most significant bits of the longitude and latitude values outside the protected area, or their transformed values, along with the random numbers generated for the longitude data and the random numbers generated for the latitude data, as the encryption parameters.