CN110532737A - Jar packet encryption management method, device, computer equipment and storage medium - Google Patents

Jar packet encryption management method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110532737A
CN110532737A CN201910809279.0A CN201910809279A CN110532737A CN 110532737 A CN110532737 A CN 110532737A CN 201910809279 A CN201910809279 A CN 201910809279A CN 110532737 A CN110532737 A CN 110532737A
Authority
CN
China
Prior art keywords
encryption
jar packet
jvmtiagent
self defined
jar
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
CN201910809279.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.)
Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd
Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Original Assignee
Shenzhen Qianhai Huanlianyi Information Technology Service 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 Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd filed Critical Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd
Priority to CN201910809279.0A priority Critical patent/CN110532737A/en
Publication of CN110532737A publication Critical patent/CN110532737A/en
Pending legal-status Critical Current

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Technology Law (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention discloses a kind of Jar packet encryption management method, device, computer equipment and storage mediums.The described method includes: carrying out the encryption of preset algorithm by Class file of the preset self defined class loader to the Jar packet to be encrypted if receiving Jar packet to be encrypted to obtain the first encryption Jar packet;JVMTIAgent is carried out to the Class file of the Jar packet of the self defined class loader to encrypt to obtain the second encryption Jar packet.It is applicable to encrypt the Jar packet of Spring project by self defined class loader, it is applied widely.Simultaneously, after being encrypted by JVMTIAgent, it may make the Class file of the Jar packet of self defined class loader that can not carry out decompiling by decompiling instrument and check, to be difficult to obtain the Encryption Algorithm of customized Classloader use, it ensures that the first encryption Jar packet can not be cracked, improves safety.

Description

Jar packet encryption management method, device, computer equipment and storage medium
Technical field
The present invention relates to encryption technology field more particularly to a kind of Jar packet encryption management methods, device, computer equipment And storage medium.
Background technique
Enterprise can provide the service disposed with Jar packet form according to the demand of client in production and operation.In order to avoid going out Core logic part in existing Jar packet is revealed, so that the service safe of client is on the hazard, is generally required to being supplied to client's Jar packet carries out safe encipherment protection.
Open source community provides the method that a variety of pairs of Jar packets carry out safe encipherment protection.Successively there is generation according to complexity Code is obscured (such as Pro Guard tool), self defined class loader and JVMTI (JavaVirtual Machine Tool Interface, Java Virtual Machine tool interface) Agent load etc. technologies.The above technology has the following disadvantages: mixed for code Confuse cipher mode, check by the decompiling instrument (such as jd-gui.exe) of Jar packet the code of Jar packet, safety It is poor.For self defined class loader cipher mode, decompiling can be carried out by the Class to self defined class loader, cruelly Reveal the algorithm encrypted safely, safety is equally poor.JVMTIAgent load cipher mode then may be only available for non- The Jar of Spring project, applicability are more limited to.
Summary of the invention
The embodiment of the invention provides a kind of Jar packet encryption management method, device, computer equipment and storage medium, purports Solving the problems, such as existing Jar packet encryption method safety difference and applicability limitation.
In a first aspect, the embodiment of the invention provides a kind of Jar packet encryption management methods comprising:
If receiving Jar packet to be encrypted, by preset self defined class loader to the Class of the Jar packet to be encrypted File carries out the encryption of preset algorithm to obtain the first encryption Jar packet;
JVMTIAgent encryption is carried out to the Class file of the Jar packet of the self defined class loader to add to obtain second MiJarBao.
Second aspect, the embodiment of the invention also provides a kind of Jar packet encryption handling devices comprising above-mentioned for executing The unit of method.
The third aspect, the embodiment of the invention also provides a kind of computer equipments comprising memory and processor, it is described Computer program is stored on memory, the processor realizes the above method when executing the computer program.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage medium, the storage medium storage There is computer program, the computer program can realize the above method when being executed by a processor.
The technical solution of the embodiment of the present invention passes through preset self defined class loader when receiving Jar packet to be encrypted The encryption of preset algorithm is carried out to obtain the first encryption Jar packet to the Class file of the Jar packet to be encrypted;It is made by oneself to described The Class file of the Jar packet of adopted Classloader carries out JVMTIAgent and encrypts to obtain the second encryption Jar packet.By customized Classloader is applicable to encrypt the Jar packet of Spring project, applied widely.Meanwhile by JVMTIAgent plus After close, it may make the Class file of the Jar packet of self defined class loader that can not carry out decompiling by decompiling instrument and check, To be difficult to obtain the Encryption Algorithm of customized Classloader use, it is ensured that the first encryption Jar packet can not be cracked, and improve Safety.
Detailed description of the invention
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of Jar packet encryption management method provided in an embodiment of the present invention;
Fig. 2 is a kind of sub-process schematic diagram of Jar packet encryption management method provided in an embodiment of the present invention;
Fig. 3 be another embodiment of the present invention provides a kind of Jar packet encryption management method flow diagram;
Fig. 4 is a kind of schematic block diagram of Jar packet encryption handling device provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic frame of second encryption unit of Jar packet encryption handling device provided in an embodiment of the present invention Figure;
Fig. 6 be another embodiment of the present invention provides Jar packet encryption handling device schematic block diagram;
Fig. 7 be another embodiment of the present invention provides a kind of Jar packet encryption handling device the first decryption unit signal Property block diagram;And
Fig. 8 is the schematic block diagram of computer equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
Referring to Fig. 1, Fig. 1 is a kind of schematic flow chart of Jar packet encryption management method provided in an embodiment of the present invention. A kind of Jar packet encryption management method that the embodiment of the present invention proposes is applied in terminal.As shown, this method includes following step Rapid S1-S2.
S1, if receiving Jar packet to be encrypted, by preset self defined class loader to the Jar packet to be encrypted Class file carries out the encryption of preset algorithm to obtain the first encryption Jar packet.
In specific implementation, if receiving Jar packet to be encrypted, first by preset self defined class loader to it is described to The Class file for encrypting Jar packet carries out the encryption of preset algorithm to obtain the first encryption Jar packet.
It should be noted that Class file is the binary file after Java code is compiled.
In embodiments of the present invention, self defined class loader can realize the encryption to the Jar packet of Spring project, be applicable in model It encloses wide.In one embodiment, preset algorithm is rivest, shamir, adelman, for example, RSA.
JVMTI Agent cipher mode in the prior art can be solved by above step S1 not being available in Spring project Jar wrap, the small problem of the scope of application.It should be noted that JVMTIAgent cipher mode is not available at Spring The reason of purpose Jar is wrapped is the load that Spring uses non-parents that mechanism is entrusted to carry out Class file.Spring project Jar packet dispose operation when, using non-parents entrust mechanism loading classes so that passed through JVMTIAgent decryption byte Code can not be used directly by the self defined class loader of Spring, cause service that can not normally start deployment operation.
However, the safety in such a way that self defined class loader encrypts Jar packet is poor.Main cause is can to pass through Decompiling instrument (such as jd-gui.exe) carries out decompiling to self defined class loader and views the Encryption Algorithm used, thus real Now Jar is cracked.In order to solve problem above, the safety embodiment of the present invention for improving Jar packet proposes following steps S2, tool Body is discussed below:
S2 carries out JVMTIAgent to the Class file of the Jar packet of the self defined class loader and encrypts to obtain second Encrypt Jar packet.
In specific implementation, to the Class file of the Jar packet of the self defined class loader carry out JVMTIAgent encryption with Obtain the second encryption Jar packet.
After encrypting by JVMTIAgent, it may make that the Class file of the Jar packet of self defined class loader can not be by Decompiling instrument carries out decompiling and checks, this is because decompiling instrument can not parse by the bytecode after algorithm for encryption, To which the Encryption Algorithm that customized Classloader uses can not be obtained, and then ensure that the first encryption Jar packet can not be cracked.
Referring to fig. 2, in one embodiment, above step S2 specifically comprises the following steps S21-S22.
S21 receives JVMTIAgent encryption dynamic library file and encrypts dynamic library file pair with the JVMTIAgent The JVMTIAgent decryption dynamic library file answered.
In specific implementation, receives JVMTIAgent encryption dynamic library file and encrypt dynamic with the JVMTI Agent The corresponding JVMTIAgent of library file decrypts dynamic library file.JVMTIAgent encrypts dynamic library file and JVMTIAgent solution Close dynamic library file is write using C++ or C language, and it is high to crack difficulty.JVMTIAgent encrypts dynamic library file It is encrypted for the Class file to Jar packet, and JVMTIAgent decryption dynamic library file is used to encrypt JVMTIAgent The encrypted file of dynamic library file is decrypted.
In one embodiment, the JVMTIAgent is encrypted into dynamic library file and JVMTIAgent decryption dynamic Library file storage, is called in order to load.
S22 encrypts dynamic library file to the Jar packet of the self defined class loader by the JVMTIAgent Class file is encrypted to obtain the second encryption Jar packet.
In specific implementation, dynamic library file is encrypted to the Jar of the self defined class loader by the JVMTIAgent The Class file of packet is encrypted to obtain the second encryption Jar packet.
The technical solution of the embodiment of the present invention passes through preset self defined class loader when receiving Jar packet to be encrypted The encryption of preset algorithm is carried out to obtain the first encryption Jar packet to the Class file of the Jar packet to be encrypted;It is made by oneself to described The Class file of the Jar packet of adopted Classloader carries out JVMTIAgent and encrypts to obtain the second encryption Jar packet.By customized Classloader is applicable to encrypt the Jar packet of Spring project, applied widely.Meanwhile by JVMTIAgent plus After close, it may make the Class file of the Jar packet of self defined class loader that can not carry out decompiling by decompiling instrument and check, To be difficult to obtain the Encryption Algorithm of customized Classloader use, it is ensured that the first encryption Jar packet can not be cracked, and improve Safety.
Fig. 3 be another embodiment of the present invention provides a kind of Jar packet encryption management method flow diagram.Such as Fig. 3 institute Show, the Jar packet encryption management method of the present embodiment includes step S31-S34.
S31, if receiving Jar packet to be encrypted, by preset self defined class loader to the Jar packet to be encrypted Class file carries out the encryption of preset algorithm to obtain the first encryption Jar packet.
In specific implementation, if receiving Jar packet to be encrypted, first by preset self defined class loader to it is described to The Class file for encrypting Jar packet carries out the encryption of preset algorithm to obtain the first encryption Jar packet.
In embodiments of the present invention, self defined class loader can realize the encryption to the Jar packet of Spring project, be applicable in model It encloses wide.In one embodiment, preset algorithm is rivest, shamir, adelman, for example, RSA.
JVMTI Agent cipher mode in the prior art can be solved by above step S1 not being available in Spring project Jar wrap, the small problem of the scope of application.It should be noted that JVMTIAgent cipher mode is not available at Spring The reason of purpose Jar is wrapped is the load that Spring uses non-parents that mechanism is entrusted to carry out Class file.Spring project Jar packet dispose operation when, using non-parents entrust mechanism loading classes so that passed through JVMTIAgent decryption byte Code can not be used directly by the self defined class loader of Spring, cause service that can not normally start deployment operation.
However, the safety in such a way that self defined class loader encrypts Jar packet is poor.Main cause is can to pass through Decompiling instrument (such as jd-gui.exe) carries out decompiling to self defined class loader and views the Encryption Algorithm used, thus real Now Jar is cracked.In order to solve problem above, the safety embodiment of the present invention for improving Jar packet proposes following steps S2, tool Body is discussed below:
S32 carries out JVMTIAgent encryption to the Class file of the Jar packet of the self defined class loader to obtain the Two encryption Jar packets.
In specific implementation, to the Class file of the Jar packet of the self defined class loader carry out JVMTIAgent encryption with Obtain the second encryption Jar packet.
After encrypting by JVMTIAgent, it may make that the Class file of the Jar packet of self defined class loader can not be by Decompiling instrument carries out decompiling and checks, this is because decompiling instrument can not parse by the bytecode after algorithm for encryption, To which the Encryption Algorithm that customized Classloader uses can not be obtained, and then ensure that the first encryption Jar packet can not be cracked.
Referring to fig. 2, in one embodiment, above step S32 specifically comprises the following steps S21-S22.
S21 receives JVMTIAgent encryption dynamic library file and encrypts dynamic library file pair with the JVMTIAgent The JVMTIAgent decryption dynamic library file answered.
In specific implementation, receives JVMTIAgent encryption dynamic library file and encrypt dynamic with the JVMTI Agent The corresponding JVMTIAgent of library file decrypts dynamic library file.JVMTIAgent encrypts dynamic library file and JVMTIAgent solution Close dynamic library file is write using C++ or C language, and it is high to crack difficulty.JVMTIAgent encrypts dynamic library file It is encrypted for the Class file to Jar packet, and JVMTIAgent decryption dynamic library file is used to encrypt JVMTIAgent The encrypted file of dynamic library file is decrypted.
In one embodiment, the JVMTIAgent is encrypted into dynamic library file and JVMTIAgent decryption dynamic Library file storage, is called in order to load.
S22 encrypts dynamic library file to the Jar packet of the self defined class loader by the JVMTIAgent Class file is encrypted to obtain the second encryption Jar packet.
In specific implementation, dynamic library file is encrypted to the Jar of the self defined class loader by the JVMTIAgent The Class file of packet is encrypted to obtain the second encryption Jar packet.
S33 carries out JVMTIAgent decryption to the second encryption Jar packet to obtain the self defined class loader.
In specific implementation, when needing to the first encryption Jar packet decryption, first the second encryption Jar packet is carried out JVMTIAgent is decrypted to obtain the self defined class loader.
In one embodiment, above step S33 specifically comprises the following steps: to decrypt dynamic by the JVMTI Agent The second encryption Jar packet is decrypted to obtain the self defined class loader in library file.
S34 is decrypted the first encryption Jar packet by the self defined class loader described to be encrypted to obtain Jar packet.
In specific implementation, by carrying out JVMTIAgent decryption to the second encryption Jar packet to obtain described make by oneself After adopted Classloader, by the self defined class loader to the first encryption Jar packet be decrypted with described in obtaining to Jar packet is encrypted, and then the deployment to Jar packet to be encrypted may be implemented.
Fig. 4 is a kind of schematic block diagram of Jar packet encryption handling device 60 provided in an embodiment of the present invention.As shown in figure 4, Corresponding to the above Jar packet encryption management method, the present invention also provides a kind of Jar packet encryption handling devices 60.Jar packet encryption pipe Reason device 60 includes the unit for executing above-mentioned Jar packet encryption management method, which can be configured in desktop computer, put down Plate computer, laptop computer, etc. in terminals.Specifically, referring to Fig. 4, the Jar packet encryption handling device 60 includes that the first encryption is single Member 61 and the second encryption unit 62.
First encryption unit 61, if for receiving Jar packet to be encrypted, by preset self defined class loader to described The Class file of Jar packet to be encrypted carries out the encryption of preset algorithm to obtain the first encryption Jar packet.
Second encryption unit 62, the Class file for the Jar packet to the self defined class loader carry out JVMTIAgent is encrypted to obtain the second encryption Jar packet.
In one embodiment, as shown in figure 5, second encryption unit 62 includes receiving unit 621, third encryption unit 622 and storage element 623.
Receiving unit 621, for receiving JVMTIAgent encryption dynamic library file and being encrypted with the JVMTI Agent The corresponding JVMTIAgent of dynamic library file decrypts dynamic library file.
Third encryption unit 622 adds the self defined class for encrypting dynamic library file by the JVMTIAgent The Class file for carrying the Jar packet of device is encrypted to obtain the second encryption Jar packet.
Storage element 623, for storing the JVMTIAgent encryption dynamic library file and JVMTI Agent solution Close dynamic library file.
Fig. 6 be another embodiment of the present invention provides a kind of Jar packet encryption handling device 60 schematic block diagram.Such as Fig. 6 It is shown, the Jar packet encryption handling device 60 of the present embodiment be increase on the basis of above-described embodiment the first decryption unit 63 with And second decryption unit 64.
First decryption unit 63, obtained for carrying out JVMTIAgent decryption to the second encryption Jar packet it is described certainly Define Classloader.
Second decryption unit 64, for the first encryption Jar packet to be decrypted by the self defined class loader To obtain the Jar packet to be encrypted.
In one embodiment, as shown in fig. 7, first decryption unit 63 includes third decryption unit 631.
Third decryption unit 631, for decrypting dynamic library file to the second encryption Jar by the JVMTIAgent Packet is decrypted to obtain the self defined class loader.
It should be noted that it is apparent to those skilled in the art that, above-mentioned Jar packet encryption handling device 60 and each unit specific implementation process, can with reference to the corresponding description in preceding method embodiment, for convenience of description and Succinctly, details are not described herein.
Above-mentioned Jar packet encryption handling device 60 can be implemented as a kind of form of computer program, which can To be run in computer equipment as shown in Figure 8.
Referring to Fig. 8, Fig. 8 is a kind of schematic block diagram of computer equipment provided by the embodiments of the present application.The computer Equipment 500 can be terminal, be also possible to server, wherein terminal can be smart phone, tablet computer, laptop, Desktop computer, personal digital assistant and wearable device etc. have the electronic equipment of communication function.Server can be independent Server is also possible to the server cluster of multiple server compositions.
Refering to Fig. 8, which includes processor 502, memory and the net connected by system bus 501 Network interface 505, wherein memory may include non-volatile memory medium 503 and built-in storage 504.
The non-volatile memory medium 503 can storage program area 5031 and computer program 5032.The computer program 5032 are performed, and processor 502 may make to execute a kind of Jar packet encryption management method.
The processor 502 is for providing calculating and control ability, to support the operation of entire computer equipment 500.
The built-in storage 504 provides environment for the operation of the computer program 5032 in non-volatile memory medium 503, should When computer program 5032 is executed by processor 502, processor 502 may make to execute a kind of Jar packet encryption management method.
The network interface 505 is used to carry out network communication with other equipment.It will be understood by those skilled in the art that in Fig. 8 The structure shown, only the block diagram of part-structure relevant to application scheme, does not constitute and is applied to application scheme The restriction of computer equipment 500 thereon, specific computer equipment 500 may include more more or fewer than as shown in the figure Component perhaps combines certain components or with different component layouts.
Wherein, the processor 502 is for running computer program 5032 stored in memory, to realize following step It is rapid:
If receiving Jar packet to be encrypted, by preset self defined class loader to the Class of the Jar packet to be encrypted File carries out the encryption of preset algorithm to obtain the first encryption Jar packet;
JVMTIAgent encryption is carried out to the Class file of the Jar packet of the self defined class loader to add to obtain second MiJarBao.
In one embodiment, processor 502 is in the Class text for realizing the Jar packet to the self defined class loader When part carries out JVMTIAgent encryption to obtain the second encryption Jar packet step, it is implemented as follows step:
Receive JVMTIAgent encryption dynamic library file and with the JVMTIAgent encryption dynamic library file it is corresponding JVMTIAgent decrypts dynamic library file;
Dynamic library file is encrypted to the Class text of the Jar packet of the self defined class loader by the JVMTIAgent Part is encrypted to obtain the second encryption Jar packet;
Store the JVMTIAgent encryption dynamic library file and JVMTIAgent decryption dynamic library file.
In one embodiment, processor 502 also realizes following steps:
JVMTIAgent decryption is carried out to obtain the self defined class loader to the second encryption Jar packet;
The first encryption Jar packet is decrypted to obtain the Jar to be encrypted by the self defined class loader Packet.
In one embodiment, processor 502 is described to the second encryption Jar packet progress JVMTI Agent solution in realization It is close to obtain the self defined class loader step when, be implemented as follows step:
The second encryption Jar packet is decrypted by JVMTIAgent decryption dynamic library file described to obtain Self defined class loader.
It should be appreciated that in the embodiment of the present application, processor 502 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable GateArray, FPGA) or other programmable logic devices Part, discrete gate or transistor logic, discrete hardware components etc..Wherein, general processor can be microprocessor or The processor is also possible to any conventional processor etc..
Those of ordinary skill in the art will appreciate that be realize above-described embodiment method in all or part of the process, It is that relevant hardware can be instructed to complete by computer program.The computer program can be stored in a storage medium, The storage medium is computer readable storage medium.The computer program is held by least one processor in the computer system Row, to realize the process step of the embodiment of the above method.
Therefore, the present invention also provides a kind of storage mediums.The storage medium can be computer readable storage medium.This is deposited Storage media is stored with computer program.The computer program makes processor execute following steps when being executed by processor:
If receiving Jar packet to be encrypted, by preset self defined class loader to the Class of the Jar packet to be encrypted File carries out the encryption of preset algorithm to obtain the first encryption Jar packet;
JVMTIAgent encryption is carried out to the Class file of the Jar packet of the self defined class loader to add to obtain second MiJarBao.
In one embodiment, the processor is realized and described is added to the self defined class executing the computer program When carrying the Class file progress JVMTIAgent encryption of the Jar packet of device to obtain the second encryption Jar packet step, specific implementation is such as Lower step:
Receive JVMTIAgent encryption dynamic library file and with the JVMTIAgent encryption dynamic library file it is corresponding JVMTIAgent decrypts dynamic library file;
Dynamic library file is encrypted to the Class text of the Jar packet of the self defined class loader by the JVMTIAgent Part is encrypted to obtain the second encryption Jar packet;
Store the JVMTIAgent encryption dynamic library file and JVMTIAgent decryption dynamic library file.
In one embodiment, the processor also realizes following steps in the execution computer program:
JVMTIAgent decryption is carried out to obtain the self defined class loader to the second encryption Jar packet;
The first encryption Jar packet is decrypted to obtain the Jar to be encrypted by the self defined class loader Packet.
In one embodiment, the processor is realized described to second encryption in the execution computer program When Jar packet carries out JVMTIAgent decryption to obtain the self defined class loader step, it is implemented as follows step:
The second encryption Jar packet is decrypted by JVMTIAgent decryption dynamic library file described to obtain Self defined class loader.
The storage medium is entity, non-transient storage medium, such as can be USB flash disk, mobile hard disk, read-only deposits The various tangible storage medias that can store program code such as reservoir (Read-OnlyMemory, ROM), magnetic or disk.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not It is considered as beyond the scope of this invention.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary.For example, the division of each unit, only Only a kind of logical function partition, there may be another division manner in actual implementation.Such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.This hair Unit in bright embodiment device can be combined, divided and deleted according to actual needs.In addition, in each implementation of the present invention Each functional unit in example can integrate in one processing unit, is also possible to each unit and physically exists alone, can also be with It is that two or more units are integrated in one unit.
If the integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product, It can store in one storage medium.Based on this understanding, technical solution of the present invention is substantially in other words to existing skill The all or part of part or the technical solution that art contributes can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, terminal or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in some embodiment Part, reference can be made to the related descriptions of other embodiments.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, the even these modifications and changes of the present invention range that belongs to the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right It is required that protection scope subject to.

Claims (10)

1. a kind of Jar packet encryption management method characterized by comprising
If receiving Jar packet to be encrypted, by preset self defined class loader to the Class file of the Jar packet to be encrypted The encryption of preset algorithm is carried out to obtain the first encryption Jar packet;
JVMTIAgent is carried out to the Class file of the Jar packet of the self defined class loader to encrypt to obtain the second encryption Jar Packet.
2. Jar packet encryption management method according to claim 1, which is characterized in that the method also includes:
JVMTIAgent decryption is carried out to obtain the self defined class loader to the second encryption Jar packet;
The first encryption Jar packet is decrypted to obtain the Jar packet to be encrypted by the self defined class loader.
3. Jar packet encryption management method according to claim 2, which is characterized in that described to be loaded to the self defined class The Class file of the Jar packet of device carries out JVMTIAgent and encrypts to obtain the second encryption Jar packet, comprising:
Receive JVMTIAgent encryption dynamic library file and with the JVMTIAgent encryption dynamic library file it is corresponding JVMTIAgent decrypts dynamic library file;
By the JVMTIAgent encrypt dynamic library file to the Class file of the Jar packet of the self defined class loader into Row encryption is to obtain the second encryption Jar packet.
4. Jar packet encryption management method according to claim 3, which is characterized in that described to the second encryption Jar packet JVMTIAgent decryption is carried out to obtain the self defined class loader, comprising:
Dynamic library file is decrypted by the JVMTIAgent the second encryption Jar packet is decrypted to obtain described make by oneself Adopted Classloader.
5. Jar packet encryption management method according to claim 3, which is characterized in that described to be loaded to the self defined class The Class file of the Jar packet of device carries out JVMTIAgent and encrypts to obtain the second encryption Jar packet, further includes:
Store the JVMTIAgent encryption dynamic library file and JVMTIAgent decryption dynamic library file.
6. Jar packet encryption management method according to claim 1, which is characterized in that the preset algorithm is asymmetric adds Close algorithm.
7. a kind of Jar packet encryption handling device characterized by comprising
First encryption unit, if for receiving Jar packet to be encrypted, by preset self defined class loader to described to be encrypted The Class file of Jar packet carries out the encryption of preset algorithm to obtain the first encryption Jar packet;
Second encryption unit, the Class file for the Jar packet to the self defined class loader carry out JVMTI Agent and add It is close to obtain the second encryption Jar packet.
8. Jar packet encryption handling device according to claim 7, which is characterized in that the Jar packet encryption handling device is also Include:
First decryption unit, for carrying out JVMTIAgent decryption to the second encryption Jar packet to obtain the self defined class Loader;
Second decryption unit, for being decrypted the first encryption Jar packet to obtain by the self defined class loader The Jar packet to be encrypted.
9. a kind of computer equipment, which is characterized in that the computer equipment includes memory and processor, on the memory It is stored with computer program, the processor is realized as described in any one of claim 1-6 when executing the computer program Method.
10. a kind of computer readable storage medium, which is characterized in that the storage medium is stored with computer program, the meter Calculation machine program can be realized when being executed by a processor such as method of any of claims 1-6.
CN201910809279.0A 2019-08-29 2019-08-29 Jar packet encryption management method, device, computer equipment and storage medium Pending CN110532737A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910809279.0A CN110532737A (en) 2019-08-29 2019-08-29 Jar packet encryption management method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910809279.0A CN110532737A (en) 2019-08-29 2019-08-29 Jar packet encryption management method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110532737A true CN110532737A (en) 2019-12-03

Family

ID=68665278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910809279.0A Pending CN110532737A (en) 2019-08-29 2019-08-29 Jar packet encryption management method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110532737A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314321A (en) * 2020-01-21 2020-06-19 深圳前海环融联易信息科技服务有限公司 Parameter encryption management method and device, computer equipment and storage medium
CN112131536A (en) * 2020-05-19 2020-12-25 北京天德科技有限公司 Method for preventing Java program from being decompiled
CN113221077A (en) * 2021-05-31 2021-08-06 平安科技(深圳)有限公司 Class file encryption method and equipment based on spring container

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1325411A2 (en) * 2000-10-11 2003-07-09 Sealedmedia Limited Methods of providing java tamperproofing
CN102346834A (en) * 2011-11-25 2012-02-08 武汉钢铁(集团)公司 Method for encrypting and protecting Java application software
CN102360412A (en) * 2011-09-26 2012-02-22 飞天诚信科技股份有限公司 Method and system for protecting Java source code
CN103853943A (en) * 2014-02-18 2014-06-11 优视科技有限公司 Program protection method and device
CN105022936A (en) * 2014-04-30 2015-11-04 北京畅游天下网络技术有限公司 Class file encryption and decryption method and class file encryption and decryption device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1325411A2 (en) * 2000-10-11 2003-07-09 Sealedmedia Limited Methods of providing java tamperproofing
CN102360412A (en) * 2011-09-26 2012-02-22 飞天诚信科技股份有限公司 Method and system for protecting Java source code
CN102346834A (en) * 2011-11-25 2012-02-08 武汉钢铁(集团)公司 Method for encrypting and protecting Java application software
CN103853943A (en) * 2014-02-18 2014-06-11 优视科技有限公司 Program protection method and device
CN105022936A (en) * 2014-04-30 2015-11-04 北京畅游天下网络技术有限公司 Class file encryption and decryption method and class file encryption and decryption device

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
CHINRUI: "自定义加密的类加载器", 《HTTPS://WWW.ITEYE.COM/BLOG/CHINRUI-1935053》 *
CJNETWORK: "java源程序加密解决方案(基于Classloader解密", 《HTTPS://BLOG.CSDN.NET/CJNETWORK/ARTICLE/DETAILS/83801823?SPM=1001.2101.3001.6650.6&UTM_MEDIUM》 *
DAOCHUWENZIYAO: "自定义ClassLoader对Class加密并解密", 《HTTPS://BLOG.CSDN.NET/DAOCHUWENZIYAO/ARTICLE/DETAILS/77726232?SPM=1001.2101.3001.6650.9&UTM_MEDIUM》 *
JEECG官方博客: "利用自定义的 ClassLoader 加密 Java Class 文件", 《HTTPS://BLOG.CSDN.NET/ZHANGDAISCOTT/ARTICLE/DETAILS/73135656?UTM_MEDIUM》 *
SHAWN ZHANG: "JAVA加密解密---自定义类加载器应用", 《HTTPS://WWW.CNBLOGS.COM/HEKEBOY/ARCHIVE/2007/05/09/740072.HTML》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314321A (en) * 2020-01-21 2020-06-19 深圳前海环融联易信息科技服务有限公司 Parameter encryption management method and device, computer equipment and storage medium
CN112131536A (en) * 2020-05-19 2020-12-25 北京天德科技有限公司 Method for preventing Java program from being decompiled
CN113221077A (en) * 2021-05-31 2021-08-06 平安科技(深圳)有限公司 Class file encryption method and equipment based on spring container
CN113221077B (en) * 2021-05-31 2023-11-14 平安科技(深圳)有限公司 Class file encryption method and equipment based on spring container

Similar Documents

Publication Publication Date Title
EP3387813B1 (en) Mobile device having trusted execution environment
US11848922B2 (en) Cryptographic systems and methods
US9135434B2 (en) System and method for third party creation of applications for mobile appliances
CN109583189A (en) Firmware method for secure loading, device, computer equipment and storage medium
CN107196907B (en) A kind of guard method of Android SO files and device
CN110532737A (en) Jar packet encryption management method, device, computer equipment and storage medium
CN106295370A (en) A kind of method and apparatus of the dynamic link library (DLL) file reinforcing installation kit
CN110058843B (en) Pseudo-random number generation method and device and server
CN110210188A (en) Code encryption method, apparatus, equipment and storage medium under Spring frame
Kotla et al. Pasture: Secure offline data access using commodity trusted hardware
US10572635B2 (en) Automatic correction of cryptographic application program interfaces
CN105229659A (en) Obscure by the access of software application to data storage device
CN107508839A (en) A kind of method and apparatus for controlling web system unauthorized access
CN109255246A (en) Interface parameters encryption method, device, computer equipment and storage medium
CN111159658B (en) Byte code processing method, system, device, computer equipment and storage medium
CN106548351A (en) A kind of optimization method and terminal of fingerprint payment flow
CN103605927A (en) Encryption and decryption method based on embedded Linux system
CN111078224A (en) Software package file data processing method and device, computer equipment and storage medium
CN109995534B (en) Method and device for carrying out security authentication on application program
CN104751026B (en) Method for protecting software, software application method and the relevant apparatus of Android system
JP6899308B2 (en) Information processing device and data processing method of information processing device
CN109274656A (en) Interface parameters decryption method, device, computer equipment and storage medium
CN115118520A (en) Data processing method and device and server
US9760693B2 (en) Method and apparatus for a content protecting and packaging system for protecting a content package
KR20220140638A (en) Model protection methods and devices, electronic devices, model protection systems, storage media and computer programs

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191203