CN115906128A - Character string processing method, device, equipment and medium - Google Patents

Character string processing method, device, equipment and medium Download PDF

Info

Publication number
CN115906128A
CN115906128A CN202211619204.4A CN202211619204A CN115906128A CN 115906128 A CN115906128 A CN 115906128A CN 202211619204 A CN202211619204 A CN 202211619204A CN 115906128 A CN115906128 A CN 115906128A
Authority
CN
China
Prior art keywords
ciphertext
dimensional coordinate
character string
character
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211619204.4A
Other languages
Chinese (zh)
Inventor
方旭盛
伞兴
李建夫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Nuonuo Network Technology Co ltd
Original Assignee
Zhejiang Nuonuo Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Nuonuo Network Technology Co ltd filed Critical Zhejiang Nuonuo Network Technology Co ltd
Priority to CN202211619204.4A priority Critical patent/CN115906128A/en
Publication of CN115906128A publication Critical patent/CN115906128A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The application discloses a character string processing method, a device, equipment and a medium, which relate to the technical field of computers and comprise the following steps: acquiring a plaintext character string, splitting the plaintext character string and adding indexes to obtain each plaintext character segment; performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment; and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end. Through the technical scheme, the safety of character string processing can be improved, and the information leakage in the character string processing process is reduced.

Description

Character string processing method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for processing a character string.
Background
At present, some sensitive data transmission is often performed in the system interactive communication process, a sender needs to encode information and then send the encoded information, a receiver receives the information and then decodes the information to obtain the required information, and a plurality of encoding and decoding methods which can be selected and used in the whole process are provided.
Therefore, how to improve the security of processing the character string and reduce the information leakage in the character string processing process is a problem to be solved in the field.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus, a device, and a medium for processing a character string, which can improve security of processing the character string and reduce information leakage in the process of processing the character string. The specific scheme is as follows:
in a first aspect, the present application discloses a method for processing a string, applied to a sending end, including:
acquiring a plaintext character string, splitting the plaintext character string and adding indexes to obtain each plaintext character segment;
performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment;
and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end.
Optionally, the performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, and determining each two-dimensional coordinate based on each three-dimensional coordinate includes:
carrying out ASCII (American standard code for information interchange) coding conversion on each clear character segment to obtain each three-dimensional coordinate;
and drawing a three-dimensional coordinate system based on each three-dimensional coordinate and according to a discrete distribution mode, and performing coordinate system projection processing on the three-dimensional coordinate system to obtain each two-dimensional coordinate.
Optionally, the performing coordinate system projection processing on the three-dimensional coordinate system to obtain each two-dimensional coordinate includes:
performing modulus processing on each plaintext character segment to obtain a sequence, and sending the plaintext character segments to the sequence to obtain adjacent coordinate points in the sequence;
performing coordinate system projection processing on the three-dimensional coordinate system to obtain a two-dimensional coordinate system,
and processing the two-dimensional coordinate system and the adjacent coordinate points in the sequence by using a GIS algorithm to obtain each two-dimensional coordinate.
Optionally, if the number of the characters is an odd number, the ciphertext characters are spliced according to a preset odd ciphertext splicing method to obtain a ciphertext character string, where the method includes:
if the number of the characters is an odd number, carrying out ASCII code conversion and binary conversion on the plaintext character string respectively to obtain a first binary number and a second binary number, adding a sequence number to each ciphertext character, taking the ciphertext character with the odd number as a first target ciphertext character, and taking the ciphertext character with the even number as a second target ciphertext character;
and splicing the ciphertext characters according to the sequence of the first carry number, the first target ciphertext character, the second carry number and the second target ciphertext character to obtain a ciphertext character string.
Optionally, after determining the number of characters of the plaintext character string, the method further includes:
and if the number of the characters is an even number, splicing the ciphertext characters according to the sequence of the first system number, the second target ciphertext character, the second system number and the first target ciphertext character to obtain a ciphertext character string.
Optionally, the splicing and compressing the key fragments to obtain a key includes:
determining the preset key segment conversion number, splicing the key segments, and then performing hexadecimal number conversion and compression operation on the key segments according to the key segment conversion number to obtain the key.
In a second aspect, the present application discloses another character string processing method, which is applied to a receiving end, and includes:
acquiring the ciphertext character string and the key sent by the sending end, determining the number of the ciphertext character string, and if the number of the ciphertext character string is an odd number, analyzing and splitting the ciphertext character string according to an odd number ciphertext splicing method to obtain each ciphertext character;
analyzing and compressing the key to obtain the key segment, and performing coordinate point reduction operation on each ciphertext character and the key segment to obtain each two-dimensional coordinate;
determining each three-dimensional coordinate based on each two-dimensional coordinate, analyzing each three-dimensional coordinate to obtain each plaintext character segment, and splicing each plaintext character segment to obtain the plaintext character string.
In a third aspect, the present application discloses a character string processing apparatus, comprising:
the plaintext character string acquisition module is used for acquiring plaintext character strings, splitting the plaintext character strings and adding indexes to obtain each plaintext character segment;
the three-dimensional coordinate determination module is used for performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and then analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment;
and the ciphertext character string determining module is used for splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd number ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end.
In a fourth aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the character string processing method.
In a fifth aspect, the present application discloses a computer storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the steps of the string processing method disclosed in the foregoing.
The method comprises the steps of obtaining a plaintext character string, splitting the plaintext character string and adding indexes to obtain plaintext character segments; performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment; and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end. In the http request process, a sending end codes data to be transmitted before a request, an obtained ciphertext character string and a secret key are placed in the request, then the request is sent to a receiving end, the receiving end needs to obtain the ciphertext secret key at the same time after receiving the request, the data to be received is obtained by decoding through the method, the data is not transmitted in a plaintext in the process, the possibility of leakage is obviously reduced, even if the data is hijacked, the difficulty and the cost of cracking the encrypted data can be greatly increased, the safety of character string processing is improved, and the condition of information leakage in the character string processing process is reduced.
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 embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a string processing method disclosed herein;
FIG. 2 is a flow chart of the United states information exchange standard transcoding disclosed herein;
FIG. 3 is an exemplary diagram of a three-dimensional coordinate system disclosed herein;
FIG. 4 is a flow chart of an independent sequence determination disclosed herein;
FIG. 5 is an exemplary projection diagram of a coordinate system disclosed herein;
FIG. 6 is a flow chart of a two-dimensional coordinate determination disclosed herein;
FIG. 7 is a sequence and coordinate relationship diagram of the present disclosure;
FIG. 8 is a ciphertext character determination flow diagram of the present disclosure;
FIG. 9 is a flow chart of a method for processing a string of characters disclosed herein;
FIG. 10 is a flow chart of another string processing method disclosed herein;
FIG. 11 is a flow chart of string decoding translation disclosed in the present application;
FIG. 12 is a specific flow chart of string encoding disclosed herein;
FIG. 13 is a specific flowchart of string decoding disclosed herein;
FIG. 14 is a schematic structural diagram of a string processing apparatus according to the present disclosure;
fig. 15 is a block diagram of an electronic device provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, some sensitive data transmission is often performed in the system interactive communication process, a sender needs to encode information and then send the encoded information, a receiver receives the information and then decodes the information to obtain the required information, and a plurality of encoding and decoding methods which can be selected and used in the whole process are provided. Therefore, how to improve the security of processing the character string and reduce the information leakage in the character string processing process is a problem to be solved in the field.
Referring to fig. 1, an embodiment of the present invention discloses a method for processing a character string, which may specifically include:
step S11: and acquiring a plaintext character string, splitting the plaintext character string and adding indexes to obtain each plaintext character segment.
Step S12: and performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment.
In this embodiment, ASCII encoding conversion is performed on each plaintext character segment to obtain each three-dimensional coordinate, a three-dimensional coordinate system is drawn based on each three-dimensional coordinate in a discrete distribution manner, a coordinate system projection process is performed on the three-dimensional coordinate system to obtain each two-dimensional coordinate, and then each two-dimensional coordinate is analyzed to obtain a ciphertext character and a key segment.
In this embodiment, as shown in fig. 2, a specific process of obtaining a Plaintext character string Plaintext is to split the Plaintext character string and add an index to obtain characters s0, s1, s2, s3, s4, and s5 \8230, to convert the characters into an ASCII Code (American Standard Code for Information exchange) to obtain an 8-bit binary number, to split the 8-bit binary number into two 4-bit binary numbers, to perform binary conversion to obtain a decimal number, to obtain a three-dimensional coordinate P (x, y, z) by combining the character index, to obtain three-dimensional points P0, P1, P82302, P3, P4, and P5 \\ \ coordinate points P0, P1, P2, P3, P4, and P5 \ are then drawn into the same coordinate system to obtain a three-dimensional coordinate system in which coordinate points are distributed, as shown in fig. 3.
The specific coordinate system projection processing process comprises the following steps: performing modulus processing on each plaintext character segment to obtain a sequence, and sending the plaintext character segments to the sequence to obtain adjacent coordinate points in the sequence; and performing coordinate system projection processing on the three-dimensional coordinate system to obtain a two-dimensional coordinate system, and processing the two-dimensional coordinate system and adjacent coordinate points in the sequence by using a GIS algorithm to obtain each two-dimensional coordinate. For example, the character sequences s0, s1, s2, s3, s4, and s5. Are classified according to the parity of the index to obtain two independent sequences, as shown in fig. 4, then the character s0 is added to the head of the sequence, two characters in the sequence are sequentially taken to obtain a corresponding three-dimensional coordinate P, as shown in fig. 5, the three-dimensional coordinate P is processed into a two-dimensional coordinate system (z-axis projection) through the coordinate system projection, a GIS algorithm is adopted to obtain a relative coordinate (i.e., two-dimensional coordinate) Q (x, y) of a subsequent coordinate with a former coordinate as an origin, a specific flow is shown in fig. 6, and by this analogy, two-dimensional coordinates Q1, Q2, Q3, Q4, and Q5 \\ \ 8230can be obtained, the two independent sequences are a sequence 1 and a sequence 2, and the relationship between the sequence, the character sequence, the three-dimensional coordinate, and the two-dimensional coordinate is shown in fig. 7. Finally, a ciphertext character and a key fragment can be obtained by operating and converting the two-dimensional coordinate point Q (x, y), and the conversion steps are as shown in fig. 8.
Step S13: and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end.
In this embodiment, a preset key segment conversion number is determined, the key segments are spliced, hexadecimal number conversion and compression operations are performed on the key segments according to the key segment conversion number to obtain a key, the number of characters of the plaintext character string is determined, if the number of characters is an odd number, the ciphertext characters are spliced according to a preset odd number ciphertext splicing method to obtain a ciphertext character string, and the ciphertext character string and the key are sent to a receiving end.
In the embodiment, a plaintext character string is obtained, and the plaintext character string is split and added with an index to obtain each plaintext character segment; performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment; and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end. In the http request process, a sending end codes data to be transmitted by the method before a request, and places obtained ciphertext character strings and keys in the request, and then the sending end sends the request to a receiving end, and the receiving end needs to simultaneously obtain the ciphertext keys after receiving the request and obtains the data to be received by decoding through the method.
Referring to fig. 9, an embodiment of the present invention discloses a method for processing a character string, which may specifically include:
step S21: and acquiring a plaintext character string, splitting the plaintext character string and adding indexes to obtain each plaintext character segment.
Step S22: and performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment.
Step S23: splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, if the number of characters is an odd number, respectively performing ASCII code conversion and binary conversion on the plaintext character string to obtain a first binary number and a second binary number, adding a sequence number to each ciphertext character, taking the ciphertext character with the odd number as a first target ciphertext character, taking the ciphertext character with the even number as a second target ciphertext character, splicing the ciphertext characters according to the sequence of the first binary number, the first target ciphertext character, the second binary number and the second target ciphertext character to obtain a ciphertext character string, and sending the ciphertext character string and the key to a receiving end.
In this embodiment, after determining the number of characters of the plaintext character string, the method further includes: and if the number of the characters is an even number, splicing the ciphertext characters according to the sequence of the first system number, the second target ciphertext character, the second system number and the first target ciphertext character to obtain a ciphertext character string.
In this embodiment, after obtaining the ciphertext character and the key fragment, the ciphertext character t1, t2, t3, t4 and the key fragment k1, k2, k3, k4 may be obtained through calculation, then ASCII code conversion is performed on the character s0 to obtain an 8-bit binary number, then the 8-bit binary number is split into two 4-bit binary numbers, then binary conversion is performed respectively to convert the binary numbers into hexadecimal numbers h1 (i.e., a first binary number) and h2 (i.e., a second binary number), then judgment is performed according to the number of characters of a Plaintext character string plain, and if the number of characters is an odd number, the ciphertext splicing manner is: h1+ sequence 1 corresponds to ciphertext (t 1, t3, t 5.) + h2+ sequence 2 corresponds to ciphertext (t 2, t4, t 6.); if the number of the characters is even, the cipher text splicing mode is as follows: h1+ serialisation 2 corresponds to ciphertext (t 2, t4, t 6.) + h2+ serialisation 1 corresponds to ciphertext (t 1, t3, t 5.). And (3) obtaining a Ciphertext Ciphertext after splicing according to rules, then splicing the key fragments k1, k2, k3 and k4. According to indexes, starting from the first position, converting every four characters as binary numbers into hexadecimal numbers, and obtaining a key secret.
In the embodiment, a plaintext character string is obtained, and the plaintext character string is split and added with an index to obtain each plaintext character segment; performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment; and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end. In the http request process, a sending end codes data to be transmitted by the method before a request, and places obtained ciphertext character strings and keys in the request, and then the sending end sends the request to a receiving end, and the receiving end needs to simultaneously obtain the ciphertext keys after receiving the request and obtains the data to be received by decoding through the method.
Referring to fig. 10, an embodiment of the present invention discloses another method for processing a string, which may specifically include:
step S31: and acquiring the ciphertext character string and the key sent by the sending end, determining the number of the ciphertext character string, and if the number of the ciphertext character string is an odd number, analyzing and splitting the ciphertext character string according to an odd number ciphertext splicing method to obtain each ciphertext character.
Step S32: and analyzing and compressing the key to obtain the key segment, and performing coordinate point reduction operation on each ciphertext character and the key segment to obtain each two-dimensional coordinate.
Step S33: and determining each three-dimensional coordinate based on each two-dimensional coordinate, analyzing each three-dimensional coordinate to obtain each plaintext character segment, and splicing each plaintext character segment to obtain the plaintext character string.
In this embodiment, the secret key secrekey is converted from hexadecimal into binary, then the first digit is judged, each two digits correspond to a quadrant of two-dimensional coordinates of the ciphertext, and then the two-dimensional coordinates Q (x, y) can be obtained by matching with the ciphertexts t1, t2, t3, t4 and t5. Three-dimensional coordinates P1 (x, y, Z) can be obtained by knowing three known conditions of coordinates Q0, relative coordinates Q1 and Z-axis coordinates, coordinates P2, P3, P4 and P5. Can be obtained by analogy, known three-dimensional coordinate points P0, P1, P2, P3, P4 and P5. Are drawn into the same coordinate system, and the coordinate points are sequentially analyzed from small to large according to the sequence of the Z-axis. The analysis rule is as follows: and taking out x and y of the three-dimensional coordinate P (x, y and z), respectively converting the x and y into binary numbers, splicing, and then obtaining ASCII code characters, namely plaintext characters by contrasting ASCII codes. And splicing the Plaintext characters in sequence to obtain the Plaintext, and decoding successfully.
The sending end process of the application is as shown in fig. 12, firstly, the sending end obtains a plaintext character string, splits the plaintext character string and adds an index to obtain each plaintext character segment, then performs code conversion on each plaintext character segment to obtain each three-dimensional coordinate, further obtains a three-dimensional coordinate system, then performs modular processing on each character to obtain two independent sequences, determines each two-dimensional coordinate (x, y) through coordinate system projection processing and GIS algorithm, then analyzes each two-dimensional coordinate to obtain a ciphertext character and a key segment, performs splicing compression on the key segment to obtain a key, determines the character number of the plaintext character string, if the character number is an odd number, splices ciphertext characters according to a preset odd number ciphertext splicing method to obtain a ciphertext character string, if the character number is an even number, splices the ciphertext characters according to a preset even number splicing method to obtain a ciphertext character string, then sends the ciphertext character string and the key to a receiving end, if the receiving end process is as shown in fig. 13, obtains the ciphertext character string and the key sent by the sending end, then determines the ciphertext string and the number of the ciphertext string according to a preset even number, determines the ciphertext string to obtain an odd number, and splits the ciphertext string to obtain a ciphertext character string, if the ciphertext string is an odd number, and analyzes the ciphertext string; if the number of the ciphertext character strings is an even number, the ciphertext character strings are analyzed and split according to an even number ciphertext splicing method to obtain each ciphertext character, then keys are analyzed and compressed to obtain key fragments, coordinate point reduction operation is carried out on each ciphertext character and each key fragment to obtain each two-dimensional coordinate, each three-dimensional coordinate is determined based on each two-dimensional coordinate, each three-dimensional coordinate is analyzed to obtain each plaintext character segment, and then each plaintext character segment is spliced to obtain a plaintext character string.
In the embodiment, a plaintext character string is obtained, and the plaintext character string is split and added with an index to obtain each plaintext character segment; performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment; and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end. In the http request process, a sending end codes data to be transmitted before a request, an obtained ciphertext character string and a secret key are placed in the request, then the request is sent to a receiving end, the receiving end needs to obtain the ciphertext secret key at the same time after receiving the request, the data to be received is obtained by decoding through the method, the data is not transmitted in a plaintext in the process, the possibility of leakage is obviously reduced, even if the data is hijacked, the difficulty and the cost of cracking the encrypted data can be greatly increased, the safety of character string processing is improved, and the condition of information leakage in the character string processing process is reduced.
Referring to fig. 14, an embodiment of the present invention discloses a character string processing apparatus, which may specifically include:
a plaintext character string obtaining module 11, configured to obtain a plaintext character string, split the plaintext character string, and add an index to obtain each plaintext character segment;
a three-dimensional coordinate determination module 12, configured to perform code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determine each two-dimensional coordinate based on each three-dimensional coordinate, and then analyze each two-dimensional coordinate to obtain a ciphertext character and a key segment;
and the ciphertext character string determining module 13 is configured to splice and compress the key segments to obtain a key, determine the number of characters of the plaintext character string, if the number of characters is an odd number, splice the ciphertext characters according to a preset odd number ciphertext splicing method to obtain a ciphertext character string, and send the ciphertext character string and the key to a receiving end.
In the embodiment, a plaintext character string is obtained, and the plaintext character string is split and added with an index to obtain each plaintext character segment; performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment; and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end. In the http request process, a sending end codes data to be transmitted by the method before a request, and places obtained ciphertext character strings and keys in the request, and then the sending end sends the request to a receiving end, and the receiving end needs to simultaneously obtain the ciphertext keys after receiving the request and obtains the data to be received by decoding through the method.
In some specific embodiments, the three-dimensional coordinate determination module 12 may specifically include:
the three-dimensional coordinate determination module is used for carrying out ASCII code conversion on each plaintext character segment to obtain each three-dimensional coordinate;
and the two-dimensional coordinate determination module is used for drawing a three-dimensional coordinate system based on each three-dimensional coordinate in a discrete distribution mode and carrying out coordinate system projection processing on the three-dimensional coordinate system to obtain each two-dimensional coordinate.
In some specific embodiments, the three-dimensional coordinate determination module 12 may specifically include:
the module taking processing module is used for carrying out module taking processing on each plaintext character segment to obtain a sequence, and sending the plaintext character segments to the sequence to obtain adjacent coordinate points in the sequence;
a two-dimensional coordinate system determining module for performing coordinate system projection processing on the three-dimensional coordinate system to obtain a two-dimensional coordinate system,
and the GIS algorithm processing module is used for processing the two-dimensional coordinate system and the adjacent coordinate points in the sequence by utilizing a GIS algorithm to obtain each two-dimensional coordinate.
In some specific embodiments, the ciphertext character string determining module 13 may specifically include:
a system number determination module, configured to perform ASCII code conversion and system conversion on the plaintext character string to obtain a first system number and a second system number if the number of the characters is an odd number, add a sequence number to each of the ciphertext characters, use the ciphertext character with the odd sequence number as a first target ciphertext character, and use the ciphertext character with the even sequence number as a second target ciphertext character;
and the first ciphertext character string determining module is used for splicing the ciphertext characters according to the sequence of the first carry number, the first target ciphertext character, the second carry number and the second target ciphertext character to obtain a ciphertext character string.
In some specific embodiments, the ciphertext character string determining module 13 may specifically include:
and the second ciphertext character string determining module is used for splicing the ciphertext characters according to the sequence of the first carry number, the second target ciphertext character, the second binary number and the first target ciphertext character to obtain a ciphertext character string if the number of the characters is an even number.
In some specific embodiments, the ciphertext character string determining module 13 may specifically include:
and the key determining module is used for determining the preset key segment conversion number, splicing the key segments, and then carrying out hexadecimal number conversion and compression operation on the key segments according to the key segment conversion number to obtain the key.
Fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. The memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement relevant steps in the character string processing method executed by an electronic device disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., the resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage may be a transient storage or a permanent storage.
The operating system 221 is used for managing and controlling each hardware device and the computer program 222 on the electronic device 20, so as to realize the operation and processing of the data 223 in the memory 22 by the processor 21, which may be Windows, unix, linux, and the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the character string processing method disclosed in any of the foregoing embodiments and executed by the electronic device 20. The data 223 may include data received by the character string processing device and transmitted from an external device, data collected by the input/output interface 25, and the like.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Further, an embodiment of the present application further discloses a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is loaded and executed by a processor, the steps of the character string processing method disclosed in any of the foregoing embodiments are implemented.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for a method, an apparatus, a device and a storage medium for processing a character string provided by the present invention, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A character string processing method is applied to a sending end and comprises the following steps:
acquiring a plaintext character string, splitting the plaintext character string and adding indexes to obtain each plaintext character segment;
performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment;
and splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end.
2. The method of claim 1, wherein the transcoding each of the plaintext character segments to obtain each three-dimensional coordinate, and determining each two-dimensional coordinate based on each three-dimensional coordinate comprises:
carrying out ASCII code conversion on each plaintext character segment to obtain each three-dimensional coordinate;
and drawing a three-dimensional coordinate system based on each three-dimensional coordinate and according to a discrete distribution mode, and performing coordinate system projection processing on the three-dimensional coordinate system to obtain each two-dimensional coordinate.
3. The method according to claim 2, wherein the performing coordinate system projection processing on the three-dimensional coordinate system to obtain each two-dimensional coordinate comprises:
performing modulus processing on each plaintext character segment to obtain a sequence, and sending the plaintext character segments to the sequence to obtain adjacent coordinate points in the sequence;
performing coordinate system projection processing on the three-dimensional coordinate system to obtain a two-dimensional coordinate system,
and processing the two-dimensional coordinate system and the adjacent coordinate points in the sequence by using a GIS algorithm to obtain each two-dimensional coordinate.
4. The method according to claim 1, wherein if the number of the characters is an odd number, the ciphertext characters are spliced according to a preset odd ciphertext splicing method to obtain a ciphertext character string, the method including:
if the number of the characters is an odd number, carrying out ASCII code conversion and binary conversion on the plaintext character string respectively to obtain a first binary number and a second binary number, adding a sequence number to each ciphertext character, taking the ciphertext character with the odd number as a first target ciphertext character, and taking the ciphertext character with the even number as a second target ciphertext character;
and splicing the ciphertext characters according to the sequence of the first carry number, the first target ciphertext character, the second carry number and the second target ciphertext character to obtain a ciphertext character string.
5. The method according to claim 4, wherein after determining the number of characters in the plaintext character string, the method further comprises:
and if the number of the characters is an even number, splicing the ciphertext characters according to the sequence of the first system number, the second target ciphertext character, the second system number and the first target ciphertext character to obtain a ciphertext character string.
6. The method according to any one of claims 1 to 5, wherein the splicing and compressing the key fragments to obtain the key comprises:
determining the preset key segment conversion number, splicing the key segments, and then performing hexadecimal number conversion and compression operation on the key segments according to the key segment conversion number to obtain the key.
7. A character string processing method is applied to a receiving end and comprises the following steps:
acquiring the ciphertext character strings and the secret key sent by the sending end, determining the number of the ciphertext character strings, and if the number of the ciphertext character strings is an odd number, analyzing and splitting the ciphertext character strings according to an odd ciphertext splicing method to obtain each ciphertext character;
analyzing and compressing the key to obtain the key segment, and performing coordinate point reduction operation on each ciphertext character and the key segment to obtain each two-dimensional coordinate;
determining each three-dimensional coordinate based on each two-dimensional coordinate, analyzing each three-dimensional coordinate to obtain each plaintext character segment, and splicing each plaintext character segment to obtain the plaintext character string.
8. A character string processing apparatus, comprising:
the plaintext character string acquisition module is used for acquiring plaintext character strings, splitting the plaintext character strings and adding indexes to obtain each plaintext character segment;
the three-dimensional coordinate determination module is used for performing code conversion on each plaintext character segment to obtain each three-dimensional coordinate, determining each two-dimensional coordinate based on each three-dimensional coordinate, and then analyzing each two-dimensional coordinate to obtain a ciphertext character and a key segment;
and the ciphertext character string determining module is used for splicing and compressing the key segments to obtain a key, determining the number of characters of the plaintext character string, splicing the ciphertext characters according to a preset odd number ciphertext splicing method to obtain a ciphertext character string if the number of the characters is an odd number, and sending the ciphertext character string and the key to a receiving end.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the character string processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the string processing method of any one of claims 1 to 7.
CN202211619204.4A 2022-12-14 2022-12-14 Character string processing method, device, equipment and medium Pending CN115906128A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211619204.4A CN115906128A (en) 2022-12-14 2022-12-14 Character string processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211619204.4A CN115906128A (en) 2022-12-14 2022-12-14 Character string processing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115906128A true CN115906128A (en) 2023-04-04

Family

ID=86483883

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211619204.4A Pending CN115906128A (en) 2022-12-14 2022-12-14 Character string processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115906128A (en)

Similar Documents

Publication Publication Date Title
US11263416B2 (en) Two-dimensional code generation and identification
CN112333186B (en) Data communication method, device, equipment and storage medium
CN112437060B (en) Data transmission method and device, computer equipment and storage medium
CN115051798A (en) Random number generation method and device, electronic equipment and storage medium
CN111191255A (en) Information encryption processing method, server, terminal, device and storage medium
CN112231736B (en) Fully homomorphic encryption microsystem, computing method, encryption method, processing end and medium
CN112436943A (en) Request deduplication method, device, equipment and storage medium based on big data
CN115906128A (en) Character string processing method, device, equipment and medium
CN115481440B (en) Data processing method, device, electronic equipment and medium
CN114840739B (en) Information retrieval method, device, electronic equipment and storage medium
CN113592097B (en) Training method and device of federal model and electronic equipment
CN115550030A (en) Data encryption method and device, storage medium and electronic equipment
CN113162628B (en) Data encoding method, data decoding method, terminal and storage medium
CN115426111A (en) Data encryption method and device, electronic equipment and storage medium
CN110517045B (en) Block chain data processing method, device, equipment and storage medium
CN111064560B (en) Data encryption transmission method and device, terminal and data encryption transmission system
CN101257387B (en) X509 digital certificate quick analyzing and verifying method
CN114070470A (en) Encoding and decoding method and device
CN114679324B (en) Data exchange method, tool, system, equipment and medium
CN113282662B (en) Block information processing method, device, equipment and medium
CN114866348B (en) Data transmission method, device and equipment based on browser and storage medium
CN113343269B (en) Encryption method and device
CN113469683A (en) Key storage method and device, electronic equipment and storage medium
CN116088938B (en) Continuous instruction processing method and system, electronic equipment and storage medium
CN117118657A (en) Encryption method, encryption device, electronic equipment 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