Decryption and encryption processing method of secondary development script, electronic device and medium

By encrypting the secondary development scripts of the EDA tool and setting a decryption loader inside the tool, and using hook functions and local keys for decryption, the security issues of the script during loading and execution are solved, and the protection and integrity of sensitive information are achieved.

CN122310489APending Publication Date: 2026-06-30BEIJING NORI INTEGRATED CIRCUIT DESIGN CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-06
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In the secondary development scripts of EDA tools, existing technologies cannot prevent the leakage and tampering of sensitive information while ensuring the normal loading and execution of the scripts.

Method used

The secondary development script is encrypted using an encryption algorithm to generate a script ciphertext data block. A decryption loader is set up inside the EDA tool to intercept script import requests through a hook function and decrypt the script using a local key.

Benefits of technology

This allows for normal loading and execution within EDA tools while preventing the leakage and tampering of sensitive information in secondary development scripts, thus improving script security and integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122310489A_ABST
    Figure CN122310489A_ABST
Patent Text Reader

Abstract

This invention relates to the field of electronic design automation (EDA) technology, and more particularly to a method, electronic device, and medium for encrypting and decrypting secondary development scripts. The method includes: S1, acquiring the secondary development script from an EDA tool and encrypting it to generate a script ciphertext data block; S2, packaging the script ciphertext data block, encryption algorithm identifier, and initialization vector into an encrypted script file; S3, setting a decryption loader within the EDA tool, including a hook function, and storing the decryption key locally within the EDA tool; S4, receiving a script import request, and the decryption loader intercepting the script import request by calling the hook function; S5, the decryption loader reading and identifying the script file in the import request, and if it is an encrypted script file, obtaining the decryption key and decrypting the encrypted script file to restore the secondary development script. This invention improves the security of secondary development scripts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Electronic Design Automation (EDA) technology, and in particular to a method for encrypting and decrypting secondary development scripts, electronic devices, and media. Background Technology

[0002] In the process of secondary development of EDA tools, core algorithms, proprietary logic, or sensitive code interacting with internal systems are often written in secondary development scripts. If these scripts are distributed and loaded in plaintext, there is a risk of sensitive information leakage and script tampering. If they are directly encrypted, they will fail to load and execute properly in the EDA tool. Therefore, how to prevent source code leakage and tampering while ensuring that the scripts can be loaded and executed normally in the EDA tool, and thus improve the security of secondary development scripts, has become an urgent technical problem to be solved. Summary of the Invention

[0003] The purpose of this invention is to provide a method, electronic device, and medium for encrypting and decrypting secondary development scripts, thereby improving the security of secondary development scripts.

[0004] According to a first aspect of the present invention, a method for encryption and decryption processing of a secondary development script is provided, comprising: Step S1: Obtain the secondary development script of the EDA tool and encrypt it using an encryption algorithm to generate script ciphertext data blocks; Step S2: Package the script ciphertext data block, the encryption algorithm identifier used by the encrypted secondary development script, and the initialization vector to generate an encrypted script file; Step S3: Set up a decryption loader inside the EDA tool, set up a hook function in the decryption loader, and store the key required for decryption locally in the EDA tool; Step S4: Receive a script import request; the decryption loader calls a hook function to intercept the script import request. Step S5: The decryption loader reads and identifies the script file in the script import request. If it is an encrypted script file, it obtains the decryption key from the local EDA tool to decrypt the encrypted script file and restore the secondary development script.

[0005] According to a second aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in the first aspect of the present invention.

[0006] According to a third aspect of the present invention, a computer-readable storage medium is provided, storing computer-executable instructions for performing the method described in the first aspect of the present invention.

[0007] Compared with existing technologies, this invention has significant advantages and beneficial effects. Through the above technical solution, the encryption / decryption processing method, electronic device, and medium for secondary development scripts provided by this invention achieve considerable technological advancement and practicality, and have broad industrial application value. It possesses at least the following beneficial effects: This invention encrypts the secondary development scripts of EDA tools and sets up a decryption loader within the EDA tool. The decryption loader includes a hook function, and the decryption key is stored locally within the EDA tool. When a script import request is received, the hook function is invoked to intercept the request. If the request is determined to be an encrypted script file, the decryption key is retrieved from the EDA tool's local storage to decrypt the encrypted file. This invention improves the security of secondary development scripts by preventing source code leakage and tampering while ensuring the script can be loaded and executed correctly in the schematic tool. Attached Figure Description

[0008] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0009] Figure 1 A flowchart illustrating the encryption and decryption processing method for a secondary development script provided in this embodiment of the invention. Detailed Implementation

[0010] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0011] This invention provides a method for encrypting and decrypting secondary development scripts, such as... Figure 1 As shown, it includes: Step S1: Obtain the secondary development script of the EDA tool and encrypt it using an encryption algorithm to generate script ciphertext data blocks.

[0012] It should be noted that secondary development scripts refer to external script programs not included by the EDA tool itself, written based on the extension interfaces provided by the EDA tool to enhance or extend the functionality of the EDA tool. Specifically, the secondary development script can be a Python script. Python, as an interpreted, cross-platform, and concise high-level scripting language, has advantages such as high development efficiency, a rich ecosystem, and easy embedding and integration; it also supports custom import hooks, enabling secure loading and execution of encrypted scripts, effectively improving the security and extensibility of the secondary development script. The EDA tool can specifically be a schematic design tool. The preset encryption algorithm can specifically be a symmetric encryption algorithm or an asymmetric encryption algorithm. One or more encryption algorithms can be used to encrypt the secondary development script of the EDA tool. Symmetric encryption algorithms include AES, DES, 3DES, etc. Asymmetric encryption algorithms include RSA, ECC, etc. In this embodiment of the invention, a symmetric encryption algorithm can be preferred. By employing a symmetric encryption algorithm that is efficient at runtime and directly compiling it into bytecode for execution after decryption, the execution efficiency of the secondary development script is not significantly affected, thus ensuring runtime performance.

[0013] Step S2: Package the script ciphertext data block, the encryption algorithm identifier used by the encrypted secondary development script, and the initialization vector to generate a script encryption file.

[0014] It should be noted that the encryption process prevents sensitive information, such as API keys and connection strings, from appearing in plaintext in the secondary development script, thus reducing the risk of sensitive information leakage. Furthermore, any unauthorized modification to the encrypted script file will result in decryption failure or execution errors, thereby ensuring the integrity and reliability of the secondary development script.

[0015] Step S3: Set up a decryption loader inside the EDA tool, set up hook functions in the decryption loader, and store the key required for decryption locally in the EDA tool.

[0016] Specifically, the decryption loader can be installed either pre-installed or as a plugin. If the secondary development script is specifically set to a Python script, then the decryption loader is a Python decryption loader, which internally sets up automatic Python import hooks to form hook functions.

[0017] Step S4: Receive a script import request. The decryption loader calls a hook function to intercept the script import request.

[0018] Specifically, script import requests can be generated directly in EDA tools or through command-line calls.

[0019] Step S5: The decryption loader reads and identifies the script file in the script import request. If it is an encrypted script file, it obtains the decryption key from the local EDA tool to decrypt the encrypted script file and restore the secondary development script.

[0020] It should be noted that the embodiments of the present invention perform high-strength encryption on the secondary development script before distribution, and use a decryption loader integrated within the EDA tool to decrypt and execute the script in real time when it is invoked, thus transparently completing the entire protection process for the secondary development script to the user. The entire implementation process is completely transparent to the user; the user only needs to import and run the script without needing to worry about the underlying encryption and decryption details.

[0021] As one embodiment, step S1 includes: Step S11: Obtain the secondary development script of the EDA tool and test it. After the test is passed, proceed to step S12.

[0022] Specifically, this involves obtaining the plaintext of the secondary development script for the EDA tool and testing it.

[0023] Step S12: Based on the pre-generated key, use a preset encryption algorithm to encrypt the preset functions and preset classes in the secondary development script, or encrypt the entire secondary development script to generate a script ciphertext data block.

[0024] It is understandable that encryption of the secondary development script can be done by encrypting the entire script or by encrypting only the preset functions and classes within the script, depending on the specific application requirements.

[0025] As one embodiment, in step S3, storing the key required for decryption locally on the EDA tool includes: Step S31: Bind the key required for decryption to the license file of the EDA tool and store it, or store the key required for decryption in an encrypted configuration file on the local machine of the EDA tool, or store it on the license server and dynamically obtain it from the license server and store it on the local machine of the EDA tool when it is used for the first time.

[0026] By binding and storing the decryption key with the EDA tool's license file, only authorized users can obtain the correct decryption key to run secondary development scripts.

[0027] As one embodiment, step S5 further includes: Step S51: The decryption loader reads and identifies the script file of the script import request. If the extension is a preset encrypted extension, then step S52 is executed; otherwise, step S54 is executed.

[0028] The preset encrypted extension can be either a magic number in the file header or a specific extension.

[0029] Step S52: Determine that the script file in the script import request is an encrypted script file, and determine whether the user who initiated the decryption loader to read the script import request has decryption permission. If so, proceed to step S53; otherwise, proceed to step S54.

[0030] Specifically, decryption permissions and the time range within which decryption permissions are granted can be set for each user ID. If a user ID has decryption permissions and is within the valid time range, then the user is determined to have decryption permissions.

[0031] Step S53: Obtain the decryption key from the EDA tool locally, decrypt the encrypted script file, restore the secondary development script, and end the process.

[0032] Step S54: Determine that the script file in the script import request is an unencrypted script collection, and directly read the script file in the script import request.

[0033] As one embodiment, the step S5 is followed by: Step S6: The decryption loader compiles the restored secondary development script into preset bytecode and loads it into the preset code interpreter in the EDA tool for execution. After execution, the plaintext code and key are decrypted from memory.

[0034] Wherein, if the secondary development script is a Python script, then the preset bytecode is Python bytecode, and the preset code interpreter is a Python interpreter. The encryption / decryption processing method for the secondary development script described in this embodiment of the invention can be applied in multiple application scenarios. For example, a secondary development script can be generated based on the encryption / decryption processing method, and a bridge for dynamically integrating EDA tools and cloud-based device libraries can be generated based on the secondary development script, enabling real-time interaction between EDA tools and cloud-based device libraries. Taking EDA tools as schematic design tools as an example, this embodiment of the invention further provides a method for dynamically integrating schematic tools and cloud-based device libraries, including: Step E1: Build a bridge in the schematic design tool, which can interconnect with at least one cloud device library; Among them, the schematic design tool is used to complete the placement of component symbols, drawing of electrical connection relationships, definition of signal networks and checking of electrical rules in a graphical way, and can output standardized netlist files, providing basic design data for subsequent printed circuit board (PCB) layout and routing, circuit simulation and hardware implementation.

[0035] As an example, the bridge is built based on a secondary development script of a schematic design tool. Specifically, the secondary development script can be an encrypted / decrypted Python script, and the bridge is a Python bridge. The bridge has network communication capabilities, and protocol adapters for interfacing with multiple cloud-based device libraries can be pre-configured within it.

[0036] Step E2: When a preset device operation command is generated in the schematic design tool, the bridge intercepts the preset device operation command.

[0037] Specifically, the preset device operation commands can include device placement commands, device attribute query commands, etc.

[0038] Step E3: The bridge extracts device parameters from the preset device operation instructions and automatically performs a device query operation in the corresponding cloud device library based on the extracted device parameters.

[0039] Step E4: The bridge obtains the device query results from the cloud device library.

[0040] As one embodiment, step E1 includes: Step E11: Build the bridge in the schematic design tool.

[0041] Step E12: The bridge is equipped with a communication module with network communication capabilities.

[0042] Step E13: The bridge is configured with a protocol adapter capable of interfacing with the API of at least one cloud device library.

[0043] Step E14: The bridge interconnects with at least one cloud device library through the communication module and protocol adapter.

[0044] The bridge interconnects with the cloud-based device library through a communication module and a protocol adapter, enabling dynamic integration between the schematic tool and the cloud-based device library.

[0045] As one embodiment, step E3 includes: Step E31: The bridge extracts device parameters from the preset device operation instructions. The device parameters include the target device model and the target device manufacturing identification information.

[0046] Step E32: Determine the corresponding target cloud device library based on the extracted target device manufacturing identification information.

[0047] It should be noted that there is a correspondence between the device manufacturing identifier and the cloud-based device library. Preferably, one device manufacturing identifier corresponds to one cloud-based device library.

[0048] Step E33: The bridge calls the query API of the target cloud device library based on the extracted device model to query the attribute information corresponding to the target device model in the target cloud device library.

[0049] As one embodiment, step E4 includes: Step E41: The bridge obtains the original attribute information corresponding to the target device model from the target cloud device library. The original attribute information is in JSON or XML format.

[0050] Step E42: Convert the original attribute information corresponding to the target device model into a format that the schematic tool can recognize.

[0051] Specifically, the original attribute information can be parsed, cleaned, and standardized to convert it into a format that schematic tools can recognize.

[0052] Step E43: Present the original attribute information of the target device model in the display interface in a preset display format according to the format that the schematic tool can recognize.

[0053] The preset display formats include property panel display format, floating information box display format, etc.

[0054] As one embodiment, the bridge also includes a device replacement interface. If the preset device operation command is a device placement command, then after step E4, the following steps are also included: Step E5: Determine whether the current device can be placed based on the device query results. If not, proceed to step E6; if so, proceed to step E7.

[0055] Specifically, the rationality of device placement can be determined by assessing whether the remaining quantity of materials meets the demand and whether the material price information meets the demand.

[0056] Step E6: Call the device replacement interface to replace the current device with the target replacement device, place the target replacement device in the schematic tool, and end the process.

[0057] Step E7: Place the current device in the schematic tool and end the process.

[0058] As one embodiment, the bridge also includes an attribute update interface. If the preset device operation command is a device attribute query command, then after step E4, the following steps are also included: Step C5: Based on the device query results, determine whether the attributes of the queried devices are consistent with those in the local device library of the schematic tool. If they are inconsistent, proceed to step C6. If they are consistent, end the process.

[0059] Step C6: Call the attribute update interface to update the queried device attributes to the local device library of the schematic tool, and end the process.

[0060] It should be noted that by using steps C5-C6, the component attribute information in the cloud component library can be updated to the local component library of the schematic tool in real time.

[0061] This invention encrypts the secondary development scripts of an EDA tool and sets up a decryption loader within the EDA tool. The decryption loader includes a hook function, and the decryption key is stored locally on the EDA tool. When a script import request is received, the hook function is invoked to intercept the request. If the file is determined to be an encrypted script, the decryption key is retrieved from the EDA tool to decrypt the file. Furthermore, this invention builds a bridge in the schematic design tool based on the encryption / decryption processing secondary development scripts. The schematic design tool can communicate with at least one cloud-based device library. During schematic design in the schematic design tool, device information from the cloud-based device library can be obtained in real time, improving the efficiency and accuracy of schematic design.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0063] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. A process can be terminated when its operation is complete, but it may also have additional steps not included in the figures. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.

[0064] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in this invention.

[0065] This invention also provides a computer-readable storage medium storing computer-executable instructions for performing the methods described in this invention.

[0066] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for encryption and decryption processing of a secondary development script, characterized in that, include: Step S1: Obtain the secondary development script of the EDA tool and encrypt it using an encryption algorithm to generate script ciphertext data blocks; Step S2: Package the script ciphertext data block, the encryption algorithm identifier used by the encrypted secondary development script, and the initialization vector to generate an encrypted script file; Step S3: Set up a decryption loader inside the EDA tool, set up a hook function in the decryption loader, and store the key required for decryption locally in the EDA tool; Step S4: Receive a script import request; the decryption loader calls a hook function to intercept the script import request. Step S5: The decryption loader reads and identifies the script file in the script import request. If it is an encrypted script file, it obtains the decryption key from the local EDA tool to decrypt the encrypted script file and restore the secondary development script.

2. The method according to claim 1, characterized in that, Step S1 includes: Step S11: Obtain the secondary development script of the EDA tool and test it. After the test is passed, proceed to step S12. Step S12: Based on the pre-generated key, use a preset encryption algorithm to encrypt the preset functions and preset classes in the secondary development script, or encrypt the entire secondary development script to generate a script ciphertext data block.

3. The method according to claim 1, characterized in that, In step S3, storing the key required for decryption locally on the EDA tool includes: Step S31: Bind the key required for decryption to the license file of the EDA tool and store it, or store the key required for decryption in an encrypted configuration file on the local machine of the EDA tool, or store it on the license server and dynamically obtain it from the license server and store it on the local machine of the EDA tool when it is used for the first time.

4. The method according to claim 1, characterized in that, Step S5 further includes: Step S51: The decryption loader reads and identifies the script file of the script import request. If the extension is a preset encrypted extension, then step S52 is executed; otherwise, step S54 is executed. Step S52: Determine that the script file in the script import request is an encrypted script file, and determine whether the user who initiated the decryption loader to read the script import request has decryption permission. If so, proceed to step S53; otherwise, proceed to step S54. Step S53: Obtain the decryption key from the EDA tool locally, decrypt the encrypted script file, restore the secondary development script, and end the process; Step S54: Determine that the script file in the script import request is an unencrypted script collection, and directly read the script file in the script import request.

5. The method according to claim 1, characterized in that, Following step S5, the following is also included: Step S6: The decryption loader compiles the restored secondary development script into preset bytecode and loads it into the preset code interpreter in the EDA tool for execution. After execution, the plaintext code and key are decrypted from memory.

6. The method according to claim 1, characterized in that, The secondary development script is a Python script, the preset bytecode is Python bytecode, and the preset code interpreter is a Python interpreter.

7. The method according to claim 1, characterized in that, The EDA tool mentioned is a schematic design tool.

8. The method according to claim 1, characterized in that, The preset encryption algorithm is either a symmetric encryption algorithm or an asymmetric encryption algorithm.

9. An electronic device, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that are executed by the at least one processor, the instructions being configured to perform the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The device stores computer-executable instructions for performing the method as described in any one of claims 1-8.