CN107545189A - A kind of file preparation method and device - Google Patents
A kind of file preparation method and device Download PDFInfo
- Publication number
- CN107545189A CN107545189A CN201710493474.8A CN201710493474A CN107545189A CN 107545189 A CN107545189 A CN 107545189A CN 201710493474 A CN201710493474 A CN 201710493474A CN 107545189 A CN107545189 A CN 107545189A
- Authority
- CN
- China
- Prior art keywords
- file
- password
- program
- source code
- application
- 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
Links
Abstract
The embodiment of the present application provides a kind of file preparation method and device, is related to field of computer technology, wherein, the above method includes:Obtain the source code of encipheror, the decryption program to match with the encipheror and the application program to be packed write with interpreted languages;The source code of the application program to be packed is encrypted by the encipheror, obtains encryption file;Packing processing is carried out to the decryption program and the encryption file, the file after being packed.File after being packed using the method for the embodiment of the present application offer, the source code safety of application program can be protected.
Description
Technical field
The application is related to field of computer technology, more particularly to a kind of file preparation method and device.
Background technology
With the fast development of computer technology, various application programs are arisen at the historic moment, for example, application development
Person can be based on Node.js development and application programs, and finally the application program developed is carried out in a manner of Docker mirror images
Packing is handled, and it is end user that file, which is delivered, after being packed.
When wherein, based on Node.js development and application programs, application program is typically write using JavaScript language.By
It is a kind of interpreted languages in JavaScript language, is not needed using the application program that this kind of language is write in final perform
Compiling, only explained and performed in final perform, therefore when application program privatization is disposed, consigned to final
In the Docker mirror images of user the source code of the application program based on Node.js be disclose it is visible.Again due to Docker containers certainly
The positioning of body, it is not provided with the mechanism of the protective container content safeties such as encryption, therefore above-mentioned delivery end user
The potential safety hazard that application program source code is disclosed be present in Docker mirror images.
The content of the invention
The purpose of the embodiment of the present application is to provide a kind of file preparation method and device, and application program source is protected to carry
Code safety.Concrete technical scheme is as follows:
First aspect:A kind of file preparation method, methods described include:
Obtain encipheror, the decryption program to match with the encipheror and wait to pack with what interpreted languages were write
The source code of application program;
The source code of the application program to be packed is encrypted by the encipheror, obtains encryption file;
Packing processing is carried out to the decryption program and the encryption file, the file after being packed.
Second aspect:A kind of file preparation method, methods described include:
File destination is obtained, wherein, the file destination is:Are carried out by packing and handles to obtain for decryption program and encryption file
File, it is described encryption file be:Pass through the source code with the encipheror that the decryption program matches to destination application
Obtained file is encrypted, the destination application is:The application program write with interpreted languages;
Run the decryption program and processing is decrypted to the encryption file, obtain the source of the destination application
Code.
The third aspect:A kind of file obtains device, and described device includes:
Module is obtained, for obtaining encipheror, the decryption program to match with the encipheror and with explanation type language
Say the source code for the application program to be packed write;
Encrypting module, for the source code of the application program to be packed to be encrypted by the encipheror,
Obtain encryption file;
Packetization module, for carrying out packing processing to the decryption program and the encryption file, the text after being packed
Part.
Fourth aspect:A kind of file obtains device, and described device includes:
Module is obtained, for obtaining file destination, wherein, the file destination is:Decryption program and encryption file are entered
Row packing handles obtained file, and the encryption file is:By the encipheror that matches with the decryption program to target
Obtained file is encrypted in the source code of application program, and the destination application is:Answered with what interpreted languages were write
Use program;
Deciphering module, processing is decrypted to the encryption file for running the decryption program, obtains the target
The source code of application program.
5th aspect:A kind of electronic equipment, including:Processor and machinable medium, the machine readable storage
Media storage has can be by the machine-executable instruction of the computing device, and the processor is by the machine-executable instruction
Promote:Realize the method and step described in aforementioned first aspect embodiment.
6th aspect:A kind of electronic equipment, including:Processor and machinable medium, the machine readable storage
Media storage has can be by the machine-executable instruction of the computing device, and the processor is by the machine-executable instruction
Promote:Realize the method and step described in foregoing second aspect embodiment.
7th aspect:A kind of machinable medium, is stored with machine-executable instruction, is being called and is being held by processor
During row, the machine-executable instruction promotes the processor:Realize the method and step described in aforementioned first aspect embodiment.
Eighth aspect:A kind of machinable medium, is stored with machine-executable instruction, is being called and is being held by processor
During row, the machine-executable instruction promotes the processor:Realize the method and step described in foregoing second aspect embodiment.
In file preparation method and device that the embodiment of the present application provides, the file after packing be by decryption program and
Encryption file carries out packing and handles what is obtained, wherein, encryption file is that the source code for treating packing application program is encrypted
Obtained file, what is included in the file after so packing is to treat obtained file after the source code encryption of packing application program,
Based on this, although the source code of application program to be packed is write with interpreted languages, after above-mentioned source code is encrypted
Obtained file is private in the case of no decryption, thus can effectively protect packing after file in it is above-mentioned wait beat
The source code safety of bag application program.
Brief description of the drawings
, below will be to embodiment or existing in order to illustrate more clearly of the embodiment of the present application or technical scheme of the prior art
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of application, for those of ordinary skill in the art, on the premise of not paying creative work, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet for the first file preparation method that the embodiment of the present application provides;
Fig. 2 is the schematic flow sheet for second of file preparation method that the embodiment of the present application provides;
Fig. 3 is the structural representation that the first file that the embodiment of the present application provides obtains device;
Fig. 4 is the structural representation that second of file that the embodiment of the present application provides obtains device.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only some embodiments of the present application, rather than whole embodiments.It is based on
Embodiment in the application, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of the application protection.
Fig. 1 is the schematic flow sheet for the first file preparation method that the embodiment of the present application provides, and this method includes:
S101:Obtain encipheror, the decryption program to match with encipheror and wait to beat with what interpreted languages were write
The source code of bag application program.
Above-mentioned encipheror can be understood as:For the program that operation object is encrypted;
Above-mentioned decryption program can be understood as:For the encrypted result of aforesaid operations object being decrypted the journey of processing
Sequence, wherein, the encrypted result of operation object is:The result that operation object is encrypted by above-mentioned encipheror.
In addition, above-mentioned encipheror and decryption program occur in pairs, that is, above-mentioned encipheror can be understood as
It is the inverse process of above-mentioned decryption program.
In the embodiment of the present application, aforesaid operations object can be understood as:The source code of application program to be packed.
It should be noted that above-mentioned encipheror and decryption program are the programs functionally divided, in actual generation
Code can correspond to two functional modules of a program when realizing, for example, encipheror corresponds to the encryption of encryption and decryption program
Module, decryption program correspond to the deciphering module of the encryption and decryption program, may correspond to two separate programs.
It will be appreciated by persons skilled in the art that computer language can be divided into a variety of differences from the point of view of from different perspectives
Type, for example, interpreted languages, compiled language etc..
Wherein, it need not be compiled in final perform with the application program that interpreted languages are write, only finally performed
When explained and performed, so file after the packing for the application program write with the language of this type, such as Docker mirror images,
Its source code be disclose it is visible, for example, interpreted languages include:JavaScript language, Python etc.;
Need to compile before final perform with the application program that compiled language is write, for example, compiled language pack contains:C
Language, C Plus Plus etc..
S102:The source code that packing application program is treated by encipheror is encrypted, and obtains encryption file.
When the source code of application program being encrypted by encipheror, generally requiring combining cipher could complete pair
The encryption of the source code of application program.
Wherein, the above-mentioned password for being used to the source code of application program be encrypted can be the password made an appointment,
The password according to certain password create-rule generation is can also be, for example, the password generated at random, the mark according to application program
Password of the information such as knowledge generation etc..The application only illustrates as example, is defined in practical application not to this.
S103:Packing processing is carried out to decryption program and encryption file, the file after being packed.
Packing processing is carried out to decryption program and encryption file to carry out by strapping tool, wherein, above-mentioned baler
Tool can be Docker etc..
When above-mentioned strapping tool is Docker, the file after the packing obtained after packing processing is Docker mirrors
Picture.
In the file preparation method that the present embodiment provides, the file after packing is by entering to decryption program and encryption file
Row packing handles what is obtained, wherein, above-mentioned encryption file be treat packing application program source code be encrypted after obtain
File, what is included in the file after so packing is to treat obtained file after the source code encryption of packing application program, is based on
This, although the source code of application program to be packed is write with interpreted languages, obtains after above-mentioned source code is encrypted
File be private in the case of no decryption, therefore can effectively protect packing after file in it is above-mentioned treat packing should
With the source code safety of program.
Those skilled in that art are it is understood that polytype, a kind of realization of the application be present in computer language
In mode, above-mentioned decryption program is the program write with compiled language, for example, C language.Certain above-mentioned encipheror can also
The program write with compiled language, the application not to encipheror used by the type of computer language limit
It is fixed.Based on the above situation, in this implementation,
Above by encipheror treat packing application program source code be encrypted the step of (S102), including:
A1:Obtain the password being encrypted for treating the source code of packing application program.
, so can be with specifically, above-mentioned password can be the password for generating and obtaining according to default password create-rule
Using different passwords when ensureing to pack to different application programs;Above-mentioned password still can be the password made an appointment, this
Application is defined not to this.
A2:The source code for treating packing application program with the password obtained by encipheror is encrypted.
It is above-mentioned that packing processing is carried out to decryption program and encryption file, the step of file after being packed (S103), wrap
Include:
B1:The password obtained is arranged in decryption program, and to setting the decryption program after password to be compiled.
B2:Packing processing is carried out to the decryption program after compiling and encryption file, the file after being packed.
In the scheme that the present embodiment provides, when generating the file after the packing of application program every time, in decryption program
The password used when being provided for that application program is encrypted, is then compiled to decryption program again, after compiling
File is for a user and non-public visible, even if so user takes the file after the compiling of decryption program, it is also difficult to obtain
The password that must be provided with, and be difficult to obtain decryption program, and then enable to the file security after the packing that ultimately generates
It is higher.
In another implementation of the application, during the file after obtaining above-mentioned packing, pass through encipheror
After the source code encryption for treating packing application program, packing application program can also be treated by condensing routine and is compressed processing,
File after the packing that can so to finally give takes less memory space.
In addition, treat packing application program be compressed processing after, for ensure parsing packing after file when can be accurate
Decompress it is above-mentioned through overcompression handle application program pack, it is above-mentioned to decryption program and encryption file carry out packing handle when,
Packing processing can be carried out to decryption program, gunzip and encryption file.
It should be noted that above-mentioned condensing routine, gunzip are also from function with decryption program, identical encipheror
Angle divided, above-mentioned condensing routine, gunzip and decryption program, encipheror phase similar with afore-mentioned
It can be seemingly the functional module of same program, can also be a single program, the application is defined not to this.
It will be appreciated by persons skilled in the art that the text after being packed using the scheme of above-mentioned each embodiment offer
After part, need to perform the file after above-mentioned packing in application scenes, and then need to add the warp in the file after packing
Processing is decrypted in the source code of application program after close processing, and the source code for the program that is applied, based on this, the embodiment of the present application carries
Another file preparation method is supplied, to obtain the source code of application program.
Fig. 2 is the schematic flow sheet for second of file preparation method that the embodiment of the present application provides, and this method includes:
S201:Obtain file destination.
Wherein, file destination is:The file that packing handles to obtain is carried out to decryption program and encryption file, encrypts file
For:By the file for being encrypted to obtain to the source code of destination application with the encipheror that decryption program matches,
Destination application is:The application program write with interpreted languages.
Encipheror and decryption program mentioned in the present embodiment and the encipheror that is referred in embodiment illustrated in fig. 1 and
Decryption program difference is identical, will not be repeated here.
When being encrypted to obtain encryption file to the source code of application program by encipheror, generally require with reference to close
Code could complete the encryption to the source code of application program.
Wherein, the above-mentioned password for being used to the source code of application program be encrypted can be the password made an appointment,
The password generated according to default password create-rule is can also be, for example, the password generated at random, the mark according to application program
Password of the information such as knowledge generation etc..The application only illustrates as example, is defined in practical application not to this.
File destination is that the file that packing handles to obtain is carried out to decryption program and encryption file, therefore, above-mentioned target text
Decryption program and encryption file are comprised at least in part.
S202:Processing is decrypted to encryption file in operation decryption program, obtains the source code of destination application.
Above-mentioned decryption program can exist in the form of file after compiling, and the application is defined not to this.
In the file preparation method that the present embodiment provides, file destination is by beating decryption program and encryption file
Bag handles what is obtained, and encryption file is the text for being encrypted to obtain to the source code of destination application by encipheror
Part, what is included in such file destination is the file obtained after source code encryption to destination application, passes through decryption processing
The source code of destination application can be obtained, therefore, although the source code of destination application is write with interpreted languages,
File destination where the source code of destination application is private in the case of no decryption, therefore can effectively be protected
The source code safety of destination application.
Those skilled in that art are it is understood that polytype, a kind of realization of the application be present in computer language
In mode, above-mentioned decryption program is the program write with compiled language.
In addition, in this implementation, file destination is:Are carried out by packing and handles what is obtained for file after compiling and encryption file
File, file is after compiling:Target password is set to decryption program and to setting the decryption program after password to be compiled to obtain
File, target password is:The password used when the source code of destination application being encrypted by encipheror.
Specifically, when the source code of destination application is encrypted by encipheror, above-mentioned target password
It can be the password generated according to default password create-rule, can so ensure to being used during different application program packings
Different passwords;Above-mentioned target password still can be the password made an appointment, and the application is defined not to this.
Processing is decrypted to encryption file in above-mentioned operation decryption program, the step of obtaining the source code of destination application
(S202), including:
C1:File after above-mentioned compiling is run, processing, acquisition intended application encryption file are decrypted based on target password
The source code of program.
Because file is file after the compiling of decryption program after above-mentioned compiling, therefore file can be to machine after running the compiling
Processing is decrypted in ciphertext part, and due to being provided with target password wherein before being compiled to decryption program, more than
File understand that target password for above-mentioned encryption file to be decrypted after stating compiling, because running above-mentioned compiling hereinafter
After part, processing successfully can be decrypted to encryption file, and then obtain the source code of destination application.
Due to during file destination is obtained, after being encrypted by encipheror to the source code of destination application, going back
Processing can be compressed to destination application by condensing routine, the file destination that can so to finally give takes
Less memory space, therefore, in a kind of implementation of the application, above-mentioned file destination can be:To decryption program, solution
Condensing routine and encryption file carry out the file that packing handles to obtain, and above-mentioned encryption file is:Should to target by encipheror
It is encrypted with the source code of program and is compressed the file that processing obtains to encrypted result by condensing routine.
Therefore, when processing is decrypted to encryption file in operation decryption program, above-mentioned gunzip pair can be first used
Encrypt file and carry out decompression, processing is decrypted to decompression result in decryption program of then reruning.
After completing above-mentioned decryption processing and obtaining the source code of destination application, destination application loading can be run
The source code of destination application is into internal memory.When being decompressed and decrypted by processing because progress is above-mentioned, corresponding decompression can be generated
Sheepshank fruit and decrypted result, when success operational objective application program after, can with above-mentioned decompression result and decrypted result with
Save memory space.In addition, the source code of destination application is included in decrypted result, and destination application is with explanation type language
What speech was write, so deleting decrypted result significantly more efficient can also protect the source code safety of destination application.
It should be noted that above-mentioned condensing routine, gunzip are also from function with decryption program, identical encipheror
Angle divided, above-mentioned condensing routine, gunzip and decryption program, encipheror phase similar with afore-mentioned
It can be seemingly the functional module of same program, can also be a single program, the application is defined not to this.
The two kinds of file preparation methods provided with reference to instantiation the embodiment of the present application are described in detail.
It is assumed that application program to be packed is to be write using JavaScript language for application program M, M based on Node.js
Application program, strapping tool is used by carrying out packing processing to M:Docker.Encipheror, decryption program, compression journey
Sequence and gunzip correspond respectively to four functional modules of encryption and decryption program:Encrypting module, deciphering module, compression module
And decompression module.
Based on the above situation, the process that developer carries out packing processing generation Docker mirror images to M is as follows:
Step 1:Password X for M source code to be encrypted is obtained using random fashion;And pass through encryption and decryption journey
M source code is encrypted with password X for encrypting module in sequence, the file N1 after being encrypted;And pass through encryption and decryption journey
Compression module in sequence is compressed processing to file N, obtains file N2;
Step 2:Password X is arranged in the deciphering module of encryption and decryption program, and to decryption program corresponding to deciphering module
It is compiled, file Y after being compiled;Packing processing is carried out to file Y and file N2 by Docker, obtains M Docker
Mirror image.
It is as follows using the process of above-mentioned Docker mirror images in user rs environment:
Step 3:File Y is obtained from above-mentioned Docker mirror images, and runs Y, by the decompression module in Y to Docker
N2 in mirror image carries out decompression, obtains decompression result file N3;By being set in the deciphering module in Y and the module
Processing is decrypted to file N3 in the password X put, obtains decrypted result file N4.
Wherein, in the case of successful decompression and successful decryption, above-mentioned file N3 and file N1 are identicals, file N4
Corresponding to M source code.
After the above step can be with operating file N4 (M namely decrypted source code), can after successful operation N4
To delete above-mentioned decompression result and decryption destination file N3 and N4 from user rs environment.
Above-mentioned Node.js is the JavaScript running environment based on Google's V8 engines, due to having used time drive
Dynamic, non-block type I/O model, light weight are again efficient.
Docker is the application container an increased income engine, and developer can use Docker packing application programs and phase
Close and rely on bag into a portable container, be then published on any popular Linux machines, virtualization can also be realized.
Corresponding with the file preparation method shown in above-mentioned Fig. 1, the embodiment of the present application additionally provides a kind of file and filled
Put.
Fig. 3 is the structural representation that the first file that the embodiment of the present application provides obtains device, and the device includes:
Module 301 is obtained, for obtaining encipheror, the decryption program to match with the encipheror and with explanation type
The source code for the application program to be packed that language is write;
Encrypting module 302, for place to be encrypted to the source code of the application program to be packed by the encipheror
Reason, obtain encryption file;
Packetization module 303, for carrying out packing processing to the decryption program and the encryption file, after being packed
File.
Specifically, the decryption program is the program write with compiled language;
The encrypting module 302, including:
Password obtaining unit, it is close for the source code of the application program to be packed to be encrypted for obtaining
Code;
Ciphering unit, for the source code by the encipheror with the password that is obtained to the application program to be packed
It is encrypted;
The packetization module 303, specifically for the password obtained is arranged in the decryption program, and it is close to setting
The decryption program after code is compiled;Packing processing is carried out to the decryption program after compiling and the encryption file,
File after being packed.
Specifically, the password obtaining unit, specifically for being generated according to default password create-rule for described
The source code of application program to be packed carries out the password of Cipher Processing, and obtains generated password;Or
It is making an appointment, close for the source code of the application program to be packed to be encrypted specifically for obtaining
Code.
The file that above-mentioned each embodiment provides is obtained in device, and the file after packing is by decryption program and encryption
File carries out packing and handles what is obtained, wherein, encryption file is that the source code for treating packing application program is encrypted to obtain
File, what is included in the file after so packing is to treat obtained file after the source code encryption of packing application program, is based on
This, although the source code of application program to be packed is write with interpreted languages, obtains after above-mentioned source code is encrypted
File be private in the case of no decryption, therefore can effectively protect packing after file in it is above-mentioned treat packing should
With the source code safety of program.
Corresponding with the file preparation method shown in above-mentioned Fig. 2, the embodiment of the present application additionally provides a kind of file and filled
Put
Fig. 4 is the structural representation that second of file that the embodiment of the present application provides obtains device, and the device includes:
Module 401 is obtained, for obtaining file destination, wherein, the file destination is:To decryption program and encryption file
The file that packing handles to obtain is carried out, the encryption file is:By the encipheror that matches with the decryption program to mesh
Obtained file is encrypted in the source code of mark application program, and the destination application is:Write with interpreted languages
Application program;
Deciphering module 402, processing is decrypted to the encryption file for running the decryption program, obtains the mesh
Mark the source code of application program.
Specifically, the decryption program is the program write with compiled language;
The file destination is:The file that packing handles to obtain, the compiling are carried out to file after compiling and encryption file
File is afterwards:Target password is set to the decryption program and to setting the encryption and decryption program after password to be compiled to obtain
File, the target password is:When the source code of the destination application being encrypted by the encipheror
The password of use;
The deciphering module 402, specifically for file after the operation compiling, based on the target password to the encryption
Processing is decrypted in file, obtains the source code of the destination application.
Specifically, the target password is:The password generated according to default password create-rule;Or make an appointment close
Code.
In the file preparation method that above-mentioned each embodiment provides, file destination is by decryption program and encryption file
Carry out packing and handle what is obtained, encryption file is that the source code of destination application is encrypted to obtain by encipheror
File, what is included in such file destination is the file obtained after source code encryption to destination application, at decryption
Reason can just obtain the source code of destination application, therefore, although the source code of destination application is write with interpreted languages,
But the file destination where the source code of destination application is private in the case of no decryption, therefore can be effective
Protect the source code safety of destination application.
Corresponding with file preparation method shown in Fig. 1, the embodiment of the present application additionally provides a kind of electronic equipment, including:Place
Manage device and machinable medium, the machinable medium is stored with can by the machine of the computing device
Execute instruction, the processor are promoted by the machine-executable instruction:Realize the first file that the embodiment of the present application provides
Preparation method.
Specifically, above-mentioned file preparation method, including:
Obtain encipheror, the decryption program to match with the encipheror and wait to pack with what interpreted languages were write
The source code of application program;
The source code of the application program to be packed is encrypted by the encipheror, obtains encryption file;
Packing processing is carried out to the decryption program and the encryption file, the file after being packed.
It should be noted that other implementations of above-mentioned file preparation method, other realities with the description of Fig. 1 relevant portions
Existing mode is identical, repeats no more here.
File after the packing that the electronic equipment that the present embodiment provides obtains is by entering to decryption program and encryption file
Row packing handles what is obtained, wherein, encryption file is that obtained file is encrypted in the source code for treating packing application program,
What is included in file after so packing is to treat obtained file after the source code encryption of packing application program, based on this, although
The source code of application program to be packed is write with interpreted languages, but the file obtained after above-mentioned source code is encrypted exists
It is private in the case of not decrypting, therefore can effectively protects above-mentioned application program to be packed in the file after packing
Source code safety.
Corresponding with file preparation method shown in Fig. 2, the embodiment of the present application additionally provides a kind of electronic equipment, including:Place
Manage device and machinable medium, the machinable medium is stored with can by the machine of the computing device
Execute instruction, the processor are promoted by the machine-executable instruction:Realize second of file that the embodiment of the present application provides
Preparation method.
Specifically, above-mentioned file preparation method, including:
File destination is obtained, wherein, the file destination is:Are carried out by packing and handles to obtain for decryption program and encryption file
File, it is described encryption file be:Pass through the source code with the encipheror that the decryption program matches to destination application
Obtained file is encrypted, the destination application is:The application program write with interpreted languages;
Run the decryption program and processing is decrypted to the encryption file, obtain the source of the destination application
Code.
It should be noted that other implementations of above-mentioned file preparation method, other realities with the description of Fig. 2 relevant portions
Existing mode is identical, repeats no more here.
The present embodiment provide electronic equipment obtain intended application file when, file destination be by decryption program and plus
Ciphertext part carries out packing and handles what is obtained, and encryption file is that place is encrypted to the source code of destination application by encipheror
Obtained file is managed, what is included in such file destination is the file obtained after being encrypted to the source code of destination application, is passed through
Decryption processing can just obtain the source code of destination application, therefore, although the source code of destination application is with interpreted languages
Write, but the file destination where the source code of destination application be in the case of no decryption it is private, therefore
The source code safety of destination application can effectively be protected.
It should be noted that storage medium can include random access memory (Random in above two electronic equipment
Access Memory, RAM), nonvolatile memory (Non-Volatile Memory, NVM) can also be included, for example, at least
One magnetic disk storage.Optionally, storage medium can also be at least one storage device for being located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processing, DSP), it is application specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other PLDs, discrete
Door or transistor logic, discrete hardware components.
Corresponding with file preparation method shown in Fig. 1, the embodiment of the present application additionally provides a kind of machinable medium,
Machine-executable instruction is stored with, when being called and being performed by processor, the machine-executable instruction promotes the processor:
Realize the first file preparation method that the embodiment of the present application provides.
Specifically, above-mentioned file preparation method, including:
Obtain encipheror, the decryption program to match with the encipheror and wait to pack with what interpreted languages were write
The source code of application program;
The source code of the application program to be packed is encrypted by the encipheror, obtains encryption file;
Packing processing is carried out to the decryption program and the encryption file, the file after being packed.
It should be noted that other implementations of above-mentioned file preparation method, other realities with the description of Fig. 1 relevant portions
Existing mode is identical, repeats no more here.
File after the packing that the electronic equipment that the present embodiment provides obtains is by entering to decryption program and encryption file
Row packing handles what is obtained, wherein, encryption file is that obtained file is encrypted in the source code for treating packing application program,
What is included in file after so packing is to treat obtained file after the source code encryption of packing application program, based on this, although
The source code of application program to be packed is write with interpreted languages, but the file obtained after above-mentioned source code is encrypted exists
It is private in the case of not decrypting, therefore can effectively protects above-mentioned application program to be packed in the file after packing
Source code safety.
Corresponding with file preparation method shown in Fig. 2, the embodiment of the present application additionally provides a kind of machinable medium,
Machine-executable instruction is stored with, when being called and being performed by processor, the machine-executable instruction promotes the processor:
Realize second of file preparation method that the embodiment of the present application provides.
Specifically, above-mentioned file preparation method, including:
File destination is obtained, wherein, the file destination is:Are carried out by packing and handles to obtain for decryption program and encryption file
File, it is described encryption file be:Pass through the source code with the encipheror that the decryption program matches to destination application
Obtained file is encrypted, the destination application is:The application program write with interpreted languages;
Run the decryption program and processing is decrypted to the encryption file, obtain the source of the destination application
Code.
It should be noted that other implementations of above-mentioned file preparation method, other realities with the description of Fig. 2 relevant portions
Existing mode is identical, repeats no more here.
The present embodiment provide electronic equipment obtain intended application file when, file destination be by decryption program and plus
Ciphertext part carries out packing and handles what is obtained, and encryption file is that place is encrypted to the source code of destination application by encipheror
Obtained file is managed, what is included in such file destination is the file obtained after being encrypted to the source code of destination application, is passed through
Decryption processing can just obtain the source code of destination application, therefore, although the source code of destination application is with interpreted languages
Write, but the file destination where the source code of destination application be in the case of no decryption it is private, therefore
The source code safety of destination application can effectively be protected.
It should be noted that herein, such as first and second or the like relational terms are used merely to a reality
Body or operation make a distinction with another entity or operation, and not necessarily require or imply and deposited between these entities or operation
In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Nonexcludability includes, so that process, method, article or equipment including a series of elements not only will including those
Element, but also the other element including being not expressly set out, or it is this process, method, article or equipment also to include
Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that
Other identical element also be present in process, method, article or equipment including the key element.
Each embodiment in this specification is described by the way of related, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.Especially for device,
For electronic equipment, machinable medium embodiment, because it is substantially similar to embodiment of the method, so the comparison of description
Simply, the relevent part can refer to the partial explaination of embodiments of method.
The preferred embodiment of the application is the foregoing is only, is not intended to limit the protection domain of the application.It is all
Any modification, equivalent substitution and improvements made within spirit herein and principle etc., it is all contained in the protection domain of the application
It is interior.
Claims (16)
1. a kind of file preparation method, it is characterised in that methods described includes:
Obtain encipheror, the decryption program to match with the encipheror and treat packing application with what interpreted languages were write
The source code of program;
The source code of the application program to be packed is encrypted by the encipheror, obtains encryption file;
Packing processing is carried out to the decryption program and the encryption file, the file after being packed.
2. according to the method for claim 1, it is characterised in that the decryption program is the journey write with compiled language
Sequence;
The described the step of source code of the application program to be packed is encrypted by the encipheror, including:
Obtain the password for the source code of the application program to be packed to be encrypted;
The source code of the application program to be packed is encrypted with the password obtained by the encipheror;
It is described to the decryption program and the encryption file carries out packing processing, the step of file after being packed, including:
The password obtained is arranged in the decryption program, and to setting the decryption program after password to be compiled;
Packing processing is carried out to the decryption program after compiling and the encryption file, the file after being packed.
3. according to the method for claim 2, it is characterised in that described to obtain for the source to the application program to be packed
The step of password that code is encrypted, including:
Generated according to default password create-rule for carrying out the close of Cipher Processing to the source code of the application program to be packed
Code, and obtain generated password;Or
Obtain password making an appointment, for the source code of the application program to be packed to be encrypted.
4. a kind of file preparation method, it is characterised in that methods described includes:
File destination is obtained, wherein, the file destination is:The text that packing handles to obtain is carried out to decryption program and encryption file
Part, the encryption file are:By being carried out with the encipheror that the decryption program matches to the source code of destination application
The file that encryption obtains, the destination application are:The application program write with interpreted languages;
Run the decryption program and processing is decrypted to the encryption file, obtain the source code of the destination application.
5. according to the method for claim 4, it is characterised in that
The decryption program is the program write with compiled language;
The file destination is:The file that packing handles to obtain is carried out to file after compiling and encryption file, the compiling is hereinafter
Part is:Target password is set to the decryption program and to setting the decryption program after password to be compiled obtained text
Part, the target password are:Used when the source code of the destination application being encrypted by the encipheror
Password;
Processing is decrypted to the encryption file in the operation decryption program, obtains the source code of the destination application
The step of, including:
File after the compiling is run, processing is decrypted to the encryption file based on the target password, obtains the mesh
Mark the source code of application program.
6. according to the method for claim 5, it is characterised in that
The target password is:The password generated according to default password create-rule;Or the password made an appointment.
7. a kind of file obtains device, it is characterised in that described device includes:
Module is obtained, for obtaining encipheror, the decryption program to match with the encipheror and being compiled with interpreted languages
The source code for the application program to be packed write;
Encrypting module, for the source code of the application program to be packed to be encrypted by the encipheror, obtain
Encrypt file;
Packetization module, for carrying out packing processing to the decryption program and the encryption file, the file after being packed.
8. device according to claim 7, it is characterised in that the decryption program is the journey write with compiled language
Sequence;
The encrypting module, including:
Password obtaining unit, for obtaining the password for being used for that the source code of the application program to be packed to be encrypted;
Ciphering unit, for being carried out by the encipheror with the password obtained to the source code of the application program to be packed
Encryption;
The packetization module, specifically for the password obtained is arranged in the decryption program, and to set password after
The decryption program is compiled;Packing processing is carried out to the decryption program after compiling and the encryption file, beaten
File after bag.
9. device according to claim 8, it is characterised in that
The password obtaining unit, specifically for being generated according to default password create-rule for treating that journey is applied in packing to described
The source code of sequence carries out the password of Cipher Processing, and obtains generated password;Or
Specifically for obtaining password making an appointment, for the source code of the application program to be packed to be encrypted.
10. a kind of file obtains device, it is characterised in that described device includes:
Module is obtained, for obtaining file destination, wherein, the file destination is:Decryption program and encryption file are beaten
Bag handles obtained file, and the encryption file is:By the encipheror that matches with the decryption program to intended application
Obtained file is encrypted in the source code of program, and the destination application is:The application journey write with interpreted languages
Sequence;
Deciphering module, processing is decrypted to the encryption file for running the decryption program, obtains the intended application
The source code of program.
11. device according to claim 10, it is characterised in that
The decryption program is the program write with compiled language;
The file destination is:The file that packing handles to obtain is carried out to file after compiling and encryption file, the compiling is hereinafter
Part is:Target password is set to the decryption program and to setting the encryption and decryption program after password to be compiled obtained text
Part, the target password are:Used when the source code of the destination application being encrypted by the encipheror
Password;
The deciphering module, specifically for file after the operation compiling, the encryption file is entered based on the target password
Row decryption processing, obtain the source code of the destination application.
12. device according to claim 11, it is characterised in that
The target password is:The password generated according to default password create-rule;Or the password made an appointment.
13. a kind of electronic equipment, it is characterised in that including:Processor and machinable medium, the machine readable storage
Media storage has can be by the machine-executable instruction of the computing device, and the processor is by the machine-executable instruction
Promote:Realize any described method and steps of claim 1-3.
14. a kind of electronic equipment, it is characterised in that including:Processor and machinable medium, the machine readable storage
Media storage has can be by the machine-executable instruction of the computing device, and the processor is by the machine-executable instruction
Promote:Realize any described method and steps of claim 4-6.
A kind of 15. machinable medium, it is characterised in that be stored with machine-executable instruction, by processor call and
During execution, the machine-executable instruction promotes the processor:Realize any described method and steps of claim 1-3.
A kind of 16. machinable medium, it is characterised in that be stored with machine-executable instruction, by processor call and
During execution, the machine-executable instruction promotes the processor:Realize any described method and steps of claim 4-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710493474.8A CN107545189A (en) | 2017-06-26 | 2017-06-26 | A kind of file preparation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710493474.8A CN107545189A (en) | 2017-06-26 | 2017-06-26 | A kind of file preparation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107545189A true CN107545189A (en) | 2018-01-05 |
Family
ID=60970548
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710493474.8A Pending CN107545189A (en) | 2017-06-26 | 2017-06-26 | A kind of file preparation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107545189A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108319872A (en) * | 2018-01-16 | 2018-07-24 | 湖北省楚天云有限公司 | A kind of closed container generation method, device and equipment |
CN108399318A (en) * | 2018-01-31 | 2018-08-14 | 北京顶象技术有限公司 | The generation method of executable file executes method and electronic equipment |
CN110708273A (en) * | 2018-07-10 | 2020-01-17 | 杭州海康威视数字技术股份有限公司 | Data encryption and decryption method and data encryption and decryption system |
CN110780884A (en) * | 2019-09-05 | 2020-02-11 | 腾讯科技(深圳)有限公司 | Information processing method, device and equipment |
CN110830571A (en) * | 2019-11-05 | 2020-02-21 | 许继集团有限公司 | Business data backup and extraction method and computer readable medium |
CN111131281A (en) * | 2019-12-30 | 2020-05-08 | 北京永新视博数字电视技术有限公司 | Message transmission method, device and system and protection code updating method and device thereof |
CN111290781A (en) * | 2020-03-10 | 2020-06-16 | 网易(杭州)网络有限公司 | NPK mode packing script, and method and device for running NPK format script file |
CN113946801A (en) * | 2021-11-01 | 2022-01-18 | 苏州浪潮智能科技有限公司 | SGX-based Python source code protection method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957903A (en) * | 2010-09-13 | 2011-01-26 | 中兴通讯股份有限公司 | Method and device for protecting class files |
CN106295370A (en) * | 2016-08-19 | 2017-01-04 | 北京奇虎科技有限公司 | A kind of method and apparatus of the dynamic link library (DLL) file reinforcing installation kit |
-
2017
- 2017-06-26 CN CN201710493474.8A patent/CN107545189A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957903A (en) * | 2010-09-13 | 2011-01-26 | 中兴通讯股份有限公司 | Method and device for protecting class files |
CN106295370A (en) * | 2016-08-19 | 2017-01-04 | 北京奇虎科技有限公司 | A kind of method and apparatus of the dynamic link library (DLL) file reinforcing installation kit |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108319872A (en) * | 2018-01-16 | 2018-07-24 | 湖北省楚天云有限公司 | A kind of closed container generation method, device and equipment |
CN108319872B (en) * | 2018-01-16 | 2020-05-22 | 湖北省楚天云有限公司 | Method, device and equipment for generating closed container |
CN108399318A (en) * | 2018-01-31 | 2018-08-14 | 北京顶象技术有限公司 | The generation method of executable file executes method and electronic equipment |
CN108399318B (en) * | 2018-01-31 | 2020-09-08 | 北京顶象技术有限公司 | Executable file generation method, executable file execution method and electronic equipment |
CN110708273A (en) * | 2018-07-10 | 2020-01-17 | 杭州海康威视数字技术股份有限公司 | Data encryption and decryption method and data encryption and decryption system |
CN110780884A (en) * | 2019-09-05 | 2020-02-11 | 腾讯科技(深圳)有限公司 | Information processing method, device and equipment |
CN110780884B (en) * | 2019-09-05 | 2022-04-12 | 腾讯科技(深圳)有限公司 | Information processing method, device and equipment |
CN110830571A (en) * | 2019-11-05 | 2020-02-21 | 许继集团有限公司 | Business data backup and extraction method and computer readable medium |
CN111131281A (en) * | 2019-12-30 | 2020-05-08 | 北京永新视博数字电视技术有限公司 | Message transmission method, device and system and protection code updating method and device thereof |
CN111290781A (en) * | 2020-03-10 | 2020-06-16 | 网易(杭州)网络有限公司 | NPK mode packing script, and method and device for running NPK format script file |
CN113946801A (en) * | 2021-11-01 | 2022-01-18 | 苏州浪潮智能科技有限公司 | SGX-based Python source code protection method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107545189A (en) | A kind of file preparation method and device | |
US10289816B1 (en) | Methods, systems, and devices for an encrypted and obfuscated algorithm in a computing environment | |
KR101091465B1 (en) | Method and apparatus for the secure processing of confidential content within a virtual machine of a processor | |
CN103221961B (en) | Comprise the method and apparatus of the framework for the protection of multi-ser sensitive code and data | |
EP3242241B1 (en) | Information assurance system for secure program execution | |
CN104463002B (en) | A kind of method and apparatus of reinforcing APK and APK reinforce client and server | |
US8307215B2 (en) | System and method for an autonomous software protection device | |
US8839410B2 (en) | Type-system for mixed protocol secure computation | |
US20150278555A1 (en) | Method for performing an encryption with look-up tables, and corresponding encryption apparatus and computer program product | |
CN101814124A (en) | Java-based method for enhancing software security | |
US20070189526A1 (en) | System and method for secure and flexible key schedule generation | |
CN106599629A (en) | Strengthening method and apparatus for Android application program | |
CN111191195A (en) | Method and device for protecting APK | |
JP6698774B2 (en) | Security providing apparatus and method for common intermediate language, and security executing apparatus and method | |
CN107609394A (en) | Tamper resistant method, storage device and the device of Android installation kits | |
CN110210188A (en) | Code encryption method, apparatus, equipment and storage medium under Spring frame | |
CN108183796A (en) | The method and device of encryption and decryption is carried out using whitepack library file and whitepack key file | |
CN108134673A (en) | A kind of method and device for generating whitepack library file | |
CN107391973A (en) | A kind of function guard method and device | |
CN109598107A (en) | A kind of code conversion method and device based on application installation package file | |
CN113722683A (en) | Model protection method, device, equipment, system and storage medium | |
CN109614772A (en) | Code conversion method and device based on application installation package file | |
CN107220528A (en) | The protection of java applet and operation method, device and terminal | |
CA3150187A1 (en) | Method and apparatus for protecting web script codes | |
JP6919973B2 (en) | Computer-aided obfuscation of program code |
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: 20180105 |