CN108134799B - Novel coding and decoding method and device thereof - Google Patents
Novel coding and decoding method and device thereof Download PDFInfo
- Publication number
- CN108134799B CN108134799B CN201810049121.3A CN201810049121A CN108134799B CN 108134799 B CN108134799 B CN 108134799B CN 201810049121 A CN201810049121 A CN 201810049121A CN 108134799 B CN108134799 B CN 108134799B
- Authority
- CN
- China
- Prior art keywords
- decoding
- module
- algorithm
- coding
- code
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000012216 screening Methods 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000004888 barrier function Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
Abstract
The invention discloses a novel coding and decoding method, which comprises coding and decoding; the coding comprises the steps of obtaining a coding algorithm and editing the coding algorithm into a coding module; obtaining a plaintext and a selected coding algorithm; encoding a plaintext; the decoding comprises the steps of obtaining a decoding algorithm and editing the decoding algorithm into a decoding module; acquiring code text; and selecting a decoding module to decode the code text. The invention also provides a device for realizing the novel coding and decoding method, which comprises an input module, a coding module, a decoding module and a display module; the input module inputs text to be encoded or decoded, the text is encoded by the encoding module or decoded by the decoding module, and the text is displayed and output by the display module. The invention can encode the plaintext or automatically search the decoding algorithm for decoding by identifying the effective characters in the code nametext according with the rules and according to the statistical rules of the code texts in each decoding algorithm, so the method and the device thereof are suitable for various types of decoding algorithms and have strong fault-tolerant capability.
Description
Technical Field
The invention particularly relates to a novel coding and decoding method and a device thereof.
Background
With the development of national economic technology and the improvement of living standard of people, people have stronger protection consciousness on personal information, and enterprise companies and the like have higher and higher requirements on confidentiality of core business and data. With the advent of the internet era, the intelligent era and the cloud era, the security in the data transmission process is more and more emphasized by people.
Encoding and decoding are one of the essential links in the security process. In order to improve the security of the information transmission process, most web pages encode the transmitted content in the information transmission process. The lock is bound to have a key, and decoding is an important issue to be studied in information security. Although there are many encoding methods, the common web page encoding methods only include Url, Hex, Base64, MD5, etc. in consideration of security and execution efficiency.
At present, the existing adding and decoding tools of the same type on the market are various in types, and all the tools also comprise adding and decoding functions of common adding and decoding modes. However, in practical use, the user experience is often poor, and the main reasons are: the error tolerance is not strong and the operation is too cumbersome when decoding the multicoded text is required.
Disclosure of Invention
One of the objectives of the present invention is to provide a novel encoding and decoding method which is applicable to various types of encoding and decoding algorithms and has strong fault-tolerant capability.
The second objective of the present invention is to provide a device for implementing the novel coding and decoding method.
The novel coding and decoding method provided by the invention comprises a coding process and a decoding process:
the encoding process includes the steps of:
s1, acquiring various types of coding algorithms, and editing the coding algorithms into corresponding coding modules;
s2, acquiring the plaintext to be encoded, and selecting one of the encoding modules acquired in the step S1 by the user;
s3, calling the coding module selected in the step S2 to code the acquired plaintext, thereby obtaining a coded plaintext;
the decoding process comprises the following steps:
A. acquiring decoding algorithms of various types, and editing the decoding algorithms into corresponding decoding modules;
B. acquiring a code text needing to be decoded;
C. selecting a corresponding decoding module;
D. and C, calling the decoding module selected in the step C to decode the code text, thereby obtaining a decoded plaintext.
The encoding algorithm in step S1 specifically includes a URL encoding algorithm, a HEX encoding algorithm, a BASE64 encoding algorithm, a Unicode encoding algorithm, an MD5x16 encryption algorithm, an MD5x32 encryption algorithm, a kaiser shift encryption algorithm, and a fence cipher encryption algorithm.
The encoding module encodes a plaintext, and specifically encodes the plaintext by adopting the following principle:
r1, if the plaintext to be encoded accords with the input rule of the encoding module, the encoding module directly encodes the plaintext;
and R2, if the plaintext to be encoded does not accord with the input rule of the encoding module, the encoding module encodes part of the plaintext which accords with the input rule in the input plaintext and displays the encoding result.
The decoding algorithm in the step a specifically includes a URL decoding algorithm, a HEX decoding algorithm, a BASE64 decoding algorithm, and a Unicode decoding algorithm.
Step C, automatically selecting a decoding module according to the obtained code text, specifically selecting the corresponding decoding module by adopting the following rules:
r1, if the user explicitly selects a decoding module, using the decoding module to decode;
r2. if the user does not explicitly select the decoding module, the decoding module is selected by the following steps:
a. acquiring an ASCII code of an input code text, and counting each character in the ASCII code;
b. and b, selecting a corresponding decoding module for decoding by adopting the following rules according to the ASCII code counted in the step a:
if the percentage of ASCII codes of the code text exceeds one third, the code text is determined to be coded by a URL coding algorithm, and a decoding module selects a URL decoding module;
if ASCII codes of the code text begin with '0 x', and 90% of characters are 0-9 and A-F, the code text is determined to be coded by an HEX coding algorithm, and the decoding module selects an HEX decoding algorithm;
if the sum of capital letters and lowercase letters in ASCII codes of the code text exceeds 60 percent, or the code text is ended by one or two "=" numbers, the code text is determined to be coded by a BASE64 coding algorithm, and the decoding module selects a BASE64 decoding algorithm;
if all ASCII codes of the code text are numbers or spaces, the code text is determined to be ASCII codes;
if '\\ u 00' is used as a separator in the ASCII code of the code text, the code text is determined to be coded by a Unicode coding algorithm, and the decoding module selects the Unicode decoding algorithm;
and D, calling the decoding module selected in the step C to decode the code text, specifically adopting the following steps to decode:
(1) c, checking and screening the code text content according to the decoding module selected in the step C;
(2) c, decoding the code text obtained in the step 1 by adopting the decoding module selected in the step C;
(3) and if the selected decoding module can not decode the code text, directly returning the original code text and prompting the user that the code text code can not be determined.
The invention also discloses a device for realizing the novel coding and decoding method, which comprises an input module, a coding module, a decoding module and a display module; the input module is used for inputting texts needing encoding or decoding; the encoding module is used for encoding the text input from the input module, the decoding module is used for decoding the text input from the input module, and the display module is used for displaying and outputting the encoded or decoded text.
The novel coding and decoding method and the device thereof can code the plain text or automatically search the decoding algorithm for decoding the characters needing decoding by identifying the effective characters which conform to the rules in the coded plain text and according to the statistical rules of the ASCII codes of the code text in each decoding algorithm, so the method and the device thereof are suitable for various types of decoding algorithms and have strong fault-tolerant capability.
Drawings
FIG. 1 is a flow chart of the encoding of the method of the present invention.
FIG. 2 is a decoding flow chart of the method of the present invention.
FIG. 3 is a functional block diagram of the apparatus of the present invention.
Detailed Description
FIG. 1 shows a coding flow chart of the method of the present invention: the encoding process includes the steps of:
s1, acquiring various types of coding algorithms, and editing the coding algorithms into corresponding coding modules; in specific implementation, the encoding algorithm comprises a URL encoding algorithm, a HEX encoding algorithm, a BASE64 encoding algorithm, a Unicode encoding algorithm, an MD5x16 encryption algorithm, an MD5x32 encryption algorithm, a kaser shift encryption algorithm, a barrier cipher encryption algorithm, and the like;
s2, acquiring the plaintext to be encoded, and selecting one of the encoding modules acquired in the step S1 by the user;
s3, calling the coding module selected in the step S2 to code the obtained plaintext so as to obtain a coded plaintext, and specifically adopting the following rules to code:
r1, if the plaintext to be encoded accords with the input rule of the encoding module, the encoding module directly encodes the plaintext;
and R2, if the plaintext to be encoded does not accord with the input rule of the encoding module, the encoding module encodes part of the plaintext which accords with the input rule in the input plaintext and displays the encoding result.
FIG. 2 shows a decoding flow chart of the method of the present invention: the decoding process comprises the following steps:
A. acquiring decoding algorithms of various types, and editing the decoding algorithms into corresponding decoding modules; in specific implementation, the decoding algorithm specifically includes a URL decoding algorithm, a HEX decoding algorithm, a BASE64 decoding algorithm, a Unicode decoding algorithm, and the like;
B. acquiring a code text needing to be decoded;
C. selecting a corresponding decoding module, specifically selecting the corresponding decoding module by adopting the following rules:
r1, if the user explicitly selects a decoding module, using the decoding module to decode;
r2. if the user does not explicitly select the decoding module, the decoding module is selected by the following steps:
a. acquiring an ASCII code of an input code text, and counting each character in the ASCII code;
b. and b, selecting a corresponding decoding module for decoding by adopting the following rules according to the ASCII code counted in the step a:
if the percentage of ASCII codes of the code text exceeds one third, the code text is determined to be coded by a URL coding algorithm, and a decoding module selects a URL decoding module;
if ASCII codes of the code text begin with '0 x', and 90% of characters are 0-9 and A-F, the code text is determined to be coded by an HEX coding algorithm, and the decoding module selects an HEX decoding algorithm;
if the sum of capital letters and lowercase letters in ASCII codes of the code text exceeds 60 percent, or the code text is ended by one or two "=" numbers, the code text is determined to be coded by a BASE64 coding algorithm, and the decoding module selects a BASE64 decoding algorithm;
if all ASCII codes of the code text are numbers or spaces, the code text is determined to be ASCII codes;
if '\\ u 00' is used as a separator in the ASCII code of the code text, the code text is determined to be coded by a Unicode coding algorithm, and the decoding module selects the Unicode decoding algorithm;
D. c, the decoding module selected in the step C is called to decode the code text, so that a decoded plaintext is obtained; specifically, the following steps are adopted for decoding:
(1) c, checking and screening the code text content according to the decoding module selected in the step C;
(2) c, decoding the code text obtained in the step 1 by adopting the decoding module selected in the step C;
when the steps (1) and (2) are implemented specifically, the functions are as follows: c, decoding the part of the code text which can be decoded in the code text by adopting the decoding module selected in the step C, and directly returning the code text to the user after the rest part of the code text cannot be decoded;
(3) and if the selected decoding module can not decode the code text, directly returning the original code text and prompting the user that the code text code can not be determined.
Fig. 3 is a functional block diagram of the apparatus of the novel encoding and decoding method of the present invention, which includes an input module, an encoding module, a decoding module and a display module; the input module is used for inputting texts needing encoding or decoding; the encoding module is used for encoding the text input from the input module, the decoding module is used for decoding the text input from the input module, and the display module is used for displaying and outputting the encoded or decoded text.
Claims (3)
1. A novel coding and decoding method comprises a coding process and a decoding process:
the encoding process includes the steps of:
s1, acquiring various types of coding algorithms, and editing the coding algorithms into corresponding coding modules; the method specifically comprises a URL coding algorithm, a HEX coding algorithm, a BASE64 coding algorithm and a Unicode coding algorithm;
s2, acquiring the plaintext to be encoded, and selecting one of the encoding modules acquired in the step S1 by the user;
s3, calling the coding module selected in the step S2 to code the acquired plaintext, thereby obtaining a coded plaintext;
the decoding process comprises the following steps:
A. acquiring decoding algorithms of various types, and editing the decoding algorithms into corresponding decoding modules; the method specifically comprises a URL decoding algorithm, a HEX decoding algorithm, a BASE64 decoding algorithm and a Unicode decoding algorithm;
B. acquiring a code text needing to be decoded;
C. selecting a corresponding decoding module; specifically, the following rules are adopted to select the corresponding decoding module:
r1, if the user explicitly selects a decoding module, using the decoding module to decode;
r2. if the user does not explicitly select the decoding module, the decoding module is selected by the following steps:
a. acquiring an ASCII code of an input code text, and counting each character in the ASCII code;
b. and b, selecting a corresponding decoding module for decoding by adopting the following rules according to the ASCII code counted in the step a:
if the percentage of ASCII codes of the code text exceeds one third, the code text is determined to be coded by a URL coding algorithm, and a decoding module selects a URL decoding module;
if ASCII codes of the code text begin with '0 x', and 90% of characters are 0-9 and A-F, the code text is determined to be coded by an HEX coding algorithm, and the decoding module selects an HEX decoding algorithm;
if the sum of capital letters and lowercase letters in ASCII codes of the code text exceeds 60 percent, or the code text is ended by one or two "=" numbers, the code text is determined to be coded by a BASE64 coding algorithm, and the decoding module selects a BASE64 decoding algorithm;
if all ASCII codes of the code text are numbers or spaces, the code text is determined to be ASCII codes;
if '\\ u 00' is used as a separator in the ASCII code of the code text, the code text is determined to be coded by a Unicode coding algorithm, and the decoding module selects the Unicode decoding algorithm;
D. and C, calling the decoding module selected in the step C to decode the code text, thereby obtaining a decoded plaintext.
2. The novel encoding and decoding method as claimed in claim 1, wherein the encoding module encodes the plaintext by using the following principle:
r1, if the plaintext to be encoded accords with the input rule of the encoding module, the encoding module directly encodes the plaintext;
and R2, if the plaintext to be encoded does not accord with the input rule of the encoding module, the encoding module encodes part of the plaintext which accords with the input rule in the input plaintext and displays the encoding result.
3. The novel encoding and decoding method as claimed in claim 2, wherein the step D of invoking the decoding module selected in the step C to decode the ciphertext specifically comprises the steps of:
(1) c, checking and screening the code text content according to the decoding module selected in the step C;
(2) c, decoding the code text obtained in the step 1 by adopting the decoding module selected in the step C;
(3) and if the selected decoding module can not decode the code text, directly returning the original code text and prompting the user that the code text code can not be determined.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810049121.3A CN108134799B (en) | 2018-01-18 | 2018-01-18 | Novel coding and decoding method and device thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810049121.3A CN108134799B (en) | 2018-01-18 | 2018-01-18 | Novel coding and decoding method and device thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108134799A CN108134799A (en) | 2018-06-08 |
CN108134799B true CN108134799B (en) | 2021-06-22 |
Family
ID=62399817
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810049121.3A Active CN108134799B (en) | 2018-01-18 | 2018-01-18 | Novel coding and decoding method and device thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108134799B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109818969A (en) * | 2019-03-06 | 2019-05-28 | 电子科技大学成都学院 | Cryptographic algorithm encrypting and deciphering system |
CN110287147B (en) * | 2019-06-27 | 2022-08-19 | 北京奇艺世纪科技有限公司 | Character string sorting method and device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106357608A (en) * | 2016-08-19 | 2017-01-25 | 银江股份有限公司 | Method for encrypting and decrypting private data for personal healthcare data |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101626293B (en) * | 2008-07-09 | 2011-10-26 | 上海格尔软件股份有限公司 | Method for encryption protection and decryption of data |
US9806886B2 (en) * | 2013-01-21 | 2017-10-31 | Alcatel Lucent | Service plane encryption in IP/MPLS networks |
CN105553934B (en) * | 2015-12-01 | 2018-11-02 | 辽宁中科信科技有限公司 | Based on SAAS layers of omnipotent decoding methods of EAB of cloud platform |
CN106385313A (en) * | 2016-09-08 | 2017-02-08 | 四川长虹电器股份有限公司 | Random cryptograph system based on grouping encryption algorithm and realization method thereof |
CN106789053A (en) * | 2016-12-13 | 2017-05-31 | 四川长虹电器股份有限公司 | Random ciphertext generation method and system, decryption method and system |
-
2018
- 2018-01-18 CN CN201810049121.3A patent/CN108134799B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106357608A (en) * | 2016-08-19 | 2017-01-25 | 银江股份有限公司 | Method for encrypting and decrypting private data for personal healthcare data |
Also Published As
Publication number | Publication date |
---|---|
CN108134799A (en) | 2018-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Naqvi et al. | Multilayer partially homomorphic encryption text steganography (MLPHE-TS): a zero steganography approach | |
Kumar et al. | A space based reversible high capacity text steganography scheme using font type and style | |
CN108134799B (en) | Novel coding and decoding method and device thereof | |
CN105656626A (en) | Reverse reconstruction encryption method | |
CN115296862A (en) | Network data secure transmission method based on data coding | |
Ahmed et al. | Comparison of eight proposed security methods using linguistic steganography text | |
Lee et al. | Secret communication through web pages using special space codes in HTML files | |
Din et al. | Traid-bit embedding process on Arabic text steganography method | |
CN111080503B (en) | Instruction coding control method for network public opinion emergency command system in CS mode | |
Malik et al. | A high capacity text steganography scheme based on huffman compression and color coding | |
CN111242259B (en) | Intelligent anti-counterfeiting code encoding and decoding method and system | |
CN104393988B (en) | A kind of reversible data ciphering method and device | |
CN105631346A (en) | Spark database electronic coded lock safe and convenient to use and operation method thereof | |
CN116055067A (en) | Weak password detection method, device, electronic equipment and medium | |
Ahmad et al. | Protection of the texts using Base64 and MD5 | |
CN102238150A (en) | Form registration method and server | |
Manikandasaran et al. | MONcrypt: a technique to ensure the confidentiality of outsourced data in cloud storage | |
CN115550030A (en) | Data encryption method and device, storage medium and electronic equipment | |
Malalla et al. | A novel approach for Arabic text steganography based on the “BloodGroup” text hiding method | |
CN111309987B (en) | Encryption algorithm identification method and device in actual attack scene | |
Binu et al. | Security plugin for Mozilla which integrates cryptography and steganography features | |
US20180019977A1 (en) | Multi-layered data security | |
Dai et al. | BinText steganography based on Markov state transferring probability | |
Saniei et al. | The capacity of arithmetic compression based text steganography method | |
TW201411393A (en) | Encrypting system and method thereof |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |