CN109740371A - One kind being used for the easy encryption method of Android SDK resource and device - Google Patents
One kind being used for the easy encryption method of Android SDK resource and device Download PDFInfo
- Publication number
- CN109740371A CN109740371A CN201811520659.4A CN201811520659A CN109740371A CN 109740371 A CN109740371 A CN 109740371A CN 201811520659 A CN201811520659 A CN 201811520659A CN 109740371 A CN109740371 A CN 109740371A
- Authority
- CN
- China
- Prior art keywords
- file
- base64
- android sdk
- module
- sdk resource
- 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
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 37
- 230000011218 segmentation Effects 0.000 claims abstract description 16
- 238000012856 packing Methods 0.000 claims abstract description 7
- 238000004458 analytical method Methods 0.000 abstract description 5
- 230000001681 protective effect Effects 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000018109 developmental process Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000005295 random walk Methods 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
Landscapes
- Storage Device Security (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to one kind to be used for the easy encryption method of Android SDK resource and device, this method comprises: carrying out reciprocity segmentation to each file of Android SDK resource to be encrypted, is divided into the first file and the second file;The pathname of first file is remained unchanged, names the pathname of second file at random;By the path for second file named at random, the tail portion of first file is written, generates third file;According to preset algorithm, the third file and the second file are encrypted respectively;The third file of encryption and the second file are subjected to packing processing.This method can prevent Android SDK resource from being decoded by the various scanning analysis of some automated tools, increase so that Android SDK resource be made to decode difficulty, play the role of simple protective.
Description
Technical field
The present invention relates to data encryption technology fields, in particular to a kind of to be used for the easy encryption method of Android SDK resource
And device.
Background technique
Android is the mobile phone development platform that (Google) company, Google releases.Similar to iPhone, Android is used
WebKit browser engine, has touch screen, advanced figure is shown and function of surfing the Net, and user can check electronics postal on mobile phone
Part, search network address and viewing video program etc..Android platform is given we provide a SharedPreferences class, it
It is the storage class an of lightweight, particularly suitable for saving software configuration parameter.Number is saved using SharedPreferences
According to behind is to store data with xml document, and file is stored in/data/data/<package name>/ shared_prefs
Under catalogue.And Android is one to the wide-open platform of third party software, and developer possesses when developing program for it
Bigger freedom degree.Therefore, it for Android exploitation using more and more, while developing these applications, generally requires
Software engineer is exploitation work when specific software package, software frame, hardware platform, operating system etc. establish application software
Tool, and the set of these tools is exactly Android SDK:(software development kit) Software Development Kit.
In the prior art, Android SDK resource is decoded by the various scanning analysis of some automated tools, causes programmer arduous
The android exploitation code that hardship is developed, it is easy to just be translated by hacker, therefore how a kind of effective technological means is provided
The Android SDK resource for carrying out protective program person's exploitation, is practitioner's urgent problem to be solved.
Summary of the invention
In view of the above problems, the invention proposes one kind to be used for the easy encryption method of Android SDK resource and device, can prevent
Only Android SDK resource is decoded by the various scanning analysis of some automated tools, is increased, is risen so that Android SDK resource be made to decode difficulty
To the effect of simple protective.
In a first aspect, the embodiment of the present invention provides one kind for the easy encryption method of Android SDK resource, comprising:
S11, reciprocity segmentation is carried out to each file of Android SDK resource to be encrypted, is divided into the first file and the second text
Part;
S12, the pathname of first file is remained unchanged, names the pathname of second file at random;
S13, by the path for second file named at random, the tail portion of first file is written, generates third text
Part;
S14, according to preset algorithm, the third file and the second file are encrypted respectively;
S15, the third file of encryption and the second file are subjected to packing processing.
In one embodiment, before executing step S11;The method also includes:
S10, each file of Android SDK resource to be encrypted is compared with preset threshold;When the file is greater than
When equal to the preset threshold, step S11 is executed.
In one embodiment, further includes: step 21, when the file be less than the preset threshold when, according to described pre-
Imputation method is encrypted and is packaged to the file.
In one embodiment, the preset algorithm is following any:
AES, DES, 3DES, RSA, DSA, ECC and Base64.
In one embodiment, when the preset algorithm is Base64:
The step S14 includes: that the third file and the second file are carried out Base64 respectively according to Base64 algorithm
Coding, and marking head is added in the third file after Base64 is encoded;
The step 16 includes: that the file for being less than the preset threshold is carried out Base64 according to Base64 algorithm
Coding, and marking head is added in the file after Base64 is encoded.
Second aspect, the present invention also provides one kind to be used for the easy encryption device of Android SDK resource, comprising:
Divide module, carries out reciprocity segmentation for each file to Android SDK resource to be encrypted, be divided into the first file
With the second file;
Module is named to name second file at random for remaining unchanged the pathname of first file
Pathname;
Generation module, it is raw for the tail portion of first file to be written by the path for second file named at random
At third file;
Encrypting module, for according to preset algorithm, the third file and the second file to be encrypted respectively;
Packetization module, for the third file of encryption and the second file to be carried out packing processing.
In one embodiment, further includes:
Comparison module, for each file of Android SDK resource to be encrypted to be compared with preset threshold;
The segmentation module, for the comparison result according to the comparison module, when the file is more than or equal to described pre-
If when threshold value, carrying out reciprocity segmentation to each file of Android SDK resource to be encrypted, being divided into the first file and the second file.
In one embodiment, the encrypting module is also used to according to comparison module, when the file is less than described preset
When threshold value, the file is encrypted according to the preset algorithm;
The packetization module, for the file of the encrypting module encryption to be packaged.
In one embodiment, the preset algorithm in the encrypting module is following any:
AES, DES, 3DES, RSA, DSA, ECC and Base64.
In one embodiment, when the preset algorithm is Base64, the encrypting module is specifically used for basis
The third file and the second file are carried out Base64 coding by Base64 algorithm respectively, and after Base64 is encoded described in
Marking head is added in third file;
And be also used to according to Base64 algorithm, the file for being less than the preset threshold is subjected to Base64 coding,
And marking head is added in the file after encoding Base64.
It is an advantage of the current invention that the invention proposes one kind to be used for the easy encryption method of Android SDK resource and device,
It can prevent Android SDK resource from being decoded by the various scanning analysis of some automated tools such as apktool, to make Android SDK resource
It decodes difficulty to increase, plays the role of simple protective.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification
It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by written explanation
Specifically noted structure is achieved and obtained in book, claims and attached drawing.
Below by drawings and examples, technical scheme of the present invention will be described in further detail.
Detailed description of the invention
Attached drawing is used to provide further understanding of the present invention, and constitutes part of specification, with reality of the invention
It applies example to be used to explain the present invention together, not be construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the flow chart provided by the present invention for the easy encryption method of Android SDK resource.
Fig. 2 is the flow diagram that Android SDK resource original provided by the invention simply encrypts.
Fig. 3 is the flow diagram that sdk.bin file provided by the invention simply encrypts.
Fig. 4 is the block diagram provided by the present invention for the easy encryption device of Android SDK resource.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
The embodiment of the present invention provides one kind and is used for the easy encryption method of Android SDK resource, shown referring to Fig.1, comprising:
S11, reciprocity segmentation is carried out to each file of Android SDK resource to be encrypted, is divided into the first file and the second text
Part;
S12, the pathname of first file is remained unchanged, names the pathname of second file at random;
S13, by the path for second file named at random, the tail portion of first file is written, generates third text
Part;
S14, according to preset algorithm, the third file and the second file are encrypted respectively;
S15, the third file of encryption and the second file are subjected to packing processing.
In above-mentioned steps S11, equity segmentation refers to, such as file 10M, can be divided into the file of 2 5M;In S12
Random process is carried out to the path of the second file;Generate random walk title;It, can be by above-mentioned random walk name when specific operation
The length of title is set as within 100 bytes so that it is convenient to which in step s 13, the second file path named at random is written
The tail portion of first file.Then pass through the encryption of step S14, S15 Encryption Algorithm and be packaged.
In the present embodiment, it can prevent SDK resource from being decoded by the various scanning analysis of some automated tools, to make Android SDK
Resource is decoded difficulty and is increased, and simple protective is played the role of.
In one embodiment, shown in referring to Fig.1, not All Files can be all split, this method further includes
S10:
Each file of Android SDK resource to be encrypted is compared with preset threshold;When the file is more than or equal to
When the preset threshold, step S11 is executed.
Wherein, preset threshold, can according to the size self-setting of specific Android ADK resource file, such as can be 2Mb,
Maximum in 3Mb, 4Mb ... .. etc., such as Android ADK resource file is 20Mb, and the smallest is 2Kb, then according to calculation amount
Need simpler, selectable threshold 10Mb;Also it can choose 5Mb, such calculation amount will be corresponding more.
Or it is greater than using 2Mb as preset threshold for example, each file when Android SDK resource is compared with 2Mb
When equal to above-mentioned 2Mb, thens follow the steps S11 and carry out file division;Otherwise, when file is less than above-mentioned 2Mb, directly to this document
It is encrypted and is packaged.
In one embodiment, above-mentioned preset algorithm is Encryption Algorithm, be can be any one of following:
AES, DES, 3DES, RSA, DSA, ECC and Base64.
Wherein, symmetry Encryption Algorithm has: AES, DES, 3DES, and asymmetry algorithm has: RSA, DSA, ECC;Also
Base64 encryption algorithm.The present invention to Encryption Algorithm used in above-described embodiment without limitation.
Such as: by taking Base64 encryption algorithm as an example:
To the resource that needs encrypt, the first step, segmentation is then split, each file is to equal part if file is greater than 2M
It cuts, the file path name of first part is constant, and the file path name of second part is random, while the file path of second part is write
Enter the tail portion of the file of first part, length limitation is 100 bytes, and second step all carries out the first second part
Marking head, such as AF is added to the first part of coding in Base64 coding, is to add as long as judging that head is AF when reading file
Ciphertext part, third step are packaged by original mode, shown in flow chart 2.
Specifically, such as by taking sdk.bin as an example: referring to shown in Fig. 3, for the flow diagram of sdk.bin segmentation encryption.
Based on the same inventive concept, the embodiment of the invention also provides one kind easily encrypts dress for Android SDK resource
It sets, since the principle of the solved problem of the device is similar to for the Android SDK easy encryption method of resource, the device
Implementation may refer to the implementation of preceding method, and overlaps will not be repeated.
Second aspect, the present invention also provides one kind to be used for the easy encryption device of Android SDK resource, referring to shown in Fig. 4, packet
It includes:
Divide module 41, carries out reciprocity segmentation for each file to Android SDK resource to be encrypted, be divided into the first text
Part and the second file;
Module 42 is named to name second file at random for remaining unchanged the pathname of first file
Pathname;
Generation module 43, for the tail portion of first file to be written by the path for second file named at random,
Generate third file;
Encrypting module 44, for according to preset algorithm, the third file and the second file to be encrypted respectively;
Packetization module 45, for the third file of encryption and the second file to be carried out packing processing.
In one embodiment, further includes:
Comparison module 40, for each file of Android SDK resource to be encrypted to be compared with preset threshold;
The segmentation module 41, for the comparison result according to the comparison module 40, when the file is more than or equal to institute
When stating preset threshold, reciprocity segmentation is carried out to each file of Android SDK resource to be encrypted, is divided into the first file and the second text
Part.
In one embodiment, the encrypting module 44 is also used to according to comparison module 40, when the file is less than described
When preset threshold, the file is encrypted according to the preset algorithm;
The packetization module 45, for the file of 44 encryption of encrypting module to be packaged.
In one embodiment, the preset algorithm in the encrypting module 44 is following any:
AES, DES, 3DES, RSA, DSA, ECC and Base64.
In one embodiment, when the preset algorithm is Base64, the encrypting module 44 is specifically used for basis
The third file and the second file are carried out Base64 coding by Base64 algorithm respectively, and after Base64 is encoded described in
Marking head is added in third file;
And be also used to according to Base64 algorithm, the file for being less than the preset threshold is subjected to Base64 coding,
And marking head is added in the file after encoding Base64.
It should be noted last that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting.Although ginseng
It is described the invention in detail according to embodiment, those skilled in the art should understand that, to technical side of the invention
Case is modified or replaced equivalently, and without departure from the spirit and scope of technical solution of the present invention, should all be covered in the present invention
Scope of the claims in.
Claims (10)
1. one kind is used for the easy encryption method of Android SDK resource characterized by comprising
S11, reciprocity segmentation is carried out to each file of Android SDK resource to be encrypted, is divided into the first file and the second file;
S12, the pathname of first file is remained unchanged, names the pathname of second file at random;
S13, by the path for second file named at random, the tail portion of first file is written, generates third file;
S14, according to preset algorithm, the third file and the second file are encrypted respectively;
S15, the third file of encryption and the second file are subjected to packing processing.
2. as described in claim 1 a kind of for the easy encryption method of Android SDK resource, which is characterized in that executing step
Before rapid S11;The method also includes:
S10, each file of Android SDK resource to be encrypted is compared with preset threshold;When the file is more than or equal to
When the preset threshold, step S11 is executed.
3. as claimed in claim 2 a kind of for the easy encryption method of Android SDK resource, which is characterized in that further include: step
Rapid 21, when the file is less than the preset threshold, the file is encrypted and is beaten according to the preset algorithm
Packet.
4. as described in any one of claims 1-3 a kind of for the easy encryption method of Android SDK resource, which is characterized in that
The preset algorithm is following any:
AES, DES, 3DES, RSA, DSA, ECC and Base64.
5. as claimed in claim 4 a kind of for the easy encryption method of Android SDK resource, which is characterized in that when described pre-
When imputation method is Base64:
The step S14 includes: that the third file and the second file are carried out Base64 volume respectively according to Base64 algorithm
Code, and marking head is added in the third file after Base64 is encoded;
The step 16 includes: that the file for being less than the preset threshold is carried out Base64 coding according to Base64 algorithm,
And marking head is added in the file after encoding Base64.
6. one kind is used for the easy encryption device of Android SDK resource characterized by comprising
Divide module, carry out reciprocity segmentation for each file to Android SDK resource to be encrypted, is divided into the first file and the
Two files;
Module is named to name the path of second file at random for remaining unchanged the pathname of first file
Title;
Generation module generates for the tail portion of first file to be written by the path for second file named at random
Three files;
Encrypting module, for according to preset algorithm, the third file and the second file to be encrypted respectively;
Packetization module, for the third file of encryption and the second file to be carried out packing processing.
7. as claimed in claim 6 a kind of for the easy encryption device of Android SDK resource, which is characterized in that further include:
Comparison module, for each file of Android SDK resource to be encrypted to be compared with preset threshold;
The segmentation module, for the comparison result according to the comparison module, when the file is more than or equal to the default threshold
When value, reciprocity segmentation is carried out to each file of Android SDK resource to be encrypted, is divided into the first file and the second file.
8. as claimed in claim 7 a kind of for the easy encryption device of Android SDK resource, which is characterized in that the encryption
Module is also used to according to comparison module, when the file is less than the preset threshold, according to the preset algorithm to the text
Part is encrypted;
The packetization module, for the file of the encrypting module encryption to be packaged.
9. as claim 6-8 is described in any item a kind of for the easy encryption device of Android SDK resource, which is characterized in that
Preset algorithm in the encrypting module is following any:
AES, DES, 3DES, RSA, DSA, ECC and Base64.
10. as claimed in claim 9 a kind of for the easy encryption device of Android SDK resource, which is characterized in that when described pre-
When imputation method is Base64, the encrypting module is specifically used for according to Base64 algorithm, by the third file and the second file
Base64 coding is carried out respectively, and marking head is added in the third file after Base64 is encoded;
And be also used to according to Base64 algorithm, the file for being less than the preset threshold is subjected to Base64 coding, and will
Marking head is added in the file after Base64 coding.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811520659.4A CN109740371A (en) | 2018-12-12 | 2018-12-12 | One kind being used for the easy encryption method of Android SDK resource and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811520659.4A CN109740371A (en) | 2018-12-12 | 2018-12-12 | One kind being used for the easy encryption method of Android SDK resource and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN109740371A true CN109740371A (en) | 2019-05-10 |
Family
ID=66358860
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201811520659.4A Pending CN109740371A (en) | 2018-12-12 | 2018-12-12 | One kind being used for the easy encryption method of Android SDK resource and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109740371A (en) |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110106769A1 (en) * | 2009-10-30 | 2011-05-05 | Cleversafe, Inc. | Distributed storage network that processes data in either fixed or variable sizes |
| CN102402670A (en) * | 2011-08-03 | 2012-04-04 | 广东欧珀移动通信有限公司 | File encryption and decryption method |
| CN102842001A (en) * | 2012-07-20 | 2012-12-26 | 西安邮电大学 | System and method for detecting computer security information based on U disc authentication |
| CN106203154A (en) * | 2016-06-27 | 2016-12-07 | 联想(北京)有限公司 | A kind of file memory method and electronic equipment |
| CN107066890A (en) * | 2017-04-25 | 2017-08-18 | 腾讯科技(深圳)有限公司 | A kind of method and device for handling and file being encrypted using obscuring |
| CN107153794A (en) * | 2016-03-03 | 2017-09-12 | 腾讯科技(深圳)有限公司 | File encrypting method and device, file decryption method and apparatus |
| CN107665310A (en) * | 2016-07-29 | 2018-02-06 | 四川长虹电器股份有限公司 | Encryption storage, reading and the delet method of a kind of mobile terminal document |
-
2018
- 2018-12-12 CN CN201811520659.4A patent/CN109740371A/en active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110106769A1 (en) * | 2009-10-30 | 2011-05-05 | Cleversafe, Inc. | Distributed storage network that processes data in either fixed or variable sizes |
| CN102402670A (en) * | 2011-08-03 | 2012-04-04 | 广东欧珀移动通信有限公司 | File encryption and decryption method |
| CN102842001A (en) * | 2012-07-20 | 2012-12-26 | 西安邮电大学 | System and method for detecting computer security information based on U disc authentication |
| CN107153794A (en) * | 2016-03-03 | 2017-09-12 | 腾讯科技(深圳)有限公司 | File encrypting method and device, file decryption method and apparatus |
| CN106203154A (en) * | 2016-06-27 | 2016-12-07 | 联想(北京)有限公司 | A kind of file memory method and electronic equipment |
| CN107665310A (en) * | 2016-07-29 | 2018-02-06 | 四川长虹电器股份有限公司 | Encryption storage, reading and the delet method of a kind of mobile terminal document |
| CN107066890A (en) * | 2017-04-25 | 2017-08-18 | 腾讯科技(深圳)有限公司 | A kind of method and device for handling and file being encrypted using obscuring |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111885024B (en) | Login information processing method and equipment | |
| CN109214196B (en) | Data interaction method, device and equipment | |
| CN112559928B (en) | Page processing method and device based on hybrid development, electronic equipment and storage medium | |
| CN111741028B (en) | Business processing method, apparatus, equipment and system | |
| CN110636070B (en) | Data sending method, data query method, device, electronic equipment and system | |
| CN107122634B (en) | Reinforcement protection method and device for software installation package | |
| CN112115429B (en) | Java class encryption and decryption method and computer readable storage medium | |
| CN107580013B (en) | Method and device for requesting data across domains | |
| CN105022936A (en) | Class file encryption and decryption method and class file encryption and decryption device | |
| TW202022677A (en) | Evidence obtaining method and device based on block chain | |
| CN109787768B (en) | Identity authentication configuration method and device and computer readable storage medium | |
| CN105825143A (en) | Application program data writing and reading method and device | |
| CN110662089A (en) | Bullet screen receiving and processing method, storage medium, electronic equipment and system | |
| CN117201034A (en) | A digital signature method, device, storage medium and electronic equipment | |
| WO2019062015A1 (en) | Source code protection method, application server, and computer-readable storage medium | |
| CN111934874A (en) | Block chain-based data encryption and decryption method, equipment and medium | |
| CN111898135A (en) | Data processing method, data processing apparatus, computer device, and medium | |
| CN106789058A (en) | One kind acts on behalf of re-encryption arthmetic statement and analytic method | |
| CN110730167B (en) | Data sending method, data query method, device, electronic equipment and system | |
| CN111061720B (en) | Data screening method and device and electronic equipment | |
| CN113377376A (en) | Data packet generation method, data packet generation device, electronic device, and storage medium | |
| CN113420313A (en) | Program safe operation and encryption method and device, equipment and medium thereof | |
| CN109740371A (en) | One kind being used for the easy encryption method of Android SDK resource and device | |
| CN116257303B (en) | Data security processing method and device, storage medium and electronic equipment | |
| CN112799678A (en) | Data push method and device, electronic device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190510 |
|
| RJ01 | Rejection of invention patent application after publication |