CN114721634A - Sub-packet packaging and encryption method and system based on custom class loader - Google Patents
Sub-packet packaging and encryption method and system based on custom class loader Download PDFInfo
- Publication number
- CN114721634A CN114721634A CN202210307180.2A CN202210307180A CN114721634A CN 114721634 A CN114721634 A CN 114721634A CN 202210307180 A CN202210307180 A CN 202210307180A CN 114721634 A CN114721634 A CN 114721634A
- Authority
- CN
- China
- Prior art keywords
- application software
- package
- encryption
- key
- class loader
- 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
- 238000004806 packaging method and process Methods 0.000 title claims abstract description 48
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000006870 function Effects 0.000 claims description 34
- 238000004891 communication Methods 0.000 claims description 9
- 238000013507 mapping Methods 0.000 claims description 6
- 238000012856 packing Methods 0.000 claims description 2
- 230000005540 biological transmission Effects 0.000 abstract description 11
- 238000012423 maintenance Methods 0.000 abstract description 5
- 238000012937 correction Methods 0.000 abstract description 4
- 238000013024 troubleshooting Methods 0.000 abstract description 4
- 238000012858 packaging process Methods 0.000 abstract description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
- G06F21/12—Protecting executable software
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6227—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2107—File encryption
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Multimedia (AREA)
- Technology Law (AREA)
- Storage Device Security (AREA)
Abstract
The invention provides a method and a system for subpackaging and encrypting based on a custom loader, wherein a plurality of functional modules of application software are constructed by using the custom loader; respectively packaging all the functional modules of the application software into functional module packages, and symmetrically encrypting to obtain an encrypted functional module package; and uniformly packaging to obtain an encrypted application software package, and uploading the encrypted application software package to a server. According to the invention, the multiple functional modules of the application software are constructed by using the custom class loader, so that the degree of freedom of software development is improved, each functional module of the software is respectively packaged, the transmission and the deployment are convenient, the later-stage error correction and troubleshooting are also convenient, and the deployment and later-stage maintenance efficiency is improved; double encryption is carried out in the subpackaging and packaging process, so that the safety in the data transmission process is ensured, and leakage and malicious tampering can be effectively prevented.
Description
Technical Field
The invention relates to the technical field of system packaging and encryption, in particular to a method and a system for packaging and encrypting packets based on a custom loader.
Background
At present, under some conditions, the source code of the software is often required to be transplanted and deployed, but the source code is too large in size, if the source code is simply packed together for transmission and deployment, not only is the data transmission efficiency low, but also the error is difficult to be checked and corrected if the source code has errors, and the software deployment and later maintenance efficiency cannot be improved; in addition, in the process of data transmission, if the security is improved without encryption measures, the source code is easily leaked or tampered, and great negative effects are caused to a software developer.
The current encryption measures for data are usually single, easy to crack and incapable of ensuring security. Therefore, currently, there is no generally applicable method for solving the problem that the source code of the deployment software cannot be transmitted safely and efficiently.
Disclosure of Invention
In view of this, the invention provides a method for packaging and encrypting packets based on a custom class loader, which is used for solving the problem that a software source code cannot be safely and efficiently transmitted and deployed.
The technical scheme of the invention is realized as follows:
the first aspect of the invention discloses a sub-packet packaging and encryption method based on a custom class loader, which comprises the following steps:
s1, building a plurality of functional modules of the application software by using the custom class loader;
s2, packaging all function modules of the application software into function module packages respectively, and performing symmetric encryption to obtain an encrypted function module package;
and S3, packaging all the function module packages of the application software into an application software package, encrypting the application software package to obtain an encrypted application software package, and uploading the encrypted application software package to the server.
By the method, the class file can be freely encrypted and decrypted according to the requirement by using the user-defined class loader to construct the plurality of functional modules of the application software, and each functional module of the software is respectively packaged, so that the transmission and the deployment are convenient, the later-stage error correction and troubleshooting are convenient, and the deployment and later-stage maintenance efficiency is improved.
On the basis of the above technical solution, preferably, step S1 specifically includes:
constructing a plurality of functional modules of application software by using a custom class loader, and encrypting a source code to obtain an encrypted code; the step of encrypting the source code comprises: when the code is compiled, the data is read from the source file, and each bit of data is read out of the source file and written into the target file after the value of exclusive or 1 is taken out every time four bytes of data are read out of the source file.
The method of the invention can simply encrypt the source code and play a role of protecting the source code.
On the basis of the above technical solution, preferably, step S2 specifically includes:
and respectively packaging all the functional modules of the application software into functional module packages, setting a symmetric encryption key, and encrypting the functional module packages by using the symmetric encryption key to obtain encrypted functional module packages.
On the basis of the foregoing technical solution, preferably, the setting a symmetric encryption key, and encrypting the function module package using the symmetric encryption key to obtain an encrypted function module package includes:
and setting the same symmetric encryption key for each functional module packet.
On the basis of the foregoing technical solution, preferably, the setting a symmetric encryption key, and encrypting the function module package using the symmetric encryption key to obtain an encrypted function module package includes:
and respectively setting different symmetric encryption keys for each functional module package, and establishing a mapping relation between the symmetric encryption keys and the encryption functional module packages.
According to the method, all the functional modules of the application software are packaged and encrypted, so that on one hand, modular transmission and deployment are facilitated; and on the other hand, the function module packet is encrypted, so that the safety and the confidentiality are improved.
On the basis of the above technical solution, preferably, step S3 specifically includes:
packaging all encryption function module packages of the application software into an application software package, and packaging the symmetric encryption keys corresponding to the encryption function module packages into a key package; the server generates a random original password A and an original password B, encrypts the application software package by using the original password A to obtain an encrypted application software package, and encrypts the key package by using the original password B to obtain an encrypted key package; encrypting the original password A and the original password B by using a preset public key; packaging the encryption key package and the encryption application software package into an application software file together and sending the application software file to a server;
the key package comprises a symmetric encryption key and a plurality of mapping relations between the symmetric encryption key and each encryption function module package.
According to the method, the application software package and the symmetric encryption key are encrypted and packaged again, the integrity of the whole software is guaranteed by packaging twice, the security in the data transmission process is guaranteed by double encryption, and leakage and malicious tampering can be effectively prevented.
On the basis of the above technical solution, preferably, after the step S3 is executed, the method further includes:
when a server receives a request for acquiring application software from a client, the server sends an application software file to the client, the client decrypts an original password A and an original password B by using a preset private key corresponding to a preset public key to obtain a key package and an application software package, and the preset private key and the preset public key form a pair of asymmetric encryption keys; and decrypting the encryption function module packet through a symmetric encryption key in the key packet to obtain an encryption code.
In a second aspect of the present invention, a packet packaging and encryption technology system based on a custom class loader is disclosed, the system comprising:
constructing a module: a plurality of functional modules for building application software using custom class loaders;
a packaging module: the system comprises a functional module package, a functional module package and a control module package, wherein the functional module package is used for respectively packaging all functional modules of application software into the functional module package; packaging all the functional module packages of the application software into an application software package;
an encryption module: the function module package and the application software package are encrypted. In a third aspect of the present invention, an electronic device is disclosed, the device comprising: at least one processor, at least one memory, a communication interface, and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the memory stores a program of a method for packetizing and encrypting based on a custom class loader, which can be executed by the processor, and the program of the method for packetizing and encrypting based on the custom class loader is configured to implement the method for packetizing and encrypting based on the custom class loader according to the first aspect of the present invention.
In a fourth aspect of the present invention, a computer-readable storage medium is disclosed, in which a program of a method for packaging and encrypting packets based on a custom class loader is stored, and when executed, the program of the method for packaging and encrypting packets based on the custom class loader implements the method for packaging and encrypting packets based on the custom class loader according to the first aspect of the present invention.
Compared with the prior art, the sub-packet packaging and encryption method based on the custom class loader has the following beneficial effects:
(1) by using the user-defined class loader to construct a plurality of functional modules of the application software, the self-definition of software development is improved, and meanwhile, the class file can be freely encrypted and decrypted according to requirements, so that the safety is improved;
(2) the functional modules of the software are respectively packaged, and all the functional modules are packaged together, so that the transmission and the deployment are facilitated, the later-stage error correction and troubleshooting are facilitated, and the deployment and later-stage maintenance efficiency is improved;
(3) double encryption is carried out in the subpackaging and packaging process, so that the safety in the data transmission process is ensured, and leakage and malicious tampering can be effectively prevented.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of the work flow of the method for packaging and encrypting packets based on the custom class loader according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
Examples
The work flow of the subpackage packaging and encryption method based on the custom class loader is shown in figure 1, and the processing steps are as follows:
in the first step, a custom class loader is used to build a plurality of functional modules of the application software. And turning to the second step.
On the basis of the technical scheme, preferably, a user-defined class loader is used for constructing a plurality of functional modules of application software, and the source code is encrypted to obtain an encrypted code; the step of encrypting the source code comprises: when the code is compiled, the data is read from the source file, and each bit of data is read out of the source file and written into the target file after the value of exclusive or 1 is taken out every time four bytes of data are read out of the source file.
The invention simply encrypts the source codes of the functional modules of the application software constructed by using the custom class loader, ensures the safety of the source codes on the basis, and simultaneously improves the degree of freedom for software developers by using the functional modules of the application software constructed by using the custom class loader, thereby being more convenient.
And secondly, packaging all the functional modules of the application software into functional module packages respectively, performing symmetric encryption to obtain an encrypted functional module package, and turning to the third step.
On the basis of the above technical solution, preferably, all the function modules of the application software are respectively packaged into a function module package, a symmetric encryption key is set, and the function module package is encrypted by using the symmetric encryption key to obtain an encrypted function module package.
On the basis of the above technical solution, preferably, the same symmetric encryption key may be set for each functional module package, or different symmetric encryption keys may be set for each functional module package, and after the symmetric encryption keys are set, a mapping relationship between the symmetric encryption keys and the encrypted functional module packages is established.
According to the invention, each functional module of the software is packaged, so that the later-stage data transmission and deployment are facilitated, meanwhile, if errors occur in the source codes, later-stage maintenance personnel can conveniently perform troubleshooting and error correction, and the software maintenance efficiency is improved.
And thirdly, packaging all the functional module packages of the application software into an application software package, encrypting the application software package to obtain an encrypted application software package, and uploading the encrypted application software package to the server. And turning to the fourth step.
On the basis of the technical scheme, preferably, all the encryption function module packages of the application software are packaged into one application software package, and the symmetric encryption keys corresponding to the encryption function module packages are packaged into a key package; the server generates a random original password A and an original password B, encrypts the application software package by using the original password A to obtain an encrypted application software package, and encrypts the key package by using the original password B to obtain an encrypted key package; the server encrypts an original password A and an original password B by using a preset public key; packaging the encryption key package and the encryption application software package into an application software file together and sending the application software file to a server;
the key package comprises a symmetric encryption key and a plurality of mapping relations between the symmetric encryption key and each encryption function module package.
The invention packs the application system twice, firstly packs the function modules separately, then packs all the function module packs uniformly, and encrypts each time, and simultaneously uses symmetric encryption and asymmetric encryption, thereby greatly ensuring the security of the source code.
Fourthly, when the server receives a request for acquiring the application software from the client, the server sends an application software file to the client, the client decrypts the original password A and the original password B by using a preset private key corresponding to a preset public key to obtain a key package and an application software package, and the preset private key and the preset public key are a pair of asymmetric encryption keys; and decrypting the encryption function module packet through a symmetric encryption key in the key packet to obtain an encryption code.
In the invention, the preset public key of the pair of asymmetric encryption keys is arranged in the server, and the preset private key is stored in the client, thereby improving the safety.
The invention also discloses a sub-package packing and encryption technical system based on the custom class loader, which comprises the following steps:
constructing a module: a plurality of functional modules for building application software using custom class loaders;
a packaging module: the system comprises a functional module package, a functional module package and a control module package, wherein the functional module package is used for respectively packaging all functional modules of application software into the functional module package; packaging all the functional module packages of the application software into an application software package;
an encryption module: the function module package and the application software package are encrypted.
The embodiments of the system and the method of the present invention are in one-to-one correspondence, and the detailed description of the system refers to the workflow of the method for packaging and encrypting packets based on the custom class loader described in the present invention, and the above program of the method for packaging and encrypting packets based on the custom class loader is executed. The invention also discloses an electronic device, comprising: at least one processor, at least one memory, a communication interface, and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the memory stores a program of a method for packaging and encrypting packets based on a custom class loader, which can be executed by the processor, and the program of the method for packaging and encrypting packets based on the custom class loader is configured to implement the method for packaging and encrypting packets based on the custom class loader according to the embodiment of the present invention.
The invention also discloses a computer readable storage medium, wherein a user-defined loader-based sub-packet packaging and encryption method program is stored on the storage medium, and when the user-defined loader-based sub-packet packaging and encryption method program is executed, the user-defined loader-based sub-packet packaging and encryption method is realized.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (10)
1. A sub-packet packing and encryption method based on a custom class loader is characterized by comprising the following steps:
s1, constructing a plurality of functional modules of the application software by using the custom class loader;
s2, packaging all function modules of the application software into function module packages respectively, and performing symmetric encryption to obtain an encrypted function module package;
and S3, packaging all the function module packages of the application software into an application software package, encrypting the application software package to obtain an encrypted application software package, and uploading the encrypted application software package to the server.
2. The method for packetizing and encrypting based on the custom class loader according to claim 1, wherein the step S1 comprises:
a plurality of functional modules of application software are built by using a user-defined class loader, and source codes are encrypted to obtain encrypted codes; the step of encrypting the source code comprises: when the code is compiled, the data is read from the source file, and each bit of data is read out of the source file and written into the target file after the value of exclusive or 1 is taken out every time four bytes of data are read out of the source file.
3. The method for packetizing and encrypting based on the custom class loader according to claim 2, wherein the step S2 comprises:
and respectively packaging all the functional modules of the application software into functional module packages, setting a symmetric encryption key, and encrypting the functional module packages by using the symmetric encryption key to obtain encrypted functional module packages.
4. The method as claimed in claim 3, wherein the setting of the symmetric encryption key and the encryption of the functional module package by using the symmetric encryption key to obtain the encrypted functional module package comprises:
and setting the same symmetric encryption key for each functional module packet.
5. The method as claimed in claim 3, wherein the setting of the symmetric encryption key and the encryption of the functional module package by using the symmetric encryption key to obtain the encrypted functional module package comprises:
and respectively setting different symmetric encryption keys for each functional module package, and establishing a mapping relation between the symmetric encryption keys and the encryption functional module packages.
6. The method for packetization and encryption based on a custom class loader according to claim 3, wherein the step S3 specifically comprises:
packaging all encryption function module packages of the application software into an application software package, and packaging the symmetric encryption keys corresponding to the encryption function module packages into a key package; the server generates a random original password A and an original password B, encrypts the application software package by using the original password A to obtain an encrypted application software package, and encrypts the key package by using the original password B to obtain an encrypted key package; encrypting the original password A and the original password B by using a preset public key; packaging the encryption key package and the encryption application software package into an application software file together and sending the application software file to a server;
the key package comprises a symmetric encryption key and a plurality of mapping relations between the symmetric encryption key and each encryption function module package.
7. The method for packetizing and encrypting based on the custom class loader according to claim 6, wherein the step S3 is further executed to include:
when a server receives a request for acquiring application software from a client, the server sends an application software file to the client, the client decrypts the original password A and the original password B by using a preset private key corresponding to a preset public key to obtain a key package and an application software package, and the preset private key and the preset public key form a pair of asymmetric encryption keys; and decrypting the encryption function module packet through a symmetric encryption key in the key packet to obtain an encryption code.
8. A subpackaging and encryption technical system based on a custom class loader is characterized by comprising the following components:
constructing a module: a plurality of functional modules for building application software using custom class loaders;
a packaging module: the system comprises a functional module package, a functional module package and a control module package, wherein the functional module package is used for respectively packaging all functional modules of application software into the functional module package; packaging all the functional module packages of the application software into an application software package;
an encryption module: the function module package and the application software package are encrypted.
9. An electronic device comprising at least one processor, at least one memory, a communication interface, and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the memory stores a custom class loader-based packetization and encryption method program executable by the processor, and the custom class loader-based packetization and encryption method program is configured to implement a custom class loader-based packetization and encryption method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein a custom class loader-based packetization and encryption method program is stored on the storage medium, and when executed, the custom class loader-based packetization and encryption method program implements a custom class loader-based packetization and encryption method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210307180.2A CN114721634A (en) | 2022-03-25 | 2022-03-25 | Sub-packet packaging and encryption method and system based on custom class loader |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210307180.2A CN114721634A (en) | 2022-03-25 | 2022-03-25 | Sub-packet packaging and encryption method and system based on custom class loader |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114721634A true CN114721634A (en) | 2022-07-08 |
Family
ID=82240842
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210307180.2A Pending CN114721634A (en) | 2022-03-25 | 2022-03-25 | Sub-packet packaging and encryption method and system based on custom class loader |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114721634A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116932011A (en) * | 2023-09-14 | 2023-10-24 | 合肥大唐存储科技有限公司 | SSD firmware segment encryption and burning method |
-
2022
- 2022-03-25 CN CN202210307180.2A patent/CN114721634A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116932011A (en) * | 2023-09-14 | 2023-10-24 | 合肥大唐存储科技有限公司 | SSD firmware segment encryption and burning method |
CN116932011B (en) * | 2023-09-14 | 2024-02-06 | 合肥大唐存储科技有限公司 | SSD firmware segment encryption and burning method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200162437A1 (en) | Multimodal cryptographic data communications in a remote patient monitoring environment | |
CN101019369B (en) | Method of delivering direct proof private keys to devices using an on-line service | |
US7127067B1 (en) | Secure patch system | |
US20030233573A1 (en) | System and method for securing network communications | |
US11233771B2 (en) | Communication interface for a low power wide area network, wireless device and server using such communication interface | |
CN105610848A (en) | Centralized data preservation method and system with source data security guaranty mechanism | |
CN108429719A (en) | Cryptographic key protection method and device | |
Drimer et al. | A protocol for secure remote updates of FPGA configurations | |
EP3641219A1 (en) | Puf based securing of device update | |
Katulić et al. | Protecting Modbus/TCP-Based Industrial Automation and Control Systems Using Message Authentication Codes | |
CN114721634A (en) | Sub-packet packaging and encryption method and system based on custom class loader | |
CN112865965B (en) | Train service data processing method and system based on quantum key | |
CN115208615A (en) | Data encryption transmission method for numerical control system | |
US8838955B2 (en) | Two-way, secure, data communication within critical infrastructures | |
CN102469067B (en) | HTTP hidden button protection method based on preposed gateway | |
CN111490874B (en) | Distribution network safety protection method, system, device and storage medium | |
Askarov et al. | Cryptographically-masked flows | |
US20230153445A1 (en) | Enhanced security systems and methods using a hybrid security solution | |
CN100596350C (en) | Method for encrypting and decrypting industrial control data | |
Isa et al. | A secure TFTP protocol with security proofs | |
CN115242392B (en) | Method and system for realizing industrial information safety transmission based on safety transmission protocol | |
Li | Exploring the Application of Data Encryption Technology in Computer Network Security | |
CN111478948B (en) | Block chain access method, internet of things equipment and storage medium | |
Zahabiun | One Time Pad Encrypted Messaging System | |
Rao et al. | Hardening of the modbus protocol |
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 |