GLB three-dimensional model encryption method and system and GLB three-dimensional model decryption method and system based on national cryptographic algorithm and structure confusion
By segmenting, encrypting, and anonymizing the filenames of GLB 3D models, the problems of easy copying and leakage of sensitive information in unencrypted models are solved, thus achieving model security protection and compliance.
Patent Information
- Application Number
- CN202511651368.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-01-13
AI Technical Summary
Unencrypted GLB 3D models are easily copied and distributed, leading to the unauthorized appropriation of original design results, exposure of sensitive information, and resulting in homogeneous market competition and compliance risks.
The GLB 3D model is segmented and encrypted using national cryptographic algorithms and structural obfuscation methods. Anonymous filenames are generated using hash algorithms, and encryption and decryption are performed using SM4 and SM3 algorithms to achieve dual obfuscation of file structure and content.
The model's security has been enhanced to prevent unauthorized copying and content leakage, meet compliance requirements, and improve the model's protection strength and security.
Smart Images

Figure FT_1 
Figure FT_2
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information security technology, and in particular relates to a GLB 3D model encryption method, decryption method and system based on national cryptographic algorithms and structural obfuscation. Background Technology
[0002] GLB stands for GL Transmission Format Binary, which packages a gITF model and all its related resources (such as textures and materials) into a single, self-contained binary file. GLB has become the de facto standard in Web 3D, mobile applications, games, and AR / VR. Almost all mainstream 3D engines and libraries natively support it.
[0003] However, unencrypted GLB 3D models can be freely copied, distributed, and used in commercial projects, resulting in the unauthorized appropriation of original design work. Core designs (such as product structure and part details) are easily obtained by competitors, leading to homogenized competition in the market and weakening product competitiveness. Sensitive information contained in the model, such as design logic, technical parameters (such as dimensions and tolerances), layout schemes, and cost calculations, is exposed without protection and may be borrowed by peers or used for malicious competition. Customized project requirements also pose compliance risks. Therefore, an encryption / decryption method for GLB 3D models is urgently needed. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the existing technology and propose a GLB 3D model encryption method, decryption method and system based on national cryptographic algorithms and structural obfuscation.
[0005] In view of this, the present invention proposes a GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation, comprising: Step S1: Obtain the 3D model file in GLB format to be encrypted; Step S2: Based on the set threshold, determine the size of the 3D model file. If the judgment condition is met, split the file according to the threshold to obtain multiple smaller files. Step S3: Obfuscate the order of the split files and generate a random key. Use the SM4 block cipher algorithm to encrypt all the files. Step S4: Based on the composite information of multiple parameters, the SM3 hash algorithm is used for implicit mapping to generate a corresponding hash value as the file name for each encrypted small file; Step S5: Define the set of encrypted small files named with all hash values as a new encrypted model data packet.
[0006] As an improvement to the above method, step S2 includes: When it is determined that the GLB format 3D model file to be encrypted is not empty, it is checked whether the file size is not greater than the set threshold of 38Mbyte. If yes, it is not split; otherwise, the 3D model file is split into multiple smaller files according to the fixed size priority strategy with a size of 38Mbyte.
[0007] As an improvement to the above method, step S3 includes: Obtain the number of small files after segmentation, confuse the file arrangement order, and dynamically generate a 32-bit string key. Using the key, encrypt each small file in the confused order sequentially using the SM4 block cipher algorithm, and save the key.
[0008] As an improvement to the above method, the composite information of the multiple parameters in step S4 includes: the order of each small file, the size of each small file, the current system time, and a random string; In step S4, a 64-bit hash value string is generated for each encrypted small file.
[0009] As an improvement to the above method, step S4 further includes: saving a random string.
[0010] As an improvement to the above method, the filename extension of the encrypted small file in step S5 is emodel.
[0011] Secondly, this invention proposes a GLB 3D model decryption method based on national cryptographic algorithms and structural obfuscation, used to decrypt encrypted model data packets obtained by the GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation, including: Step T1: Read the model data packet to be decrypted and obtain the number of files, the size of each file, and the file saving time; Step T2: Based on the random string saved in step S4, combined with the number of files, the size of each file, and the file saving time, the hash value of each file is generated implicitly using the SM3 hash algorithm. By comparing it with the file name of the file, the order of each file in the encrypted model data packet before executing step S3 is restored. Step T3: Decrypt each file using the SM4 block cipher algorithm based on the key saved in step S3; Step T4: Concatenate the decrypted files according to the order determined in step T2 to restore the GLB format 3D model file, and change the file name extension to glb.
[0012] Thirdly, this invention provides a GLB 3D model encryption and decryption system based on national cryptographic algorithms and structural obfuscation, comprising: an encryption module and a decryption module; wherein, the encryption module includes: The file acquisition unit is used to acquire the 3D model file in GLB format to be encrypted; The threshold segmentation unit is used to determine the size of the 3D model file based on a set threshold. When the judgment condition is met, the file is segmented according to the threshold to obtain multiple smaller files. The obfuscation encryption unit is used to obfuscate the order of the split small files and randomly generate a key, and then use the SM4 block cipher algorithm to encrypt all the small files. The mapping naming unit, used for implicit mapping based on complex information with multiple parameters, employs the SM3 hash algorithm to generate a corresponding hash value as the filename for each encrypted small file; and The model encapsulation unit is used to define a new encrypted model data packet as a set of encrypted small files named with all hash values; The decryption module includes: The data packet acquisition unit is used to read the model data packet to be decrypted and obtain the number of files, the size of each file, and the file storage time. The sequence recovery unit is used to implicitly generate the hash value of each file based on the random string stored in the mapping naming unit, combined with the number of files, the size of each file, and the file storage time, using the SM3 hash algorithm. By comparing it with the file name of the file, the order of each file in the model data packet before step S3 is restored. The file decryption unit is used to decrypt each file using the SM4 block cipher algorithm based on the key stored in the obfuscated encryption unit; and File assembly: The decrypted files are assembled according to the order determined by the sequential recovery unit to restore the GLB format 3D model file, and the file name extension is changed to glb.
[0013] Compared with the prior art, the advantages of the present invention are: 1. Double obfuscation: It obfuscates both the data content (encryption) and the file structure and logic (file splitting, shuffling, anonymous naming).
[0014] 2. National Cryptographic Compliance: The entire process uses SM4 and SM3 algorithms to meet the compliance requirements of specific industries.
[0015] 3. Key security: Employs a randomly generated one-time pad mechanism, ensuring high security.
[0016] 4. Systematic Solution: From preprocessing, encryption, anonymization to final encapsulation, a complete, closed, and secure solution is formed.
[0017] 5. Secure Separation: This invention physically or logically separates the encrypted data (.emodel file package) from the metadata required for decryption (key, random number, etc.), achieving separate storage of "data" and "key," which conforms to best security practices. Even if an unauthorized user obtains the data packet, they will be unable to decrypt it due to the lack of metadata. Attached Figure Description
[0018] Figure 1 This is a flowchart of the GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation, as described in this invention. Figure 2 This is a flowchart of a GLB 3D model decryption method based on national cryptographic algorithms and structural obfuscation. Detailed Implementation
[0019] The core of this invention lies in combining fixed-size block segmentation, file logical order obfuscation, and encryption using national cryptographic algorithms to form a multi-layered protection system. By disrupting the continuity and logic of the original file and using hash digests to anonymize filenames, the encrypted model is protected in both the data itself and the file structure.
[0020] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0021] Example 1 like Figure 1 As shown, Embodiment 1 of the present invention proposes a GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation, comprising: 1) Obtain the 3D model file in GLB format. Specifically, by specifying the path to the model file, the model file data is read into the cache, and the model file name is obtained and stored for later decryption.
[0022] 2) Split the 3D model file into multiple smaller files. Specifically, it includes: The process of splitting a 3D model file into multiple smaller files begins by checking if the file is empty. If empty, encryption is unnecessary; otherwise, the file is split. The splitting is based on file size, set to 38MB. First, the file size is checked to see if it exceeds 38MB. If it is, no splitting is needed; otherwise, splitting is required. The first 38MB of the file is saved as a single smaller file, and this process is repeated until the remaining file is less than 38MB, at which point it is saved as a single smaller file. This threshold-based approach balances security and processing efficiency. 3) Encrypt the split files. Specifically, it includes: First, the number of small files is determined. Then, the file order is shuffled. Next, a random 32-character string is set as the key and saved for decryption. Finally, the SM4 symmetric encryption algorithm and the key are used to encrypt all the small files sequentially.
[0023] Disrupting the file order destroys the original sequence of the model data. Even if an attacker decrypts a single file, they cannot obtain the correct file arrangement and therefore cannot reconstruct the original model, greatly increasing the difficulty of cracking and enhancing security. Each encryption uses a unique random key, adhering to the "one-time pad" security principle, effectively preventing mass encryption. The nationally certified SM4 algorithm is employed to ensure encryption strength.
[0024] 4) Encrypt the encrypted file name. Specifically, it includes: First, the system obtains the file order, file size, current system time, and a random string (stored for decryption) of the small files (as per point 4). Then, it creates an implicit mapping using the SM3 algorithm to generate a unique 64-bit hash digest string, which is used as the filename for each small file. This results in filenames that are hash values without any semantic meaning, completely hiding the file content and original structure information. Due to the hash avalanche effect, even a slight change in the input parameters will produce completely different filenames, making it impossible for attackers to guess the relationships or content between files based on the filenames, further enhancing security.
[0025] 5) Save encrypted files Specifically, it includes: First, save the encrypted small file as a file, update the file name to the name of the generated file (4), and finally add the file extension .emodel.
[0026] Example 2 like Figure 2 As shown, Embodiment 2 of this invention proposes a GLB 3D model decryption method based on national cryptographic algorithms and structural obfuscation. A corresponding decryption step is designed, requiring multiple metadata elements such as the original model filename, dynamically generated SM4 key, random strings used for file naming, and a scrambled sequence of file logical order data to correctly parse the .emodel package, restore the file order, and perform decryption and reconstruction. This includes: 1) Obtain the encrypted model file It reads the encrypted model file data into the cache by specifying the path of the encrypted model file, and obtains the number of files, file size, and file retention time.
[0027] 2) Determine the file order by the encrypted file names. Specifically, it includes: First, obtain the number of encrypted files, file size, file save time, and random string used to encrypt folder names in point 9. Then, generate a unique 64-bit digest using the SM3 algorithm. This digest is a 64-bit string. Generate digests for all files. Compare this digest with the file names of the existing encrypted files in sequence to obtain the order of the encrypted files.
[0028] 3) Decrypt the encrypted file. Specifically, this includes: first, sorting the encrypted files according to the file order obtained in point 10, and then using the key value saved during encryption, decrypting all the small files sequentially using the symmetric encryption algorithm SM4.
[0029] 4) Save the decrypted file Specifically, this includes: concatenating the decrypted files sequentially to generate a new GLB model file, and renaming the model file to the original model file saved in point 3, and changing the suffix to .glb.
[0030] Example 3 Embodiment 3 of the present invention provides a GLB 3D model encryption and decryption system based on national cryptographic algorithms and structural obfuscation, comprising: an encryption module and a decryption module; wherein, the encryption module is implemented based on the method of Embodiment 1, and includes: The file acquisition unit is used to acquire the 3D model file in GLB format to be encrypted; The threshold segmentation unit is used to determine the size of the 3D model file based on a set threshold. When the judgment condition is met, the file is segmented according to the threshold to obtain multiple smaller files. The obfuscation encryption unit is used to obfuscate the order of the split small files and randomly generate a key, and then use the SM4 block cipher algorithm to encrypt all the small files. The mapping naming unit is used for implicit mapping based on complex information with multiple parameters, using the SM3 hash algorithm to generate a corresponding hash value as the filename for each encrypted small file; The model encapsulation unit is used to define a new encrypted model data packet as a set of encrypted small files named with all hash values; The decryption module is implemented based on the method of Embodiment 2, including: The data packet acquisition unit is used to read the model data packet to be decrypted and obtain the number of files, the size of each file, and the file storage time. The sequence recovery unit is used to implicitly generate the hash value of each file based on the random string stored in the mapping naming unit, combined with the number of files, the size of each file, and the file storage time, using the SM3 hash algorithm. By comparing it with the file name of the file, the order of each file in the model data packet before step S3 is restored. The file decryption unit is used to decrypt each file using the SM4 block cipher algorithm based on the key stored in the obfuscated encryption unit. File assembly: The decrypted files are assembled according to the order determined by the sequential recovery unit to restore the GLB format 3D model file, and the file name extension is changed to glb.
[0031] It is worth noting that in the embodiments of the above system, the modules included are divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional module are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0032] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation, comprising: Step S1: Obtain the 3D model file in GLB format to be encrypted; Step S2: Based on the set threshold, determine the size of the 3D model file. If the judgment condition is met, split the file according to the threshold to obtain multiple smaller files. Step S3: Obfuscate the order of the split files and generate a random key. Use the SM4 block cipher algorithm to encrypt all the files. Step S4: Based on the composite information of multiple parameters, the SM3 hash algorithm is used for implicit mapping to generate a corresponding hash value as the file name for each encrypted small file; Step S5: Define the set of encrypted small files named with all hash values as a new encrypted model data packet.
2. The GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation as described in claim 1, characterized in that, Step S2 includes: When it is determined that the GLB format 3D model file to be encrypted is not empty, it is checked whether the file size is not greater than the set threshold of 38Mbyte. If yes, it is not split; otherwise, the 3D model file is split into multiple smaller files according to the fixed size priority strategy with a size of 38Mbyte.
3. The GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation as described in claim 1, characterized in that, Step S3 includes: Obtain the number of small files after segmentation, confuse the file arrangement order, and dynamically generate a 32-bit string key. Using the key, encrypt each small file in the confused order sequentially using the SM4 block cipher algorithm, and save the key.
4. The GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation as described in claim 3, characterized in that, The composite information of the multiple parameters in step S4 includes: the order of each small file, the size of each small file, the current system time, and a random string; In step S4, a 64-bit hash value string is generated for each encrypted small file.
5. The GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation as described in claim 4, characterized in that, Step S4 also includes: saving a random string.
6. The GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation as described in claim 1, characterized in that, The encrypted small file in step S5 has the filename extension .emodel.
7. A method for decrypting GLB 3D models based on national cryptographic algorithms and structural obfuscation, characterized in that, Decryption of the encrypted model data packet obtained by the GLB 3D model encryption method based on national cryptographic algorithms and structural obfuscation as described in claim 6 includes: Step T1: Read the model data packet to be decrypted and obtain the number of files, the size of each file, and the file saving time; Step T2: Based on the random string saved in step S4, combined with the number of files, the size of each file, and the file saving time, the hash value of each file is generated implicitly using the SM3 hash algorithm. By comparing it with the file name of the file, the order of each file in the encrypted model data packet before executing step S3 is restored. Step T3: Decrypt each file using the SM4 block cipher algorithm based on the key saved in step S3; Step T4: Concatenate the decrypted files according to the order determined in step T2 to restore the GLB format 3D model file, and change the file name extension to glb.
8. A GLB 3D model encryption and decryption system based on national cryptographic algorithms and structural obfuscation, characterized in that, include: An encryption module and a decryption module; wherein the encryption module includes: The file acquisition unit is used to acquire the 3D model file in GLB format to be encrypted; The threshold segmentation unit is used to determine the size of the 3D model file based on a set threshold. When the judgment condition is met, the file is segmented according to the threshold to obtain multiple smaller files. The obfuscation encryption unit is used to obfuscate the order of the split small files and randomly generate a key, and then use the SM4 block cipher algorithm to encrypt all the small files. The mapping naming unit, used for implicit mapping based on complex information with multiple parameters, employs the SM3 hash algorithm to generate a corresponding hash value as the filename for each encrypted small file; and The model encapsulation unit is used to define a new encrypted model data packet as a set of encrypted small files named with all hash values; The decryption module includes: The data packet acquisition unit is used to read the model data packet to be decrypted and obtain the number of files, the size of each file, and the file storage time. The sequence recovery unit is used to implicitly generate the hash value of each file based on the random string stored in the mapping naming unit, combined with the number of files, the size of each file, and the file storage time, using the SM3 hash algorithm. By comparing it with the file name of the file, the order of each file in the model data packet before step S3 is restored. The file decryption unit is used to decrypt each file using the SM4 block cipher algorithm based on the key stored in the obfuscated encryption unit; and File assembly: The decrypted files are assembled according to the order determined by the sequential recovery unit to restore the GLB format 3D model file, and the file name extension is changed to glb.