Unlock instant, AI-driven research and patent intelligence for your innovation.

A method and device for obfuscating strings in source code

A string and source code technology, applied in the field of software development, can solve problems such as application security risks, and achieve the effect of avoiding security risks

Active Publication Date: 2020-11-13
BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF12 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The inventors of the present application found that these character strings existing in the source code in plain text would cause the encryption algorithm implemented in the application program to be useless, and also provide great convenience for the attacker to find the cracking entry, thus causing these application programs to There is a greater risk in safety

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and device for obfuscating strings in source code
  • A method and device for obfuscating strings in source code
  • A method and device for obfuscating strings in source code

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0037] figure 1 A flow chart of the steps of a method for obfuscating character strings in source code provided by an embodiment of the present invention.

[0038] refer to figure 1 As shown, the obfuscation method provided by this embodiment is applied to software development tools to obfuscate the character strings in the source code of the application program project, so as to avoid the occurrence of plaintext strings that are easy to be deciphered by humans. The obfuscation method Specifically include steps:

[0039] S101: Using the Clang tool to compile the source code with obfuscation.

[0040] The source code here refers to the source code developed by the developer in advance, which will include many strings, such as defined variables, decryption keys, and characters that need to be displayed on the UI interface. After the developer develops the source code, he uses the Clang tool to compile and process the source code, so as to obtain the syntax tree of the source ...

Embodiment 2

[0064] image 3 A structural block diagram of an apparatus for obfuscating character strings in source code provided by an embodiment of the present invention.

[0065] refer to image 3 As shown, the obfuscation device provided by this embodiment is applied in a software development tool, and is used to obfuscate the character strings in the source code of the application program project, so as to avoid the occurrence of plaintext strings that are easy to be deciphered by humans. The obfuscation device It specifically includes a code compilation module 10 , a list generation module 20 , an encryption processing module 30 and a code insertion module 40 .

[0066] The code compilation module is used to compile the obfuscated source code using the Clang tool.

[0067] The source code here refers to the source code developed by the developer in advance, which will include many strings, such as defined variables, decryption keys, and characters that need to be displayed on the U...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiment of the invention provides a method and a device for mixing character strings in a source code. The method and the device are applied to a software development tool. The method specifically comprises the steps of compiling a to-be-mixed source code by use of a Clang tool to obtain a syntax tree; traversing the syntax tree to obtain a character string constant list and a character string reference list of the character string in the source code; reading a character string constant according to a position indicated in the character string constant list and encrypting the characterstring constant, and replacing an original character string constant with the encrypted character string; finding the encrypted character string according to the character string reference list, and inserting a decryption code at a position in the source code where the encrypted character string is located. Through replacement, all character string constants in the source code are converted into the encrypted character strings and are no longer plaintext information which may cause secret leakage, thereby avoiding the corresponding safety risk.

Description

technical field [0001] The invention relates to the technical field of software development, in particular to a character string obfuscation method and device. Background technique [0002] Basically in all projects, the source code will use a lot of string constants. These strings are generally written in the code directly in plain text without any encryption or obfuscation, including encryption and decryption keys and UI Characters displayed in the interface. The inventors of the present application found that these character strings existing in the source code in plain text would cause the encryption algorithm implemented in the application program to be useless, and also provide great convenience for the attacker to find the cracking entry, thus causing these application programs to There are greater risks in safety. Contents of the invention [0003] In view of this, the present invention provides a method and device for obfuscating character strings in source codes...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F21/14
CPCG06F21/14
Inventor 朱明宝
Owner BEIJING QIYI CENTURY SCI & TECH CO LTD