CN111400675A - Object obfuscation method, device, electronic equipment and computer readable medium - Google Patents

Object obfuscation method, device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN111400675A
CN111400675A CN202010179968.0A CN202010179968A CN111400675A CN 111400675 A CN111400675 A CN 111400675A CN 202010179968 A CN202010179968 A CN 202010179968A CN 111400675 A CN111400675 A CN 111400675A
Authority
CN
China
Prior art keywords
code
converted
processed
target
keys
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010179968.0A
Other languages
Chinese (zh)
Inventor
郭嵩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tongdun Guangzhou Technology Co ltd
Original Assignee
Tongdun Guangzhou Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tongdun Guangzhou Technology Co ltd filed Critical Tongdun Guangzhou Technology Co ltd
Priority to CN202010179968.0A priority Critical patent/CN111400675A/en
Publication of CN111400675A publication Critical patent/CN111400675A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the disclosure provides an object obfuscation method, an object obfuscation device, an electronic device and a computer readable medium. The method comprises the following steps: acquiring a code to be processed; extracting and obtaining a first object and a second object in the code to be processed, wherein the first object is a declaration object, and the second object is a non-declaration object; assigning the second object of the code to be processed to convert the second object into a declaration object, and obtaining the converted second object; and processing the keys of the first object and the converted second object to obtain the target code. The method, the device, the electronic equipment and the computer readable medium for object obfuscation provided by the embodiment of the disclosure convert the second object in the non-declaration object form in the to-be-processed code into the declaration object form, and process the keys of the first object and the converted second object, so that the objects in the to-be-processed code can be obfuscated, the obtained target code has a higher attack threshold, and the code security is improved.

Description

Object obfuscation method, device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for object obfuscation, an electronic device, and a computer-readable medium.
Background
With the growth of network platforms (Web platforms), more and more enterprises migrate core products into browsers, however, the explosive increase of profit inevitably leads to a large number of malicious attackers. At the beginning of the construction of a Web platform, standard makers are designed according to the principle of open sharing, so all source codes of Web applications are exposed in a client. Meanwhile, in order to facilitate developers, the browser is additionally provided with a convenient debugging tool. The source code exposure caused by the above situation provides convenience for malicious attackers to directly acquire the source code for analysis, and the phenomenon causes huge impact on the service line. Among them, general tools do not process objects due to the diversity of object calls. In the Web platform, many data processes are stored in one object so as to be convenient for reading and viewing. The above-mentioned characteristics of the object provide convenience for a malicious attacker instead.
Therefore, there is a need for a new method, apparatus, electronic device, and computer-readable medium for object obfuscation.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The embodiment of the disclosure provides an object obfuscating method, an object obfuscating device, an electronic device and a computer readable medium, so as to avoid, at least to a certain extent, a phenomenon that a source-sharing code in the prior art is attacked.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
The embodiment of the disclosure provides an object obfuscation method, which includes: acquiring a code to be processed; extracting and obtaining a first object and a second object in the code to be processed, wherein the first object is a declaration object, and the second object is a non-declaration object; assigning the second object of the code to be processed to convert the second object into a declaration object, and obtaining the converted second object; and processing the keys of the first object and the converted second object to obtain the target code.
In an exemplary embodiment of the disclosure, processing the keys of the first object and the transformed second object to obtain the object code includes one or more of the following: encrypting the key names of the first object and the converted second object to obtain the target code; splitting the key names of the first object and the converted second object to obtain the target code; splicing the key names of the first object and the converted second object to obtain the target code; and coding the key names of the first object and the converted second object to obtain the target code.
In an exemplary embodiment of the present disclosure, processing the keys of the first object and the converted second object to obtain an object code further includes: replacing the key names of the first object and the converted second object with target variables; and inserting a code segment which assigns the target variable into the key names of the first object and the converted second object to obtain the target code.
In an exemplary embodiment of the disclosure, processing the keys of the first object and the transformed second object to obtain the object code includes one or more of the following: encrypting the key values of the first object and the converted second object to obtain the target code; splitting key values of the first object and the converted second object to obtain the target code; splicing the key values of the first object and the converted second object to obtain the target code; and coding the key values of the first object and the converted second object to obtain the target code.
In an exemplary embodiment of the present disclosure, the extracting and obtaining the first object and the second object in the code to be processed includes: converting the code to be processed to obtain an abstract syntax tree of the code to be processed; and analyzing the abstract syntax tree to obtain the first object and the second object of the code to be processed.
In an exemplary embodiment of the present disclosure, processing the keys of the first object and the converted second object to obtain the object code includes: processing the keys in the first object and the converted second object in the abstract syntax tree to obtain the processed abstract syntax tree; and converting the processed abstract syntax tree into a code form to obtain the target code.
The embodiment of the present disclosure provides an object obfuscation apparatus, including: the code acquisition module is configured to acquire a code to be processed; the object extraction module is configured to extract and obtain a first object and a second object in the code to be processed, wherein the first object is a declaration object, and the second object is a non-declaration object; the object conversion module is configured to assign the second object of the code to be processed and convert the second object into a declaration object, and obtain the converted second object; and the object obfuscating module is configured to process the keys of the first object and the converted second object to obtain the object code.
In an exemplary embodiment of the present disclosure, the object transformation module includes one or more of the following elements: the system comprises an encryption unit, a splitting unit, a splicing unit and an encoding unit;
the encryption unit is configured to encrypt the key names of the first object and the converted second object to obtain the object code; the splitting unit is configured to split the key names of the first object and the converted second object to obtain the target code; the splicing unit is configured to splice the first object and the converted key name of the second object to obtain the target code; the encoding unit is configured to perform encoding processing on the key names of the first object and the converted second object to obtain the object code.
An embodiment of the present disclosure provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method of object obfuscation as described in the above embodiments.
An embodiment of the present disclosure provides a computer-readable medium, on which a computer program is stored, where the program is executed by a processor to implement the method for object obfuscation as described in the above embodiment.
In the technical solutions provided by some embodiments of the present disclosure, a second object in a non-declarative object form in a code to be processed is converted into a declarative object form, and keys of a first object and the converted second object are processed, so that the objects in the code to be processed can be obfuscated, an obtained target code has a higher attack threshold, and the code security is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
In the drawings:
FIG. 1 illustrates a schematic diagram of an exemplary system architecture 100 to which the object obfuscation method or apparatus of embodiments of the present disclosure may be applied;
FIG. 2 schematically illustrates a flow diagram of a method of object obfuscation according to one embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of a method of object obfuscation according to one embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow diagram of a method of object obfuscation, according to one embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow diagram of a method of object obfuscation, according to one embodiment of the present disclosure;
FIG. 6 schematically illustrates a flow diagram of a method of object obfuscation, according to one embodiment of the present disclosure;
FIG. 7 schematically illustrates a flow diagram of a method of object obfuscation according to another embodiment of the present disclosure;
FIG. 8 schematically illustrates a block diagram of an apparatus for object obfuscation according to an embodiment of the present disclosure;
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Some confusion approaches for Web platforms have emerged in the related art, such as variable renaming, control flow flattening, and so on. The related art lacks in the process of confusion for the object to be processed. Due to the diversity of object calls, no object is processed by the general tools. And a lot of data processing in the Web platform are stored in one object, so that reading and viewing are convenient, and convenience is provided for malicious attackers.
Therefore, there is a need for a new method, apparatus, electronic device, and computer-readable medium for object obfuscation.
Fig. 1 illustrates a schematic diagram of an exemplary system architecture 100 to which the object obfuscation method or apparatus of embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, portable computers, desktop computers, wearable devices, virtual reality devices, smart homes, and so forth.
The server 105 may be a server that provides various services. For example, the terminal device 103 (or the terminal device 101 or 102) uploads the code to be processed to the server 105. The server 105 may obtain the code to be processed; extracting and obtaining a first object and a second object in the code to be processed, wherein the first object is a declaration object, and the second object is a non-declaration object; assigning the second object of the code to be processed to convert the second object into a declaration object, and obtaining the converted second object; and processing the keys of the first object and the converted second object to obtain the target code. And the target code is fed back to the terminal equipment 103, and then the terminal equipment 103 can run the code on the Web platform, so that the object in the code to be processed can be confused, the obtained target code has higher attack threshold, and the code security is improved.
Fig. 2 schematically illustrates a flow diagram of a method of object obfuscation according to one embodiment of the present disclosure. The method provided by the embodiment of the present disclosure may be processed by any electronic device with computing processing capability, for example, the server 105 and/or the terminal devices 102 and 103 in the embodiment of fig. 1 described above, and in the following embodiment, the server 105 is taken as an execution subject for example, but the present disclosure is not limited thereto.
As shown in fig. 2, the method for object obfuscation provided by the embodiment of the present disclosure may include the following steps.
In step S210, a code to be processed is acquired.
In step S220, a first object and a second object in the code to be processed are extracted and obtained, where the first object is a declaration object and the second object is a non-declaration object.
In the embodiment of the present disclosure, the code to be processed may be first converted into an Abstract Syntax Tree (AST), or simply, A Syntax Tree (AST), which is an Abstract representation of a Syntax structure of the source code. It represents the syntactic structure of the programming language in the form of a tree, each node on the tree representing a structure in the source code. And extracting the first object and the second object in the abstract syntax tree.
In step S230, the second object of the code to be processed is assigned and converted into the declaration object, and the converted second object is obtained.
In the embodiment of the present disclosure, the second object may be, for example: function a () { return { 'dd': 123} }. The second object is assigned and converted through the step, and the obtained converted second object can be in the shape of: function a () { varff { 'dd': 123 }; return ff }.
In step S240, the keys of the first object and the transformed second object are processed to obtain the object code.
In embodiments of the present disclosure, each first object, each transformed second object may comprise a key. In this step, the key can be obfuscated to obtain the target code.
In an exemplary embodiment, the keys in the first object and the transformed second object may be extracted to process the extracted keys of the first object and the transformed second object to obtain the object code. For example, the following first object or transformed second object: var a {'d': 123}, which yields the following bond: var a { }; a ['d' ] [ -123.
According to the object obfuscating method provided by the embodiment of the disclosure, the second object in the non-declared object form in the code to be processed is converted into the declared object form, the keys of the first object and the converted second object are processed, the object in the code to be processed can be obfuscated, the obtained target code has a higher attack threshold, and the code security is improved.
Fig. 3 schematically illustrates a flow diagram of a method of object obfuscation according to one embodiment of the present disclosure.
As shown in fig. 3, the method for object obfuscation provided by the embodiments of the present disclosure may include the following steps.
In step S310, a code to be processed is acquired.
In step S320, the code to be processed is converted to obtain an abstract syntax tree of the code to be processed.
In step S330, the abstract syntax tree is parsed to obtain a first object and a second object of the code to be processed.
In step S340, the second object of the code to be processed is assigned and converted into a declaration object, and the converted second object is obtained.
In step S350, the keys in the first object and the transformed second object in the abstract syntax tree are processed to obtain a processed abstract syntax tree.
In step S360, the processed abstract syntax tree is converted into a code form to obtain a target code.
According to the object obfuscation method provided by the embodiment of the disclosure, the code to be processed is converted into the abstract syntax tree, and the first object and the second object are obtained based on the abstract syntax tree analysis, so that the extraction method can be simplified, and the first object and the second object can be obtained through extraction more quickly.
Fig. 4 schematically illustrates a flow diagram of a method of object obfuscation according to one embodiment of the present disclosure.
As shown in fig. 4, the method for object obfuscation provided by the embodiments of the present disclosure may include a combination of one or more of the following steps. For example, the method for object obfuscation provided by the embodiment of the present disclosure may include the following steps S410 (or S420, S430, S440), may also include the following steps S410 and S420 (or steps S410 and S430, steps S420 and S440, and the like), may also include the following steps S410 to S430 (or a combination of steps S410, S430, S440, and the like), and may also include the following steps S410 to S440.
In step S410, the key names of the first object and the converted second object are encrypted to obtain the object code.
In the embodiment of the present disclosure, the key name may be encrypted as a character string, and the encryption manner is, for example, but not limited to, a symmetric encryption manner, an asymmetric encryption manner, and the like, which is not limited in the present disclosure.
In step S420, the key names of the first object and the converted second object are split to obtain the target code.
In the embodiment of the present disclosure, the key name may be intercepted as a character string to be split into a combination of two or more character strings.
In step S430, the key names of the first object and the converted second object are spliced to obtain the object code.
In step S440, the key names of the first object and the converted second object are encoded to obtain the object code.
One or more of steps S410 to S440 of the embodiment of the present disclosure may be used as an alternative step to step S230 in the embodiment of fig. 2, or an alternative step to step S350 in the embodiment of fig. 3.
According to the object obfuscating method, the key names of the first object and the converted second object are encrypted, split, spliced, encoded and the like, keys of the first object and the converted second object can be obfuscated, the attack threshold of the obtained target code is high, and the code security is improved.
Fig. 5 schematically illustrates a flow diagram of a method of object obfuscation according to one embodiment of the present disclosure.
As shown in fig. 5, the method for object obfuscation provided by the embodiments of the present disclosure may include the following steps.
In step S510, the key names of the first object and the converted second object are replaced with target variables.
In the embodiments of the present disclosure, for a key: a ['d' ] ═ 123, it is possible to replace'd' with the target variable f, i.e., a [ f ] ═ 123.
In step S520, a code segment that assigns a target variable as a key name of the first object and the translated second object is inserted to obtain a target code.
In the embodiment of the present disclosure, as described above, the code segments for assigning the target variable as the key name of the first object and the transformed second object may be, for example: f ═ d'.
According to the object obfuscating method, the key names of the first object and the converted second object are replaced by the target variable, obfuscating processing can be conducted on the keys of the first object and the converted second object, the attack threshold of the obtained target code is high, and code safety is improved.
Fig. 6 schematically illustrates a flow diagram of a method of object obfuscation according to one embodiment of the present disclosure.
As shown in fig. 6, the method for object obfuscation provided by the embodiments of the present disclosure may include a combination of one or more of the following steps. For example, the method for object obfuscation provided by the embodiment of the present disclosure may include the following step S610 (or S620, S630, S640), may also include the following steps S610 and S620 (or step S610 and step S630, step S620 and step S640, and so on), may also include the following steps S610 to S630 (or a combination of steps S610, S630, and S640, and so on), and may also include the following steps S610 to S640.
In step S610, the key values of the first object and the converted second object are encrypted to obtain the target code.
In step S620, the key values of the first object and the converted second object are split to obtain the target code.
In step S630, the key values of the first object and the converted second object are spliced to obtain the target code.
In step S640, the key values of the first object and the converted second object are encoded to obtain the target code.
One or more of steps S610 to S640 in the embodiment of the present disclosure may be used as an alternative to step S230 in the embodiment of fig. 2, or to step S350 in the embodiment of fig. 3.
Steps S610 to S640 in the embodiment of the present disclosure may be executed together with steps S410 to S440 in fig. 4 and steps S510 to S520 in fig. 5, and are used as an alternative step to step S230 in the embodiment of fig. 2 or an alternative step to step S350 in the embodiment of fig. 3.
According to the object obfuscating method, operations such as encryption, splitting, splicing and encoding are performed on the key values of the first object and the converted second object, obfuscating processing can be performed on the keys of the first object and the converted second object, the attack threshold of the obtained target code is high, and the code security is improved.
Fig. 7 schematically illustrates a flow diagram of a method of object obfuscation according to another embodiment of the present disclosure.
As shown in fig. 7, the method for object obfuscation provided by the embodiments of the present disclosure may include the following steps.
In step S710, a code to be processed is acquired.
In step S720, the code to be processed is converted to obtain an abstract syntax tree of the code to be processed.
In step S730, the abstract syntax tree is parsed to obtain a first object and a second object of the code to be processed.
In step S740, the second object of the code to be processed is assigned and converted into the declaration object, and the converted second object is obtained.
In the embodiment of the present disclosure, the second object may be, for example, function a () { return { 'dd': 123} }. The transformed second object may be: function a () { var ff { 'dd': 123 }; return ff }.
In step S750, the keys in the first object and the converted second object are extracted.
In an embodiment of the disclosure, for a first object or a transformed second object: var a {'d': 123}, whose extracted bonds are as follows: var a { }; a ['d' ] [ -123.
In step S760, the extracted keys of the first object and the transformed second object are processed to obtain a processed abstract syntax tree.
In the embodiment of the present disclosure, the keys of the first object and the transformed second object may be processed in a plurality of ways in combination or in a single way. The specific processing mode may be, for example, encryption, splitting, splicing, encoding, replacing with a variable, assigning a value to the variable, and the like. The specific processing manner may be, for example, the manner shown in the embodiments of fig. 4 to 6.
In step S770, the processed abstract syntax tree is converted into a code form to obtain a target code.
According to the object obfuscating method, the first object and the second object in the syntax tree are extracted, the second object is converted, keys of the first object and the converted second object are processed, the objects in the code to be processed can be obfuscated, the attack threshold of the obtained target code is high, and the code safety is improved.
Embodiments of the apparatus of the present disclosure are described below that can be used to perform the methods of obfuscating the objects of the present disclosure described above. For details which are not disclosed in the embodiments of the apparatus of the present disclosure, reference is made to the embodiments of the method of the present disclosure which have been described above for obfuscating objects.
Fig. 8 schematically illustrates a block diagram of an apparatus for object obfuscation according to an embodiment of the present disclosure.
Referring to fig. 8, an apparatus 800 for object obfuscation according to an embodiment of the present disclosure may include: a code acquisition module 810, an object extraction module 820, an object translation module 830, and an object obfuscation module 840.
The code acquisition module 810 may be configured to acquire code to be processed.
The object extraction module 820 may be configured to extract a first object and a second object in the obtained code to be processed, where the first object is a declarative object and the second object is a non-declarative object.
In an exemplary embodiment, the object extraction module 820 may include a syntax tree conversion unit and a syntax tree parsing unit. The syntax tree conversion unit may be configured to convert the code to be processed to obtain an abstract syntax tree of the code to be processed. The syntax tree parsing unit may be configured to parse the abstract syntax tree to obtain a first object and a second object of the code to be processed.
The object transformation module 830 may be configured to perform assignment on a second object of the to-be-processed code to transform the second object into a declarative object, and obtain the transformed second object.
In an exemplary embodiment, the object transformation module 830 may include one or more of the following elements: the system comprises an encryption unit, a splitting unit, a splicing unit and an encoding unit; the encryption unit may be configured to encrypt key names of the first object and the converted second object to obtain an object code; the splitting unit may be configured to split key names of the first object and the converted second object to obtain a target code; the splicing unit may be configured to splice the key names of the first object and the converted second object to obtain the target code; the encoding unit may be configured to perform encoding processing on the key names of the first object and the converted second object to obtain the object code.
In an exemplary embodiment, the object transformation module 830 may further include a variable replacement unit and a variable assignment unit. Wherein the variable replacing unit may be configured to replace the key names of the first object and the converted second object with the target variable. The variable assignment unit may be configured to insert a code segment that assigns the target variable as a key name of the first object and the translated second object, to obtain the target code.
In an exemplary embodiment, the object transformation module 830 may include one or more of the following elements: the key value encryption unit, the key value splitting unit, the key value splicing unit and the key value coding unit; the key value encryption unit can be configured to encrypt the key values of the first object and the converted second object to obtain a target code; the splitting unit may be configured to split key values of the first object and the converted second object to obtain a target code; the splicing unit may be configured to splice key values of the first object and the converted second object to obtain a target code; the encoding unit may be configured to perform encoding processing on key values of the first object and the converted second object to obtain the target code.
The object obfuscation module 840 may be configured to process the keys of the first object and the translated second object to obtain the object code.
In an exemplary embodiment, the object obfuscation module 840 may include a key processing unit and an object code unit. The key processing unit may be configured to process keys in the first object and the converted second object in the abstract syntax tree to obtain a processed abstract syntax tree. The object code unit may be configured to convert the processed abstract syntax tree into a code form to obtain the object code.
The device for object obfuscation provided by the embodiment of the disclosure converts the second object in the non-declared object form in the code to be processed into the declared object form, and processes the keys of the first object and the converted second object, so that the object in the code to be processed can be obfuscated, the obtained target code has a higher attack threshold, and the code security is improved.
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present disclosure. It should be noted that the computer system 900 of the electronic device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments of the present disclosure.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for system operation are also stored. The CPU901, ROM902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
To the I/O interface 905, AN input section 906 including a keyboard, a mouse, and the like, AN output section 907 including a keyboard such as a Cathode Ray Tube (CRT), a liquid crystal display (L CD), and the like, a speaker, and the like, a storage section 908 including a hard disk, and the like, and a communication section 909 including a network interface card such as a L AN card, a modem, and the like, the communication section 909 performs communication processing via a network such as the internet, a drive 910 is also connected to the I/O interface 905 as necessary, a removable medium 911 such as a magnetic disk, AN optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, the processes described below with reference to the flowcharts may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and/or units and/or sub-units described in the embodiments of the present disclosure may be implemented by software, or may be implemented by hardware, and the described modules and/or units and/or sub-units may also be disposed in a processor. Wherein the names of such modules and/or units and/or sub-units in some cases do not constitute a limitation on the modules and/or units and/or sub-units themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the embodiments below. For example, the electronic device may implement the steps shown in fig. 2 or fig. 3 or fig. 4 or fig. 5 or fig. 6 or fig. 7.
It should be noted that although in the above detailed description several modules or units or sub-units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units or sub-units described above may be embodied in one module or unit or sub-unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units or sub-units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method of object obfuscation, comprising:
acquiring a code to be processed;
extracting and obtaining a first object and a second object in the code to be processed, wherein the first object is a declaration object, and the second object is a non-declaration object;
assigning the second object of the code to be processed to convert the second object into a declaration object, and obtaining the converted second object;
and processing the keys of the first object and the converted second object to obtain the target code.
2. The method of claim 1, wherein processing the keys of the first object and the translated second object to obtain object code comprises one or more of:
encrypting the key names of the first object and the converted second object to obtain the target code;
splitting the key names of the first object and the converted second object to obtain the target code;
splicing the key names of the first object and the converted second object to obtain the target code;
and coding the key names of the first object and the converted second object to obtain the target code.
3. The method of claim 2, wherein processing the keys of the first object and the translated second object to obtain object code further comprises:
replacing the key names of the first object and the converted second object with target variables;
and inserting a code segment which assigns the target variable into the key names of the first object and the converted second object to obtain the target code.
4. The method of claim 1, wherein processing the keys of the first object and the translated second object to obtain object code comprises one or more of:
encrypting the key values of the first object and the converted second object to obtain the target code;
splitting key values of the first object and the converted second object to obtain the target code;
splicing the key values of the first object and the converted second object to obtain the target code;
and coding the key values of the first object and the converted second object to obtain the target code.
5. The method of claim 1, wherein extracting to obtain the first object and the second object in the code to be processed comprises:
converting the code to be processed to obtain an abstract syntax tree of the code to be processed;
and analyzing the abstract syntax tree to obtain the first object and the second object of the code to be processed.
6. The method of claim 5, wherein processing the keys of the first object and the translated second object to obtain object code comprises:
processing the keys in the first object and the converted second object in the abstract syntax tree to obtain the processed abstract syntax tree;
and converting the processed abstract syntax tree into a code form to obtain the target code.
7. An apparatus for object obfuscation, comprising:
the code acquisition module is configured to acquire a code to be processed;
the object extraction module is configured to extract and obtain a first object and a second object in the code to be processed, wherein the first object is a declaration object, and the second object is a non-declaration object;
the object conversion module is configured to assign the second object of the code to be processed and convert the second object into a declaration object, and obtain the converted second object;
and the object obfuscating module is configured to process the keys of the first object and the converted second object to obtain the object code.
8. The apparatus of claim 7, wherein the object translation module comprises one or more of the following: the system comprises an encryption unit, a splitting unit, a splicing unit and an encoding unit;
the encryption unit is configured to encrypt the key names of the first object and the converted second object to obtain the object code;
the splitting unit is configured to split the key names of the first object and the converted second object to obtain the target code;
the splicing unit is configured to splice the first object and the converted key name of the second object to obtain the target code;
the encoding unit is configured to perform encoding processing on the key names of the first object and the converted second object to obtain the object code.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202010179968.0A 2020-03-16 2020-03-16 Object obfuscation method, device, electronic equipment and computer readable medium Pending CN111400675A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010179968.0A CN111400675A (en) 2020-03-16 2020-03-16 Object obfuscation method, device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010179968.0A CN111400675A (en) 2020-03-16 2020-03-16 Object obfuscation method, device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN111400675A true CN111400675A (en) 2020-07-10

Family

ID=71428818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010179968.0A Pending CN111400675A (en) 2020-03-16 2020-03-16 Object obfuscation method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN111400675A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060173873A1 (en) * 2000-03-03 2006-08-03 Michel Prompt System and method for providing access to databases via directories and other hierarchical structures and interfaces
CN108776587A (en) * 2018-05-25 2018-11-09 平安科技(深圳)有限公司 Data capture method, device, computer equipment and storage medium
CN110059456A (en) * 2019-04-19 2019-07-26 同盾控股有限公司 Code protection method, code protection device, storage medium and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060173873A1 (en) * 2000-03-03 2006-08-03 Michel Prompt System and method for providing access to databases via directories and other hierarchical structures and interfaces
CN108776587A (en) * 2018-05-25 2018-11-09 平安科技(深圳)有限公司 Data capture method, device, computer equipment and storage medium
CN110059456A (en) * 2019-04-19 2019-07-26 同盾控股有限公司 Code protection method, code protection device, storage medium and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
(美)内尔.黛尔等: "《Java面向对象数据结构完全学习教程》", 31 October 2019, 中国青年出版社 *
毕树军等: "《Java程序设计实用教程》", 31 October 2008, 黑龙江大学出版社 *

Similar Documents

Publication Publication Date Title
JP6926429B2 (en) Data processing equipment, data processing methods, and programs
CN106919555B (en) System and method for field extraction of data contained within a log stream
CN112104709B (en) Intelligent contract processing method, device, medium and electronic equipment
CN107506256B (en) Method and device for monitoring crash data
CN111736840A (en) Compiling method and running method of applet, storage medium and electronic equipment
CN112597454A (en) Code obfuscation method, code operation method, device, medium, and apparatus
TW201037532A (en) Sharable distributed dictionary for applications
CN110858172A (en) Automatic test code generation method and device
CN111316232A (en) Providing optimization using annotations of programs
CN111241496B (en) Method and device for determining small program feature vector and electronic equipment
CN114036561A (en) Information hiding method, information acquiring method, information hiding device, information acquiring device, storage medium and electronic equipment
CN111600920B (en) JS-based data request proxy method, device, equipment and readable storage medium
CN112436943A (en) Request deduplication method, device, equipment and storage medium based on big data
CN111400675A (en) Object obfuscation method, device, electronic equipment and computer readable medium
CN115563942A (en) Contract generation method and device, electronic equipment and computer readable medium
CN114238831A (en) HTML code fragment processing method, system, electronic equipment and storage medium
CN111400623B (en) Method and device for searching information
CN113221554A (en) Text processing method and device, electronic equipment and storage medium
CN111131354B (en) Method and apparatus for generating information
CN113779018A (en) Data processing method and device
CN111079185A (en) Database information processing method and device, storage medium and electronic equipment
CN115935302B (en) Android installation package generation method and device
CN113742662A (en) PHP source code encryption method and device
CN113392369A (en) Identity identification generation method and device, storage medium and electronic equipment
CN111966592A (en) Front-end page testing method, device, medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200710

RJ01 Rejection of invention patent application after publication