Protecting method and system of java source code

Uložené v:
Podrobná bibliografia
Názov: Protecting method and system of java source code
Patent Number: 9,443,064
Dátum vydania: September 13, 2016
Appl. No: 14/117987
Application Filed: August 27, 2012
Abstrakt: The present disclosure discloses a protecting method and system of Java source code. When a first initiating class is invoked, the method comprises following steps, wherein the first initiating class is an initiating class of Java program: the first initiating class decrypts first cipher data to obtain a class loader; the class loader reads second cipher data to the memory and decrypts the second cipher data to obtain a first class, wherein the first class is a class run by a Java virtual machine, and the suffix of the first class is .class; the class loader loads a second initiating class to the memory; wherein the second initiating class is an original class in jar packet of the Java program; and the class loader loads the first class to the Java virtual machine so that the Java virtual machine can invoke a main interface in the second initiating class to run the Java program. The present disclosure can protect Java source code and make it difficult to decompile the Java source code.
Inventors: Lu, Zhou (Haidian District, CN); Zu, Huazhang (Haidian Distict, CN)
Assignees: Feitian Technologies Co., Ltd. (CN)
Claim: 1. A protecting method of Java source code, wherein when a first initiating class is invoked, the method comprises: S 1 , the first initiating class reading first cipher data to a memory, decrypting the first cipher data to obtain first plain data, and defining the first plain data as a class loader, wherein the first initiating class is an initiating class of Java program and the first cipher data is data obtained by encrypting the bytecode file of the class loader; S 2 , the class loader reading second cipher data to the memory, decrypting the second cipher data to obtain second plain data, and defining the second plain data as a first class, wherein the first class is a class which is run by a Java virtual machine, and the suffix of the first class is .class, and the second cipher data is obtained by encrypting the bytecode file of the first class; S 3 , the class loader loading a second initiating class to the memory, wherein the second initiating class is an original class in jar packet of Java program; and S 4 , the class loader loading the first class to the Java virtual machine so that the Java virtual machine can invoke a main interface in the second initiating class and run the Java program, wherein the step S 1 comprises: S 11 , the first initiating class reading the first cipher data to the memory; S 12 , the first initiating class loading a local first dynamic library to the memory; S 13 , the first initiating class invoking a third interface in the first dynamic library; S 14 , the first initiating class transferring an address of the first cipher data in the memory into the third interface in the first dynamic library; S 15 , the third interface in the first dynamic library decrypting the first cipher data to obtain the first plain data; and S 16 , the third interface in the first dynamic library invoking a define class interface of the Java virtual machine to define the first plain data as the class loader.
Claim: 2. The method of claim 1 , wherein the step S 11 comprises: S 111 , invoking a first interface in the first initiating class; S 112 , the first interface in the first initiating class invoking a second interface in the first initiating class; and S 113 , the second interface in the first initiating class reading the first cipher data to the memory.
Claim: 3. The method of claim 1 , wherein the step S 3 comprises S 31 , the third interface in the first dynamic library invoking a fourth interface in the class loader; S 32 , the fourth interface in the class loader reading a configuration file in jar packet of the Java program; S 33 , the fourth interface in the class loader reading out the second initiating class from the configuration file; S 34 , the fourth interface in the class loader invoking a fifth interface in the class loader; and S 35 , the fifth interface in the class loader loading the second initiating class to the memory.
Claim: 4. The method of claim 3 , wherein the step S 2 comprises: S 21 , the fifth interface of the class loader invoking a sixth interface in the class loader; S 22 , the sixth interface in the class loader reading the second cipher data to the memory; S 23 , the fifth interface in the class loader decrypting the second cipher data to obtain second plain data; and S 24 , the fifth interface in the class loader invoking the define class interface of the Java virtual machine and defining the second plain data as the first class.
Claim: 5. The method of claim 1 , wherein decrypting the first cipher data and the second cipher data in the following ways: S 2001 , invoking a dongle interface to search whether a dongle exists; S 2002 , when the dongle is found by searching, invoking the dongle interface to transfer cipher data into the dongle; S 2003 , invoking the dongle interface to use a key stored in the dongle to decrypt the cipher data, which is transferred in, to obtain plain data; and S 2004 , invoking the dongle interface to obtain the plain data.
Claim: 6. A protecting system of Java source code, executed by a computer device, the computer device comprises a processor and a memory, comprising: a first processing module comprising a first initiating class, wherein the first initiating class is an initiating class of Java program; an invoking module configured to invoke the first initiating class; and a second processing module comprising a class loader; an encrypting module configured to encrypt a bytecode file of the class loader to first cipher data and encrypt a bytecode file of a first class to second cipher data, wherein the first class is a class run by a Java virtual machine; and a decrypting module configured to decrypt the first cipher data to first plain data and decrypt the second cipher data to second plain data, wherein the first initiating class is configured to read the first cipher data to the memory, and control the decrypting module to decrypt the first cipher data to obtain the first plain data and define the first plain data as the class loader; and the class loader configured to load a second initiating class to the memory, read the second cipher data to the memory, control the decrypting module to decrypt the second cipher data and load the first class to the Java virtual machine so that the Java virtual machine can invoke a main interface of the second initiating class to run the Java program, wherein the second initiating class is an original class of jar packet of the Java program, wherein the first initiating class is further configured to load a local first dynamic library to the memory, invoke a third interface in the first dynamic library and transfer the address of the first cipher data in the memory into the third interface in the first dynamic library, wherein the third interface in the first dynamic library is configured to decrypt the first cipher data to obtain the first plain data and invoke a define class interface of the Java virtual machine to define the first plain data as the class loader.
Claim: 7. The protecting system of claim 6 , wherein the first initiating class comprises a first interface and a second interface, wherein the first interface in the first initiating class is configured to invoke the second interface in the first initiating class; the second interface in the first initiating class is configured to read the first cipher data to the memory.
Claim: 8. The protecting system of claim 6 , wherein the class loader comprises a fourth interface and a fifth interface, wherein the fourth interface of the class loader is configured to read a configuration file in the jar packet of the Java program, read the second initiating class out from the configuration file and invoke the fifth interface in the class loader; the fifth interface in the class loader is configured to load the second initiating class to the memory; and the third interface in the first dynamic library is further configured to invoke the fourth interface in the class loader.
Claim: 9. The protecting system of claim 8 , wherein the class loader comprises a sixth interface, wherein the sixth interface in the class loader is configured to read the second cipher data to the memory; and the fifth interface in the class loader is further configured to invoke the sixth interface in the class loader, decrypt the second cipher data to obtain the second plain data, and invoke the define class interface of the Java virtual machine to define the second plain data as the first class.
Claim: 10. The protecting system of claim 6 , wherein the decrypting module comprises: a second searching sub-module configured to invoke a dongle interface to search whether a dongle exists; a second transferring-in sub-module configured to, when the dongle is found by searching, invoke the dongle interface to transfer cipher data into the dongle; a first decrypting sub-module configured to invoke the dongle interface to use the key stored in the dongle to decrypt the cipher data, which is transferred in, to obtain plain data; and a third obtaining sub-module configured to invoke the dongle interface to obtain the plain data.
Patent References Cited: 8843766 September 2014 Schwarz
2003/0195856 October 2003 Bramhill
2004/0039926 February 2004 Lambert
2005/0130728 June 2005 Nguyen
2006/0035707 February 2006 Nguyen
2010/0205459 August 2010 Schwarz
2013/0005453 January 2013 Nguyen
101814124 August 2010
102043932 May 2011
102360412 February 2012
2008-252798 October 2008
2006134304 December 2006
Primary Examiner: Hailu, Teshome
Attorney, Agent or Firm: Tarolli, Sundheim, Covell & Tummino LLP
Prístupové číslo: edspgr.09443064
Databáza: USPTO Patent Grants
Popis
Abstrakt:The present disclosure discloses a protecting method and system of Java source code. When a first initiating class is invoked, the method comprises following steps, wherein the first initiating class is an initiating class of Java program: the first initiating class decrypts first cipher data to obtain a class loader; the class loader reads second cipher data to the memory and decrypts the second cipher data to obtain a first class, wherein the first class is a class run by a Java virtual machine, and the suffix of the first class is .class; the class loader loads a second initiating class to the memory; wherein the second initiating class is an original class in jar packet of the Java program; and the class loader loads the first class to the Java virtual machine so that the Java virtual machine can invoke a main interface in the second initiating class to run the Java program. The present disclosure can protect Java source code and make it difficult to decompile the Java source code.