A three-dimensional model encryption method based on GLB format
By performing binary compression, parsing, encryption, and custom format processing on GLB format 3D models, and generating encrypted files with custom suffixes, the risk of model theft in existing technologies is resolved, and secure transmission and copyright protection of model data are achieved.
Patent Information
- Application Number
- CN202211440740.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-11-17
AI Technical Summary
Existing 3D model encryption methods are at risk of being stolen during transmission, especially when using the GLB format. Browsers can directly request and parse the model, model editing software can edit and modify it, and server-side permission verification only applies to the client system, not the model itself.
By performing binary compression, initial parsing, encryption, and custom format processing on the GLB format 3D model, an encrypted file with a custom suffix is generated. This file can only be parsed by a client program with a decryption algorithm, preventing the model from being copied, parsed, and modified at will.
It effectively protects the copyrights of creators and businesses, reduces the risk of model theft, improves file security, and eliminates the hassle of program permission verification.
Smart Images

Figure CN115688180B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a three-dimensional model encryption method, in particular to a three-dimensional model encryption method based on a GLB format, and belongs to the technical field of three-dimensional models. BACKGROUND
[0002] In recent years, with the increasing maturity of three-dimensional digital twin technology, the application scenarios of three-dimensional models in the browser end are becoming more and more extensive. The open-source glTF has become a recognized data standard in the Web three-dimensional industry, and is used to describe and store models and materials, animation data, skeletons, skinning, scene hierarchy and lights. GLB is a binary file format used to store the components of glTF (JSON,.bin and pictures), and also avoids the problem of using glTF format files that become larger. Through compression, GLB can be loaded faster, provide complete three-dimensional scenes, and be extended in future development. When transmitted on the Web end, the model can be directly obtained by the client, which is easy to cause plagiarism or theft. The glTF is a graphic language interchange format, which is a format standard for 3D content, and is used for real-time rendering applications. GLB is a binary file format for storing 3D models in the GL transmission format (glTF). Python is a cross-platform computer program design language, which is an alternative to the ABC language and belongs to an object-oriented dynamic type language. JSON is a lightweight data exchange format independent of language and platform.
[0003] There are usually three ways to encrypt and transmit the existing glTF standard model: 1. using the original glTF format, which can be directly requested and parsed by the browser, 2. using the compressed GLB format, which is completely unencrypted and can be directly requested and parsed by the browser, and 3. adding permission verification on the server side, which can be directly requested and parsed after verification.
[0004] However, when using the original glTF format for transmission, the JSON data is in plaintext, and the picture materials are original files, which can be directly requested and used by the browser without obstacles, and the risk of theft is extremely high. When using the compressed GLB format, the browser can use software supporting the GLB format to view and edit the model without obstacles, and the risk of theft is high. The permission verification on the server side is only for the client system user, not for the model itself, and the user can freely use and modify the model after downloading, which has a risk of theft.
[0005] Therefore, a three-dimensional model encryption method based on the GLB format is proposed to help solve the above problems. SUMMARY
[0006] The purpose of the present application is to provide a three-dimensional model encryption method based on GLB format, which can compress the model in binary for gLTF format standard, encrypt the file by modifying the header information, generate a new file with a custom suffix, and encrypt the file data to avoid the risk of random copying, parsing, modifying and secondary use of the data obtained by the client.
[0007] The present application realizes the above-mentioned purpose through the following technical solutions, a three-dimensional model encryption method based on GLB format, comprising a gLTF compression module, an initial analysis module, an encryption module, a custom module and a decryption module, specifically comprising:
[0008] S1, gLTF compression module: binary compression of the read gLTF format file;
[0009] S2, initial analysis module: analysis of the file compressed by the gLTF compression module;
[0010] S3, encryption module: copyright owner encrypts the parsed file;
[0011] S4, custom module: custom format for the encrypted file;
[0012] S5, decryption module: decrypt the custom format file.
[0013] Further, the binary compression work of step S1 specifically includes: binary compression of the gLTF format file through 3dMax, blender modeling software or gLTF-pipeline conversion tool, outputting a file with.GLB suffix, binary compression of the read gLTF format file, integrating the file into one, smaller in size, easier to handle and transmit.
[0014] Further, the analysis work of step S2 specifically includes: reading the GLB file using Python, parsing it into a string, intercepting the header gLTF JSON string part, converting it to a general JSON format, parsing the file through the initial analysis module, facilitating subsequent encryption work, encrypting the model itself at the file data level, and protecting the labor achievements of the creators and the copyright of the enterprise.
[0015] Further, the encryption work of step S3 specifically includes: rewriting the secondary key value generator of the parsed JSON to a copyright owner's custom encryption identifier, such as encryption, and then traversing the group number under the primary key bufferViews to combine the values of the three keys buffer, byteOffset, and byteLength in sequence with underscores to form a new string, and assigning the key bufferByte, and setting all original three values to zero. Only the program with the copyright owner's custom encryption identifier decryption algorithm can parse it, and the model itself is encrypted at the file data level, protecting the creator's labor achievements and the enterprise's copyright.
[0016] Further, the custom work of step S4 specifically includes: converting the new JSON format object to a string to replace the glTF JSON string of the source file, and saving the binary file as a new file with a custom suffix, such as.ept, to create an encrypted model file through a custom module. It can be normally requested and transmitted like a normal GLB file, but cannot be loaded and parsed by regular programs and software, avoiding the risk of being stolen and modified.
[0017] Further, the decryption work of step S5 specifically includes: after the user requests the custom encrypted file, it can be parsed into a general binary string content, and the header glTF JSON string part is extracted and converted into a general JSON format. First, determine whether the secondary key value generator is the custom encryption identifier encryption. If not, parse and render it as a normal GLB file. If so, traverse the group number under the primary key bufferViews, extract the bufferByte value, and separate it with underscores. Convert the obtained three strings to Int type numbers and assign them to the three keys buffer, byteOffset, and byteLength, respectively. Then delete the bufferByte key value pair. Finally, convert the restored JSON format object to a string to replace the glTF JSON part of the binary string, obtain the restored model data, and hand it over to the program for parsing and rendering. Only the program with the decryption algorithm can parse it, and the model itself is encrypted at the file data level, avoiding the risk of being randomly copied, parsed, modified, and reused by the user after the client requests the model file. It is of great significance to the security of web-side transmitted model data, effectively protecting the creator's labor achievements and the enterprise's copyright, and at the same time, it saves the trouble of checking the program permissions.
[0018] Further, the encrypted model file can be normally requested and transmitted like a normal GLB file, but cannot be loaded and parsed by a regular program and software, avoiding the risk of being stolen and modified, and improving the security performance of the file.
[0019] Further, the binary file parsing encryption step in step S2 can be completed by Java, C++, or other programs, and the encrypted file suffix in step S4 can be freely defined, thereby increasing the selectivity of binary file parsing encryption by Java, C++, or other programs, improving the encryption effect, and improving the randomness of the file by freely defining the encrypted file suffix, thereby improving the encryption effect.
[0020] Technical effects and advantages of the present application:
[0021] 1. The present application compresses the model in binary by targeting the glTF format standard, converts it into a more secure and easily transmitted GLB format, makes the transmitted model file more compact, does not expose the original resources such as JSON and pictures, reduces the request frequency and file size, and is easy to transmit.
[0022] 2. The present application encrypts the file header information to generate a new file with a custom suffix, which can only be parsed by a program with a decryption algorithm on the client side, encrypts the model itself at the file data level, avoids the risk of users randomly copying, parsing, modifying, and reusing the model file after requesting it from the client, has important significance for the security of web-side model data transmission, effectively protects the labor achievements of creators and the copyrights of enterprises, and eliminates the trouble of program permission verification. BRIEF DESCRIPTION OF DRAWINGS
[0023] Fig. 1 is a basic flowchart of the present application;
[0024] Fig. 2 is a format conversion diagram in step S3 of the present application;
[0025] Fig. 3 is a whole flowchart of the present application; DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0027] Please refer to Figs. 1-3As shown, a three-dimensional model encryption method based on GLB format includes a glTF compression module, an initial analysis module, an encryption module, a custom module, and a decryption module, and specifically includes:
[0028] S1, glTF compression module: binary compression of the read glTF format file;
[0029] S2, initial analysis module: analyze the file compressed by the glTF compression module;
[0030] S3, encryption module: copyright owner encrypts the parsed file;
[0031] S4, custom module: custom format for the encrypted file;
[0032] S5, decryption module: decrypt the custom format file.
[0033] The binary compression work of step S1 specifically includes: through 3dMax, blender and other modeling software, or gltf-pipeline and other conversion tools, the glTF format file is binary compressed, and the file with suffix.GLB is output. By standardizing the glTF format, the model is binary compressed into a more secure and easy-to-transfer GLB format, making the transmitted model file more compact, not exposing JSON and image original resources, reducing request frequency and file size, and easy to transfer.
[0034] The analysis work of step S2 specifically includes: using Python to read the GLB file, parsing it into a string, intercepting the head glTF JSON string part, and converting it into a general JSON format,
[0035] The encryption work of step S3 specifically includes: rewriting the secondary key value generator to the copyright owner's custom encryption identifier, such as encryption, and then iterating the group number under the primary key bufferViews, combining the values of buffer, byteOffset, and byteLength in the order of three keys, connecting them with underscores to form a new string, and assigning the key bufferByte, all original three values are set to zero.
[0036] The custom work of step S4 specifically includes: converting the new JSON format object into a string to replace the glTF JSON string of the source file, and saving the binary file as a new file with a custom suffix, such as.ept.
[0037] The decryption of step S5 specifically includes: after the user requests the custom encrypted file, the binary string content can be parsed into a general binary string content, the header g l TF JSON string part is extracted, converted into a general JSON format, and the secondary key value generator is first judged to be a custom encryption identifier encryption. If not, parse and render the normal GLB file, if yes, traverse the group number under the first key bufferViews, extract the bufferByte value, separate it with an underscore, convert the obtained three strings into Int type numbers, respectively assign them to the buffer, byteOffset, byteLength three keys, and delete the bufferByte key value pair. Finally, the restored JSON format object is converted into a string to replace the g l TF JSON part of the binary string, obtain the restored model data, and hand it over to the program for parsing and rendering. By modifying the file header information, the model is encrypted to generate a new file with a custom suffix. This file can only be parsed by the client program with the decryption algorithm. The model itself is encrypted at the file data level, avoiding the risk of users randomly copying, parsing, modifying and secondary use after requesting the model file. It is of great significance to the security of Web-side transmission model data, effectively protecting the labor achievements of the creators and the copyright of the enterprise, and at the same time, it saves the trouble of checking the program permission.
[0038] The encrypted model file can be normally requested and transmitted like a normal GLB file, but cannot be loaded and parsed by regular programs and software, avoiding the risk of being stolen and modified, improving the security performance of the file. The binary file parsing encryption step in step S2 can be completed by Java, C++ and other programs. The encrypted file suffix in step S4 can be freely defined, the selectivity of binary file parsing encryption can be increased by Java, C++ and other programs, the encryption effect is improved, the randomness of the file is improved by freely defining the suffix of the encrypted file, and the encryption effect is improved.
[0039] First read the g l TF format file, through 3dMax, b l ender and other modeling software, or g l tf-p i pel i ne and other conversion tools to compress the g l TF format file in binary, output the file with the suffix. GLB, make the file integrated, smaller volume, more conducive to processing and transmission, then use Python to read the GLB file, parse it into a string, intercept the head g l TF JSON string part, convert it to a general JSON format, other programs such as Java, C++ can also be used to complete, increase the optional encryption of binary file parsing, improve the encryption effect, for the parsed JSON, first rewrite the secondary key value generator to the encryption identifier customized by the copyright owner, such as encrypt i on, and then traverse the group number under the primary key bufferVi ews, combine the values of buffer, byteOffset and byteLength in the order of three keys with underscores to form a new string, and assign the key bufferByte, all the original three values are zero, the format conversion is as follows Fig. 2As shown, the model itself is encrypted at the file data level, protecting the creator's work and the enterprise's copyright, the new JSON format object is converted into a string to replace the source file's glTF JSON string, the binary file is saved as a new file with a custom suffix such as.ept, and the encrypted model file is created. This model file can be normally requested and transmitted like a normal GLB file, but cannot be loaded and parsed by regular programs and software, avoiding the risk of being stolen and modified. The encrypted file suffix is freely defined to improve the randomness of the file and improve the encryption effect. Then it is transmitted to the Web end. After the user requests the custom encrypted file on the Web end, it can be parsed into a general binary string content, the header glTF JSON string part is extracted and converted into a general JSON format. When decrypting, first determine whether the secondary key value generator is the custom encryption identifier encryption. If not, parse and render it as a normal GLB file. If so, traverse the group number under the primary key bufferViews, extract the bufferByte value, separate it with an underscore, convert the three obtained strings into Int type numbers, assign them to the buffer, byteOffset, and byteLength keys respectively, and delete the bufferByte key value pair. Finally, the restored JSON format object is converted into a string to replace the glTF JSON part of the binary string, and the restored model data is obtained and handed over to the program for parsing and rendering. The encrypted file can only be parsed by the client-side program with the decryption algorithm. Encrypting the model itself at the file data level avoids the risk of users randomly copying, parsing, modifying, and reusing the model file after requesting it from the client. It is of great significance to the security of Web-end transmitted model data, effectively protecting the creator's work and the enterprise's copyright, and eliminating the hassle of program permission verification.
[0040] It will be obvious to a person skilled in the art that the application is not limited to the details of the above-described exemplary embodiments, but can be implemented in other concrete forms without departing from the spirit or essential characteristics of the application. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the application is defined by the appended claims rather than the above description, and it is intended to encompass all variations falling within the meaning and scope of the equivalent elements of the claims. Any reference signs in the claims should not be considered as limiting the claims to which they relate.
[0041] Furthermore, it should be understood that although the specification is described in terms of embodiments, not every embodiment includes every feature described. The specification can include implicit combinations of explicitly mentioned features and / or explicit combinations of implicitely mentioned features. Each embodiment depends on the explicit combinations of features and / or the implicit combinations of features made specifically within that embodiment, and each such embodiment can be combined with every other such embodiment to create further embodiments.
Claims
1. A method for encrypting a three-dimensional model based on a GLB format, comprising a glTF compression module, a preliminary analysis module, an encryption module, a custom module and a decryption module, characterized in that: Specifically comprises: S1, glTF compression module: binary compression of the read glTF format file; S2, initial analysis module: the file compressed by the glTF compression module is parsed; S3, encryption module: the copyright owner encrypts the parsed file; the encryption work of step S3 specifically includes: rewriting the secondary key value generator to the encryption identifier defined by the copyright owner, and then traversing the group number under the first key bufferView, combining the values of buffer, byteOffset and byteLength in the order of three keys to form a new string connected by underscores, and assigning the key bufferByte, and all the original three values are set to zero; S4, custom module: custom format of the encrypted file; S5, decryption module: decrypt the custom format file; The decryption work of step S5 specifically includes: after the user requests the custom encrypted file, it is parsed into a general binary string content, the glTF JSON string part of the header is extracted and converted into a general JSON format, first determine whether the secondary key value generator is the custom encryption identifier encryption, if not, parse and render the normal GLB file, if yes, traverse the group number under the first key bufferView, extract the bufferByte value, separate the three strings obtained by underscores, convert them into Int type numbers, and assign them to the buffer, byteOffset and byteLength keys respectively, and delete the bufferByte key value pair, finally, convert the restored JSON format object into a string to replace the glTF JSON part of the binary string, obtain the restored model data, and hand it over to the program for parsing and rendering.
2. The GLB format-based three-dimensional model encryption method according to claim 1, characterized in that: The binary compression work of step S1 specifically includes: through 3dMax, blender modeling software, or gltf-pipeline conversion tool, the glTF format file is binary compressed, and the file with.GLB suffix is output.
3. The method of claim 1, wherein the GLB format-based three-dimensional model encryption method is characterized by: The parsing work of step S2 specifically includes: using Python to read the GLB file, parse it into a string, extract the glTF JSON string part of the header, and convert it into a general JSON format.
4. The method of claim 1, wherein the GLB format-based three-dimensional model encryption method is characterized by: The custom work of step S4 specifically includes: converting the new JSON format object into a string to replace the glTF JSON string of the source file, and saving the binary file as a new file with a custom suffix.
5. The method of claim 1, wherein the GLB format-based three-dimensional model encryption method is characterized by: The encrypted model file can be normally requested and transmitted like a normal GLB file, but cannot be loaded and parsed by conventional programs and software.
6. The method of claim 1, wherein the GLB format-based three-dimensional model encryption method is characterized by: The binary file parsing encryption step in step S2 is completed using Java and C++.
Citation Information
Patent Citations
Anti-counterfeiting processing method and device for three-dimensional model file with suffix in 3ds format
CN105512522A
3D file encryption method
CN105930743A
Method for rendering large-scale industrial three-dimensional model
CN113628321A
Three-dimensional data storage method and device, equipment and storage medium
CN114168530A